forked from trinodb/trino
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request trinodb#22 from chancez/add_tests
test.sh: mvn test presto-tests
- Loading branch information
Showing
2 changed files
with
55 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,50 @@ | ||
#!/bin/bash | ||
set -x | ||
set -e | ||
|
||
# TODO: real tests | ||
./mvnw -v | ||
ARTIFACT_DIR="${ARTIFACT_DIR:-}" | ||
|
||
TEST_SPECIFIC_MODULES=${TEST_SPECIFIC_MODULES:-presto-tests} | ||
JVM_HEAPSIZE="${JVM_HEAPSIZE:-4096M}" | ||
|
||
export MAVEN_OPTS="-Xmx$JVM_HEAPSIZE -XX:+ExitOnOutOfMemoryError" | ||
MAVEN_SKIP_CHECKS_AND_DOCS="-Dair.check.skip-all=true -Dmaven.javadoc.skip=true" | ||
MAVEN_FAST_INSTALL="-DskipTests $MAVEN_SKIP_CHECKS_AND_DOCS -B -q -T C1" | ||
|
||
function cleanup() { | ||
exit_status=$? | ||
# copy artifacts to $ARTIFACT_DIR if specified | ||
# --no-perms/--no-group to handle running as unprivileged in prow | ||
if [ -n "$ARTIFACT_DIR" ]; then | ||
mkdir -p "$ARTIFACT_DIR" | ||
rsync -v -rl -m \ | ||
--include='**/' \ | ||
--include='**/surefire-reports/**.xml' \ | ||
--include='**/surefire-reports/emailable-report.html' \ | ||
--include='**/product-tests-presto-jvm-error-file.log' \ | ||
--include='**/test-reports/junitreports/**.xml' \ | ||
--include='**/test-reports/emailable-report.html' \ | ||
--exclude='*' \ | ||
. "$ARTIFACT_DIR/" | ||
fi | ||
exit "$exit_status" | ||
} | ||
|
||
function run_tests() { | ||
./mvnw -v | ||
./mvnw clean -B | ||
./mvnw install $MAVEN_FAST_INSTALL -B -pl "${TEST_SPECIFIC_MODULES}" -am | ||
./mvnw test $MAVEN_SKIP_CHECKS_AND_DOCS -B -pl "${TEST_SPECIFIC_MODULES}" -Dtest="!io.prestosql.execution.sessionpropertymanagers.TestDbSessionPropertyManagerIntegration" | ||
} | ||
|
||
function main() { | ||
if [ -n "$ARTIFACT_DIR" ]; then | ||
mkdir -p "$ARTIFACT_DIR" | ||
run_tests | tee "$ARTIFACT_DIR/maven-logs.txt" | ||
else | ||
run_tests | ||
fi | ||
} | ||
|
||
trap cleanup EXIT | ||
main |