Changeset View
Changeset View
Standalone View
Standalone View
jobs/swh-environment.yaml
Show First 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | builders: | ||||
exit_code=0 | exit_code=0 | ||||
for module in $(./bin/ls-py-modules) | for module in $(./bin/ls-py-modules) | ||||
do | do | ||||
cd $module | cd $module | ||||
tests_dir=$(echo $module | sed 's/-/\//g')/tests | tests_dir=$(echo $module | sed 's/-/\//g')/tests | ||||
if [ -d "$tests_dir" ] | if [ -d "$tests_dir" ] | ||||
then | then | ||||
# pipe tests output to stdout and log file | # pipe tests output to stdout and log file | ||||
python3 -m pytest $tests_dir 2>&1 | tee ../$module.log | make test 2>&1 | tee ../$module.log | ||||
tests_status=${PIPESTATUS[0]} | tests_status=${PIPESTATUS[0]} | ||||
# remove log file if tests succeeded | # remove log file if tests succeeded | ||||
if [[ "$tests_status" == "0" ]] | if [[ "$tests_status" == "0" ]] | ||||
then | then | ||||
rm -f ../$module.log | rm -f ../$module.log | ||||
fi | fi | ||||
# script must be exited with error when a test suite failed | # script must be exited with error when a test suite failed | ||||
exit_code=$(( tests_status > exit_code ? tests_status : exit_code )) | exit_code=$(( tests_status > exit_code ? tests_status : exit_code )) | ||||
fi | fi | ||||
cd .. | cd .. | ||||
done | done | ||||
exit $exit_code | exit $exit_code | ||||
publishers: | publishers: | ||||
- archive: | - archive: | ||||
artifacts: '*.log' | artifacts: "*.log" | ||||
allow-empty: true | allow-empty: true |