Skip to content

Commit c586c15

Browse files
author
Michael Vasseur
committed
Don't mask the deprecation failure
Before the failure was overwritten when the unit tests passed, now we correctly fail instead of only having an visual indicator.
1 parent 6fbe1a8 commit c586c15

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

gitlab/unit-tests.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,12 @@ php $phpcov webapp/bin/phpunit -c webapp/phpunit.xml.dist webapp/tests/$unittest
3636
UNITSUCCESS=$?
3737
set -e
3838
CNT=0
39+
THRESHOLD=32
3940
if [ $CODECOVERAGE -eq 1 ]; then
4041
CNT=$(sed -n '/Generating code coverage report/,$p' "$GITLABARTIFACTS"/phpunit.out | grep -v DoctrineTestBundle | grep -cv ^$)
4142
FILE=deprecation.txt
4243
sed -n '/Generating code coverage report/,$p' "$GITLABARTIFACTS"/phpunit.out > ${CI_PROJECT_DIR}/$FILE
43-
if [ $CNT -le 32 ]; then
44+
if [ $CNT -le $THRESHOLD ]; then
4445
STATE=success
4546
else
4647
STATE=failure
@@ -66,7 +67,7 @@ curl https://api.github.com/repos/domjudge/domjudge/statuses/$CI_COMMIT_SHA \
6667
-H "Authorization: token $GH_BOT_TOKEN_OBSCURED" \
6768
-H "Accept: application/vnd.github.v3+json" \
6869
-d "{\"state\": \"$STATE\", \"target_url\": \"${CI_PIPELINE_URL}/test_report\", \"description\":\"Unit tests\", \"context\": \"unit_tests ($version)\"}"
69-
if [ $UNITSUCCESS -ne 0 ]; then
70+
if [ $UNITSUCCESS -ne 0 ] || [ $CNT -le $THRESHOLD ]; then
7071
exit 1
7172
fi
7273

0 commit comments

Comments
 (0)