Repository: sqoop Updated Branches: refs/heads/sqoop2 38f2894ed -> b4ac4a8a3
SQOOP-1777: Sqoop2: Add integration tests to Pre-Commit build (Jarek Jarcec Cecho via Abraham Elmahrek) Project: http://git-wip-us.apache.org/repos/asf/sqoop/repo Commit: http://git-wip-us.apache.org/repos/asf/sqoop/commit/b4ac4a8a Tree: http://git-wip-us.apache.org/repos/asf/sqoop/tree/b4ac4a8a Diff: http://git-wip-us.apache.org/repos/asf/sqoop/diff/b4ac4a8a Branch: refs/heads/sqoop2 Commit: b4ac4a8a3d0f9df8692b76a3f8a00a4582900ea8 Parents: 38f2894 Author: Abraham Elmahrek <[email protected]> Authored: Tue Dec 2 10:02:52 2014 -0800 Committer: Abraham Elmahrek <[email protected]> Committed: Tue Dec 2 10:03:56 2014 -0800 ---------------------------------------------------------------------- dev-support/test-patch.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/sqoop/blob/b4ac4a8a/dev-support/test-patch.py ---------------------------------------------------------------------- diff --git a/dev-support/test-patch.py b/dev-support/test-patch.py index f22ef6d..a8c21b4 100755 --- a/dev-support/test-patch.py +++ b/dev-support/test-patch.py @@ -226,11 +226,17 @@ def find_all_files(top): yield os.path.join(root, f) def mvn_test(result, output_dir): - rc = execute("mvn test 1>%s/test.txt 2>&1" % output_dir) + run_mvn_test("test", "unit", result, output_dir) + +def mvn_integration(result, output_dir): + run_mvn_test("integration-test -pl test", "integration", result, output_dir) + +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)) if rc == 0: - result.success("All tests passed") + result.success("All %s tests passed" % test_type) else: - result.error("mvn test exited %d" % (rc)) + result.error("Some %s tests failed" % (test_type)) failed_tests = [] for path in list(find_all_files(".")): file_name = os.path.basename(path) @@ -242,8 +248,8 @@ def mvn_test(result, output_dir): if matcher: failed_tests += [ matcher.groups()[0] ] fd.close() - for failed_test in failed_tests: - result.error("Failed: %s" % (failed_test)) + for failed_test in set(failed_tests): + result.error("Failed %s test: {{%s}}" % (test_type, failed_test)) def clean_folder(folder): for the_file in os.listdir(folder): @@ -412,6 +418,7 @@ static_test(result, patch_file, output_dir) mvn_install(result, output_dir) if run_tests: mvn_test(result, output_dir) + mvn_integration(result, output_dir) else: result.info("patch applied and built but tests did not execute")
