diff --git a/jobs/swh-environment.yaml b/jobs/swh-environment.yaml --- a/jobs/swh-environment.yaml +++ b/jobs/swh-environment.yaml @@ -36,18 +36,32 @@ pip install wheel pytest pip install $(bin/pip-swh-packages --with-testing) cd swh-graph - make java + make java >/dev/null cd .. - # abort when some tests fail - set -e # execute tests in each swh module + exit_code=0 for module in $(./bin/ls-py-modules) do cd $module tests_dir=$(echo $module | sed 's/-/\//g')/tests if [ -d "$tests_dir" ] then - python3 -m pytest $tests_dir + # pipe tests output to stdout and log file + python3 -m pytest $tests_dir 2>&1 | tee ../$module.log + tests_status=${PIPESTATUS[0]} + # remove log file if tests succeeded + if [[ "$tests_status" == "0" ]] + then + rm -f ../$module.log + fi + # script must be exited with error when a test suite failed + exit_code=$(( tests_status > exit_code ? tests_status : exit_code )) fi cd .. done + + exit $exit_code + + publishers: + - archive: + artifacts: '*.log'