Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support incremental maven builds in PTL #11061

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions testing/trino-product-tests-launcher/bin/run-launcher
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
#!/usr/bin/env bash

target="${BASH_SOURCE%/*/*}/target"
launcher_jar=( "${target}"/trino-product-tests-launcher-*-executable.jar )

if test "${#launcher_jar[@]}" -ne 1; then
echo "Found ${#launcher_jar[@]} launcher jars in ${target}: ${launcher_jar[*]}" >&2
echo "Run \`./mvnw clean install -pl :trino-product-tests-launcher\`" >&2
exit 3
if command -v mvnd >/dev/null; then
# Using mvnd here can save more than 2 seconds compared to ./mvnw startup cost. This is especially important
# when invoking inspection commands like --help, env list, etc.
trino_version=$(mvnd -B help:evaluate -Dexpression=pom.version -q -DforceStdout --raw-streams)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to skip this if there's only one launcher jar?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure. What if the launcher jar is outdated?

mvn="mvnd"
else
trino_version=$(./mvnw -B help:evaluate -Dexpression=pom.version -q -DforceStdout)
mvn="./mvnw"
fi
launcher_jar="${target}/trino-product-tests-launcher-${trino_version}-executable.jar"

if ! test -x "${launcher_jar[0]}"; then
# Most likely `*` glob was not expanded, file does not exist
echo "Could not find launcher jar in ${target}." >&2
echo "Run \`./mvnw clean install -pl :trino-product-tests-launcher\`" >&2
if ! test -x "${launcher_jar}"; then
echo "Could not find launcher jar ${launcher_jar}." >&2
echo "Run \`${mvn} clean install -pl :trino-product-tests-launcher -DskipTests\`" >&2
exit 3
fi

Expand Down