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:
parent
18478d63c2
commit
d19c13d2b5
25
dev-tools/ci
25
dev-tools/ci
|
@ -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 ~*~
|
||||
|
|
Loading…
Reference in New Issue