Updated Branches: refs/heads/sqoop2 f343133db -> 894d21ded
SQOOP-1110. Sqoop2: Precommit: Add routine to detect if patch touch test (Jarek Jarcec Cecho via Hari Shreedharan) Project: http://git-wip-us.apache.org/repos/asf/sqoop/repo Commit: http://git-wip-us.apache.org/repos/asf/sqoop/commit/894d21de Tree: http://git-wip-us.apache.org/repos/asf/sqoop/tree/894d21de Diff: http://git-wip-us.apache.org/repos/asf/sqoop/diff/894d21de Branch: refs/heads/sqoop2 Commit: 894d21ded2ac86dda08d33966eba7ef839451637 Parents: f343133 Author: Hari Shreedharan <[email protected]> Authored: Fri Aug 30 21:47:33 2013 -0700 Committer: Hari Shreedharan <[email protected]> Committed: Fri Aug 30 21:47:33 2013 -0700 ---------------------------------------------------------------------- dev-support/test-patch.py | 9 +++++++++ 1 file changed, 9 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/sqoop/blob/894d21de/dev-support/test-patch.py ---------------------------------------------------------------------- diff --git a/dev-support/test-patch.py b/dev-support/test-patch.py index b826450..0196cfa 100755 --- a/dev-support/test-patch.py +++ b/dev-support/test-patch.py @@ -189,6 +189,14 @@ def git_apply(result, cmd, patch_file, strip, output_dir): else: result.fatal("failed to apply patch (exit code %d):\n{code}%s{code}\n" % (rc, output)) +def static_test(result, patch_file, output_dir): + output_file = "%s/static-test.txt" % (output_dir) + rc = execute("grep '^+++.*/test' %s 1>%s 2>&1" % (patch_file, output_file)) + if rc == 0: + result.success("Patch add/modify test case") + else: + result.error("Patch does not add/modifny any test case") + def mvn_clean(result, output_dir): rc = execute("mvn clean 1>%s/clean.txt 2>&1" % output_dir) if rc == 0: @@ -391,6 +399,7 @@ if not sqoop_verify_branch(branch): mvn_clean(result, output_dir) git_checkout(result, branch) git_apply(result, patch_cmd, patch_file, strip, output_dir) +static_test(result, patch_file, output_dir) mvn_install(result, output_dir) if run_tests: mvn_test(result, output_dir)
