Skip to content

Commit 0cfd85c

Browse files
committed
common.sh(print_status): modify behavior of reporting about failures.
No functional changes.
1 parent 5cb7ea4 commit 0cfd85c

File tree

2 files changed

+19
-16
lines changed

2 files changed

+19
-16
lines changed

src/main/scripts/ci/check-build-and-verify.sh

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -35,28 +35,28 @@ DANGER_FAIL=
3535
if [ "$RUN_ONLY_INTEGRATION_TESTS" = 'no' ]; then
3636

3737
mvn --batch-mode checkstyle:check -Dcheckstyle.violationSeverity=warning \
38-
>cs.log 2>&1 || CS_FAIL=yes
38+
>cs.log 2>&1 || CS_FAIL=fail
3939

4040
mvn --batch-mode pmd:check \
41-
>pmd.log 2>&1 || PMD_FAIL=yes
41+
>pmd.log 2>&1 || PMD_FAIL=fail
4242

4343
mvn --batch-mode codenarc:codenarc -Dcodenarc.maxPriority1Violations=0 -Dcodenarc.maxPriority2Violations=0 -Dcodenarc.maxPriority3Violations=0 \
44-
>codenarc.log 2>&1 || CODENARC_FAIL=yes
44+
>codenarc.log 2>&1 || CODENARC_FAIL=fail
4545

4646
mvn --batch-mode license:check \
47-
>license.log 2>&1 || LICENSE_FAIL=yes
47+
>license.log 2>&1 || LICENSE_FAIL=fail
4848

4949
mvn --batch-mode sortpom:verify -Dsort.verifyFail=stop \
50-
>pom.log || POM_FAIL=yes
50+
>pom.log || POM_FAIL=fail
5151

5252
find src -type f -name '*.html' | xargs bootlint \
53-
>bootlint.log 2>&1 || BOOTLINT_FAIL=yes
53+
>bootlint.log 2>&1 || BOOTLINT_FAIL=fail
5454

5555
rflint --error=all --ignore TooFewKeywordSteps --ignore TooManyTestSteps --configure LineTooLong:130 src/test/robotframework \
56-
>rflint.log 2>&1 || RFLINT_FAIL=yes
56+
>rflint.log 2>&1 || RFLINT_FAIL=fail
5757

5858
mvn --batch-mode jasmine:test \
59-
>jasmine.log 2>&1 || JASMINE_FAIL=yes
59+
>jasmine.log 2>&1 || JASMINE_FAIL=fail
6060

6161
# FIXME: add check for src/main/config/nginx/503.*html
6262
# TODO: remove ignoring of error about alt attribute after resolving #314
@@ -70,24 +70,24 @@ if [ "$RUN_ONLY_INTEGRATION_TESTS" = 'no' ]; then
7070
'The first child "option" element of a "select" element with a "required" attribute' \
7171
'This document appears to be written in (Danish|Lithuanian)' \
7272
--show-warnings \
73-
>validator.log 2>&1 || HTML_FAIL=yes
73+
>validator.log 2>&1 || HTML_FAIL=fail
7474

7575
mvn --batch-mode enforcer:enforce \
76-
>enforcer.log 2>&1 || ENFORCER_FAIL=yes
76+
>enforcer.log 2>&1 || ENFORCER_FAIL=fail
7777

7878
mvn --batch-mode test -Denforcer.skip=true -Dmaven.resources.skip=true -DskipMinify=true -DdisableXmlReport=false \
79-
>test.log 2>&1 || TEST_FAIL=yes
79+
>test.log 2>&1 || TEST_FAIL=fail
8080

8181
# run after tests for getting compiled sources
8282
mvn --batch-mode findbugs:check \
83-
>findbugs.log 2>&1 || FINDBUGS_FAIL=yes
83+
>findbugs.log 2>&1 || FINDBUGS_FAIL=fail
8484
fi
8585

8686
mvn --batch-mode verify -Denforcer.skip=true -DskipUnitTests=true \
87-
>verify-raw.log 2>&1 || VERIFY_FAIL=yes
87+
>verify-raw.log 2>&1 || VERIFY_FAIL=fail
8888

8989
if [ "${SPRING_PROFILES_ACTIVE:-}" = 'travis' -a "${TRAVIS_PULL_REQUEST:-}" != 'false' ]; then
90-
danger >danger.log 2>&1 || DANGER_FAIL=yes
90+
danger >danger.log 2>&1 || DANGER_FAIL=fail
9191
fi
9292

9393
# Workaround for #538

src/main/scripts/ci/common.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
print_status() {
2-
local we_failed="$1"
2+
# $1 is empty if check has succeeded
3+
# $1 equals to 'fail' if check has failed
4+
local result="$1"
35
local msg="$2"
6+
47
local status='SUCCESS'
58
local color=32
69

7-
if [ -n "$we_failed" ]; then
10+
if [ "$result" = 'fail' ]; then
811
status='FAIL'
912
color=31
1013
fi

0 commit comments

Comments
 (0)