Skip to content

Commit

Permalink
Improve error messages on test komodo failures
Browse files Browse the repository at this point in the history
  • Loading branch information
HakonSohoel committed Oct 22, 2024
1 parent b17e439 commit 7e8f3fb
Showing 1 changed file with 38 additions and 12 deletions.
50 changes: 38 additions & 12 deletions ci/testkomodo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,41 +50,67 @@ start_tests () {

set +e

# Run all ert tests except tests evaluating memory consumption and tests requiring windows manager (GUI tests)
pytest --eclipse-simulator -n logical --show-capture=stderr -v --max-worker-restart 0 \
-m "not limit_memory and not requires_window_manager" --benchmark-disable --dist loadgroup
return_code_0=$?
return_code_ert_main_tests=$?

# Run all ert tests requiring windows manager (GUI tests) except tests evaluating memory consumption
pytest --eclipse-simulator -v --mpl \
-m "not limit_memory and requires_window_manager" --benchmark-disable
return_code_1=$?
return_code_ert_gui_tests=$?

# Restricting the number of threads utilized by numpy to control memory consumption, as some tests evaluate memory usage and additional threads increase it.
export OMP_NUM_THREADS=1

# Run ert tests that evaluates memory consumption
pytest -n 2 --durations=0 -m "limit_memory" --memray
return_code_2=$?
return_code_ert_memory_consumption_tests=$?

unset OMP_NUM_THREADS

# Run ert scheduler tests on the actual cluster (defined by $_ERT_TESTS_QUEUE_SYSTEM)
basetemp=$(mktemp -d -p "$_ERT_TESTS_SHARED_TMP")
pytest --timeout=3600 -v --"$_ERT_TESTS_QUEUE_SYSTEM" --basetemp="$basetemp" unit_tests/scheduler
return_code_3=$?
return_code_ert_sheduler_tests=$?
rm -rf "$basetemp" || true

popd

run_ert_with_opm
return_code_4=$?
return_code_opm_integration_test=$?

run_everest_tests
return_code_5=$?
return_code_everest_tests=$?
set -e


return_code_combined_tests=0
# We error if one or more returncodes are nonzero
for code in $return_code_0 $return_code_1 $return_code_2 $return_code_3 $return_code_4 $return_code_5; do
if [ "$code" -ne 0 ]; then
echo "One or more tests failed."
return 1
fi
done
if [ "$return_code_ert_main_tests" -ne 0 ]; then
echo "One or more ERT tests failed."
return_code_combined_tests=1
fi
if [ "$return_code_ert_gui_tests" -ne 0 ]; then
echo "One or more ERT GUI tests failed."
return_code_combined_tests=1
fi
if [ "$return_code_ert_memory_consumption_tests" -ne 0 ]; then
echo "One or more ERT memory consumption tests failed."
return_code_combined_tests=1
fi
if [ "$return_code_ert_sheduler_tests" -ne 0 ]; then
echo "One or more ERT scheduler tests failed."
return_code_combined_tests=1
fi
if [ "$return_code_opm_integration_test" -ne 0 ]; then
echo "The ERT OPM integration test failed."
return_code_combined_tests=1
fi
if [ "$return_code_everest_tests" -ne 0 ]; then
echo "One or more Everest tests failed."
return_code_combined_tests=1
fi
return $return_code_combined_tests

}

0 comments on commit 7e8f3fb

Please sign in to comment.