Skip to content

Commit

Permalink
Merge pull request trinodb#22 from chancez/add_tests
Browse files Browse the repository at this point in the history
test.sh: mvn test presto-tests
  • Loading branch information
openshift-merge-robot authored Nov 5, 2019
2 parents d1ae4c2 + 9574669 commit 96df4ab
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import io.prestosql.testing.MaterializedResult;
import io.prestosql.testing.TestingAccessControlManager;
import org.intellij.lang.annotations.Language;
import org.testng.SkipException;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
Expand Down Expand Up @@ -269,4 +270,11 @@ public void testTpcdsQ6deterministic()
" FROM lineitem j\n" +
" )\n");
}

@Override
public void testLargeIn()
{
// testLargeIn is expensive
throw new SkipException("Skipping testLargeIn");
}
}
49 changes: 47 additions & 2 deletions test.sh
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

0 comments on commit 96df4ab

Please sign in to comment.