Allow defining gradle test params via cli argument

For Elasticsearch x-plugin packaging tests we need a different gradle
command.

This commit introduces an optional cli argument (-g|--gradleoptstring)
that can be used to set the gradle parameters to execute tests.

Relates https://github.com/elastic/infra/issues/1518

Original commit: elastic/x-pack-elasticsearch@3a32e323ae
This commit is contained in:
Dimitrios Liappis 2016-11-21 16:36:55 +02:00
parent 18478d63c2
commit d19c13d2b5
1 changed files with 24 additions and 1 deletions

View File

@ -11,6 +11,29 @@
# `NVM_DIR` environment variable.
#
# Set the default gradle parameters for running tests
gradleoptstring="--info check -Dtests.network=true -Dtests.badapples=true"
while [ $# -ge 1 ]
do
key="$1"
case $key in
-g|--gradleoptstring)
gradleoptstring="$2"
shift 2;;
-h|--help)
echo -e "Syntax:\n"
echo -e "$0 [-g|--gradleoptstring] \"override gradle parameters for tests\"\n"
exit 0;;
-*)
echo "Unknown argument: $key";
exit 1;;
*)
# Unknown option
;;
esac
done
# Turn on semi-strict mode
set -e pipefail
@ -89,6 +112,6 @@ set -xuf
gradle --stacktrace clean
# Actually run the tests
gradle --info check -Dtests.network=true -Dtests.badapples=true
gradle $gradleoptstring
# ~*~ shell-script-mode ~*~