You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@heron.apache.org by nw...@apache.org on 2019/01/02 20:49:22 UTC

[incubator-heron] branch master updated: Update integration test runner to support language and test selection (#3139)

This is an automated email from the ASF dual-hosted git repository.

nwang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-heron.git


The following commit(s) were added to refs/heads/master by this push:
     new 1327dc1  Update integration test runner to support language and test selection (#3139)
1327dc1 is described below

commit 1327dc1618c0ec6bad532172a58e8cbedd8ff6c0
Author: Ning Wang <nw...@twitter.com>
AuthorDate: Wed Jan 2 12:49:16 2019 -0800

    Update integration test runner to support language and test selection (#3139)
---
 scripts/run_integration_test.sh | 80 +++++++++++++++++++++++++++++++++--------
 1 file changed, 65 insertions(+), 15 deletions(-)

diff --git a/scripts/run_integration_test.sh b/scripts/run_integration_test.sh
index 6fd733e..07380c7 100755
--- a/scripts/run_integration_test.sh
+++ b/scripts/run_integration_test.sh
@@ -18,6 +18,16 @@
 #
 # Script to locally run the functional integration test.
 #
+# Usage:
+#   run_integration_test.sh [language] [test pattern]
+# Examples:
+# Run all tests in all languages:
+#   run_integration_test.sh
+# Run all tests in a specific language:
+#   run_integration_test.sh java
+# Run specific tests in a specific language:
+#   run_integration_test.sh java IntegrationTest_Streamlet_.*
+
 
 HTTP_SERVER="./bazel-bin/integration_test/src/python/http_server/http-server"
 TEST_RUNNER="./bazel-bin/integration_test/src/python/test_runner/test-runner.pex"
@@ -26,6 +36,34 @@ JAVA_TESTS_DIR="integration_test/src/java/org/apache/heron/integration_test/topo
 PYTHON_TESTS_DIR="integration_test/src/python/integration_test/topology"
 SCALA_TESTS_DIR="integration_test/src/scala/org/apache/heron/integration_test/topology"
 
+# Parse arguments
+LANGUAGE="all"
+TESTS_PATTERN=".*"
+if [ "$1" != "" ]; then
+  if [ "$1" == "--help" ] || [ "$1" == "-h" ];then
+    echo "Usage:"
+    echo "  run_integration_test.sh [language] [test name pattern]"
+    echo "Exampes:"
+    echo "Run all tests in all languages:"
+    echo "  run_integration_test.sh"
+    echo "Run all tests in a specific language:"
+    echo "  run_integration_test.sh java"
+    echo "Run specific tests in a specific language:"
+    echo "  run_integration_test.sh java IntegrationTest_Streamlet_.*"
+    exit 0
+  fi
+
+  LANGUAGE=$1
+
+  # Parameter 2 is test pattern
+  if [ "$2" != "" ]; then
+    TESTS_PATTERN=$2
+  fi
+fi
+
+echo "Topology language is: " $LANGUAGE
+echo "Topology filter pattern is: " $TESTS_PATTERN
+
 # integration test binaries have to be specified as absolute path
 JAVA_INTEGRATION_TESTS_BIN="${PWD}/bazel-genfiles/integration_test/src/java/integration-tests.jar"
 PYTHON_INTEGRATION_TESTS_BIN="${PWD}/bazel-bin/integration_test/src/python/integration_test/topology/heron_integ_topology.pex"
@@ -47,22 +85,34 @@ http_server_id=$!
 trap "kill -9 $http_server_id" SIGINT SIGTERM EXIT
 
 # run the scala integration tests
-${TEST_RUNNER} \
-  -hc ~/.heron/bin/heron -tb ${SCALA_INTEGRATION_TESTS_BIN} \
-  -rh localhost -rp 8080 \
-  -tp ${SCALA_TESTS_DIR} \
-  -cl local -rl heron-staging -ev devel -pi ${CORE_PKG}
+if [ "$LANGUAGE" = "all" ] || [ "$LANGUAGE" = "scala" ]; then
+  echo "Run the Scala integration tests"
+  ${TEST_RUNNER} \
+    -hc ~/.heron/bin/heron -tb ${SCALA_INTEGRATION_TESTS_BIN} \
+    -rh localhost -rp 8080 \
+    -tp ${SCALA_TESTS_DIR} \
+    -cl local -rl heron-staging -ev devel -pi ${CORE_PKG} \
+    -ts ${TESTS_PATTERN}
+fi
 
 # run the java integration tests
-${TEST_RUNNER} \
-  -hc ~/.heron/bin/heron -tb ${JAVA_INTEGRATION_TESTS_BIN} \
-  -rh localhost -rp 8080 \
-  -tp ${JAVA_TESTS_DIR} \
-  -cl local -rl heron-staging -ev devel -pi ${CORE_PKG}
+if [ "$LANGUAGE" = "all" ] || [ "$LANGUAGE" = "java" ]; then
+echo "Run the Java integration tests"
+  ${TEST_RUNNER} \
+    -hc ~/.heron/bin/heron -tb ${JAVA_INTEGRATION_TESTS_BIN} \
+    -rh localhost -rp 8080 \
+    -tp ${JAVA_TESTS_DIR} \
+    -cl local -rl heron-staging -ev devel -pi ${CORE_PKG} \
+    -ts ${TESTS_PATTERN}
+fi
 
 # run the python integration tests
-${TEST_RUNNER} \
-  -hc ~/.heron/bin/heron -tb ${PYTHON_INTEGRATION_TESTS_BIN} \
-  -rh localhost -rp 8080 \
-  -tp ${PYTHON_TESTS_DIR} \
-  -cl local -rl heron-staging -ev devel -pi ${CORE_PKG}
+if [ "$LANGUAGE" = "all" ] || [ "$LANGUAGE" = "python" ]; then
+echo "Run the Python integration tests"
+  ${TEST_RUNNER} \
+    -hc ~/.heron/bin/heron -tb ${PYTHON_INTEGRATION_TESTS_BIN} \
+    -rh localhost -rp 8080 \
+    -tp ${PYTHON_TESTS_DIR} \
+    -cl local -rl heron-staging -ev devel -pi ${CORE_PKG} \
+    -ts ${TESTS_PATTERN}
+fi
\ No newline at end of file