Run all documentation tests after PolyGerrit build
Gerrit on stable-2.16 does not have any Documentation/... tests
and therefore should be accepted also with exit code 4.
Other branches may have Documentation/... tests and therefore should
be considered valid with exit code 0.
Accept both 4 and 0 as a successful execution codes and fail the build
if Documentation/... tests exited with a different vaue.
Change-Id: I83f4aa3794965f090edef8b41c12e6da39497bdc
diff --git a/jenkins/gerrit-bazel-verifier-test.sh b/jenkins/gerrit-bazel-verifier-test.sh
index 85382ef..50e672e 100755
--- a/jenkins/gerrit-bazel-verifier-test.sh
+++ b/jenkins/gerrit-bazel-verifier-test.sh
@@ -40,8 +40,16 @@
bash ./polygerrit-ui/app/run_test.sh || touch ~/polygerrit-failed
fi
- echo 'Running license verification...'
- bazelisk test $BAZEL_OPTS //Documentation:check_licenses
+ echo 'Running Documentation tests...'
+ set +e
+ bazelisk test $BAZEL_OPTS Documentation/...
+ TEST_RES=$?
+ set -e
+ if [ ! $TEST_RES -eq 4 ] && [ ! $TEST_RES -eq 0 ]
+ then
+ echo 'Documentation tests failed'
+ exit 1
+ fi
if [ -z "$SAUCE_USERNAME" ] || [ -z "$SAUCE_ACCESS_KEY" ]
then