From 21a44fc15bf4c31e1e54388f79b6eb76c10bb4d2 Mon Sep 17 00:00:00 2001 From: Jarek Jarcec Cecho Date: Fri, 23 Jan 2015 12:25:10 -0800 Subject: [PATCH] SQOOP-1991: Sqoop2: Define slow category in integration tests (Abraham Elmahrek via Jarek Jarcec Cecho) --- dev-support/test-patch.py | 28 +++++++++++++++++++--------- pom.xml | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 9 deletions(-) diff --git a/dev-support/test-patch.py b/dev-support/test-patch.py index 6b0218b3..5d615767 100755 --- a/dev-support/test-patch.py +++ b/dev-support/test-patch.py @@ -255,18 +255,26 @@ def find_all_files(top): for f in files: yield os.path.join(root, f) -def mvn_test(result, output_dir): - run_mvn_test("test", "unit", result, output_dir) +def mvn_test(result, output_dir, slow): + run_mvn_test("test", "unit", result, output_dir, slow) -def mvn_integration(result, output_dir): - run_mvn_test("integration-test -pl test", "integration", result, output_dir) +def mvn_integration(result, output_dir, slow): + run_mvn_test("integration-test -pl test", "integration", result, output_dir, slow) -def run_mvn_test(command, test_type, result, output_dir): - rc = execute("mvn %s 1>%s/test_%s.txt 2>&1" % (command, output_dir, test_type)) +def run_mvn_test(command, test_type, result, output_dir, slow): + if slow: + command += " -Pslow,hadoop200" + test_file_name = "%s_slow" % test_type + test_type = "slow %s" % test_type + else: + test_file_name = "%s_fast" % test_type + test_type = "fast %s" % test_type + + rc = execute("mvn %s 1>%s/test_%s.txt 2>&1" % (command, output_dir, test_file_name)) if rc == 0: result.success("All %s tests passed" % test_type) else: - result.error("Some %s tests failed (%s)" % (test_type, jenkins_file_link_for_jira("report", "test_%s.txt" % test_type))) + result.error("Some %s tests failed (%s)" % (test_type, jenkins_file_link_for_jira("report", "test_%s.txt" % test_file_name))) failed_tests = [] for path in list(find_all_files(".")): file_name = os.path.basename(path) @@ -449,8 +457,10 @@ def post_jira_comment_and_exit(): mvn_rat(result, output_dir) mvn_install(result, output_dir) if run_tests: - mvn_test(result, output_dir) - mvn_integration(result, output_dir) + mvn_test(result, output_dir, slow=False) + mvn_test(result, output_dir, slow=True) + mvn_integration(result, output_dir, slow=False) + mvn_integration(result, output_dir, slow=True) else: result.info("patch applied and built but tests did not execute") diff --git a/pom.xml b/pom.xml index 66451e78..829255c4 100644 --- a/pom.xml +++ b/pom.xml @@ -138,6 +138,10 @@ limitations under the License. fast + + true + + @@ -147,6 +151,14 @@ limitations under the License. slow + + + org.apache.maven.plugins + maven-failsafe-plugin + + slow + + @@ -154,6 +166,12 @@ limitations under the License. slow + + + slow + + + @@ -163,6 +181,14 @@ limitations under the License. slow + + + org.apache.maven.plugins + maven-failsafe-plugin + + slow + + @@ -687,6 +713,12 @@ limitations under the License. + + + org.apache.maven.plugins + maven-failsafe-plugin + 2.18.1 +