[ci] Add jdk9 target to the dev-tools/ci script

To add support for jdk9 tests for x-pack we need a number of parameters
for the jvm, passed in the gradle command. To resolve issues with arg
passing through bash variables and improve readability, switch to an
array construct for storing the arguments.

Add new jdk9 target to allow execution of jdk-9-ea based tests in the CI
infra.

Relates: elastic/elasticsearch#4415 
Relates: https://github.com/elastic/infra/issues/1573#issuecomment-267832307

Original commit: elastic/x-pack-elasticsearch@b41e5f4b98
This commit is contained in:
Dimitrios Liappis 2016-12-19 19:53:00 +02:00 committed by GitHub
parent 79a8f27569
commit 8a3181ceed
1 changed files with 22 additions and 3 deletions

View File

@ -26,10 +26,29 @@ set -o pipefail
key=${1-check}
case $key in
packagingTest)
GRADLE_OPT_STRING="--info -Pvagrant.boxes=all :x-pack:qa:vagrant:packagingTest"
GRADLE_CLI_ARGS=(
"--info"
"-Pvagrant.boxes=all"
":x-pack:qa:vagrant:packagingTest"
)
;;
check)
GRADLE_OPT_STRING="--info check -Dtests.network=true -Dtests.badapples=true"
GRADLE_CLI_ARGS=(
"--info"
"check"
"-Dtests.network=true"
"-Dtests.badapples=true"
)
;;
jdk9)
GRADLE_CLI_ARGS=(
"-Pxpack.kibana.build=false"
"--info"
"check"
"-Dtests.network=true"
"-Dtests.badapples=true"
'-Dtests.jvm.argline="--add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/java.nio.file=ALL-UNNAMED --add-opens=java.base/java.security.cert=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/javax.net.ssl=ALL-UNNAMED"'
)
;;
*)
echo "Unsupported cli argument $1. Allowed arguments are packagingTest or check. No argument defaults to check."
@ -118,6 +137,6 @@ set -xuf
gradle --stacktrace clean
# Actually run the tests
gradle $GRADLE_OPT_STRING
gradle "${GRADLE_CLI_ARGS[@]}"
# ~*~ shell-script-mode ~*~