From e6fc9663f5cc8b2fc013decc45fcb10fa92d5c8e Mon Sep 17 00:00:00 2001 From: Hynek Mlnarik Date: Tue, 6 Aug 2019 09:02:44 +0200 Subject: [PATCH] KEYCLOAK-11004 Run authz tests conditionally --- .travis.yml | 1 + travis-run-tests.sh | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3f78e41cac..bb1f72e27c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,6 +14,7 @@ env: - TESTS=server-group3 - TESTS=server-group4 - TESTS=adapter-tests + - TESTS=adapter-tests-authz - TESTS=crossdc-server - TESTS=crossdc-adapter - TESTS=broker diff --git a/travis-run-tests.sh b/travis-run-tests.sh index da6dfb2a16..f2b1292460 100755 --- a/travis-run-tests.sh +++ b/travis-run-tests.sh @@ -5,7 +5,7 @@ function run-server-tests() { mvn install -B -nsu -Pauth-server-wildfly -DskipTests cd tests/base - mvn test -B -nsu -Pauth-server-wildfly -Dtest=$1 $2 2>&1 | java -cp ../../../utils/target/classes org.keycloak.testsuite.LogTrimmer + mvn test -B -nsu -Pauth-server-wildfly "-Dtest=$1" $2 2>&1 | java -cp ../../../utils/target/classes org.keycloak.testsuite.LogTrimmer exit ${PIPESTATUS[0]} } @@ -39,6 +39,13 @@ function should-tests-run-crossdc-adapter() { should-tests-run-crossdc-server } +function should-tests-run-adapter-tests-authz() { + [ "$TRAVIS_PULL_REQUEST" = "false" ] && return 0 + + git diff --name-only HEAD origin/${TRAVIS_BRANCH} | + egrep -i 'authz|authorization' +} + if ! should-tests-run; then echo "Skipping all tests (including group '$1')" exit 0 @@ -84,7 +91,11 @@ if [ $1 == "server-group4" ]; then fi if [ $1 == "adapter-tests" ]; then - run-server-tests org.keycloak.testsuite.adapter.**.*Test + run-server-tests org.keycloak.testsuite.adapter.**.*Test,!org.keycloak.testsuite.adapter.**.authorization**.*Test +fi + +if [ $1 == "adapter-tests-authz" ]; then + run-server-tests org.keycloak.testsuite.adapter.**.authorization**.*Test fi if [ $1 == "crossdc-server" ]; then