diff --git a/pipelines/build.sh b/pipelines/build.sh index 296c1f898b5eca1d47c42b38f7f43f139b664d63..7504ed49329960c725c6479004192762a3da1f06 100644 --- a/pipelines/build.sh +++ b/pipelines/build.sh @@ -26,6 +26,7 @@ if [ "$JOB_NAME" != "csst_proto" ]; then curl -O https://csst-tb.bao.ac.cn/code/csst-l1/csst_proto/-/raw/main/pipelines/test_codestyle.py fi coverage run -m pytest +unittest_status=$? echo "===================== make coverage =====================" coverage report @@ -36,6 +37,14 @@ echo "===================== importability =====================" python -c "from $JOB_NAME.top_level_interface import *" echo "===================== POST BUILD BELOW =====================" + +# the exit value is determined from unit tests +if [ "$unittest_status" != 0 ]; then + exit $unittest_status +else + exit 0 +fi + # In Jenkins: #!/bin/bash #sh -c "$(curl -fsSL https://csst-tb.bao.ac.cn/code/csst-l1/csst_proto/-/raw/main/pipelines/build.sh)" \ No newline at end of file