Skip to content

Commit

Permalink
Don't mask the deprecation failure
Browse files Browse the repository at this point in the history
Before the failure was overwritten when the unit tests passed, now we correctly fail instead of only having an visual indicator.
  • Loading branch information
Michael Vasseur committed Nov 29, 2024
1 parent 6fbe1a8 commit c586c15
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions gitlab/unit-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,12 @@ php $phpcov webapp/bin/phpunit -c webapp/phpunit.xml.dist webapp/tests/$unittest
UNITSUCCESS=$?
set -e
CNT=0
THRESHOLD=32
if [ $CODECOVERAGE -eq 1 ]; then
CNT=$(sed -n '/Generating code coverage report/,$p' "$GITLABARTIFACTS"/phpunit.out | grep -v DoctrineTestBundle | grep -cv ^$)
FILE=deprecation.txt
sed -n '/Generating code coverage report/,$p' "$GITLABARTIFACTS"/phpunit.out > ${CI_PROJECT_DIR}/$FILE
if [ $CNT -le 32 ]; then
if [ $CNT -le $THRESHOLD ]; then
STATE=success
else
STATE=failure
Expand All @@ -66,7 +67,7 @@ curl https://api.github.com/repos/domjudge/domjudge/statuses/$CI_COMMIT_SHA \
-H "Authorization: token $GH_BOT_TOKEN_OBSCURED" \
-H "Accept: application/vnd.github.v3+json" \
-d "{\"state\": \"$STATE\", \"target_url\": \"${CI_PIPELINE_URL}/test_report\", \"description\":\"Unit tests\", \"context\": \"unit_tests ($version)\"}"
if [ $UNITSUCCESS -ne 0 ]; then
if [ $UNITSUCCESS -ne 0 ] || [ $CNT -le $THRESHOLD ]; then
exit 1
fi

Expand Down

0 comments on commit c586c15

Please sign in to comment.