Repository: sentry Updated Branches: refs/heads/master 283fe7c5a -> d41696d6a
Revert SENTRY-2056: Display test-patch.py output on the standard console to see progress on Jenkins. (Kalyan Kumar kalvagadda, reviewed-by Sergio Pena) Project: http://git-wip-us.apache.org/repos/asf/sentry/repo Commit: http://git-wip-us.apache.org/repos/asf/sentry/commit/d41696d6 Tree: http://git-wip-us.apache.org/repos/asf/sentry/tree/d41696d6 Diff: http://git-wip-us.apache.org/repos/asf/sentry/diff/d41696d6 Branch: refs/heads/master Commit: d41696d6ae32dec16767d15d0d8d31b9e34f38fd Parents: 283fe7c Author: Kalyan Kumar Kalvagadda <[email protected]> Authored: Tue Jun 12 15:49:50 2018 -0500 Committer: Kalyan Kumar Kalvagadda <[email protected]> Committed: Tue Jun 12 15:49:50 2018 -0500 ---------------------------------------------------------------------- dev-support/test-patch.py | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/sentry/blob/d41696d6/dev-support/test-patch.py ---------------------------------------------------------------------- diff --git a/dev-support/test-patch.py b/dev-support/test-patch.py index 05d4936..69d8711 100644 --- a/dev-support/test-patch.py +++ b/dev-support/test-patch.py @@ -23,17 +23,10 @@ from optparse import OptionParser tmp_dir = None BASE_JIRA_URL = 'https://issues.apache.org/jira' -def execute(cmd, output_file="", log=True): - processes = list() +def execute(cmd, log=True): if log: print "INFO: Executing %s" % (cmd) - if len(output_file) > 0 : - processes.append(subprocess.Popen(cmd, shell=True)) - processes.append(subprocess.Popen('tail -f ' + output_file, shell=True)) - if processes[0].poll() is None: - return processes[0].wait() - else: - return subprocess.call(cmd, shell=True) + return subprocess.call(cmd, shell=True) def jira_request(result, url, username, password, data, headers): request = urllib2.Request(url, data, headers) @@ -127,7 +120,7 @@ def git_checkout(result, branch): def git_apply(result, cmd, patch_file, output_dir): output_file = "%s/apply.txt" % (output_dir) - rc = execute("%s %s 1>%s 2>&1" % (cmd, patch_file, output_file), output_file) + rc = execute("%s %s 1>%s 2>&1" % (cmd, patch_file, output_file)) output = "" if os.path.exists(output_file): with open(output_file) as fh: @@ -138,14 +131,12 @@ def git_apply(result, cmd, patch_file, output_dir): result.fatal("failed to apply patch (exit code %d):\n%s\n" % (rc, output)) def mvn_clean(result, mvn_repo, output_dir, mvn_profile): - output_file = output_dir+'/clean.txt' - rc = execute("mvn clean -Dmaven.repo.local=%s %s 1>%s 2>&1" % (mvn_repo, mvn_profile, output_file), output_file) + rc = execute("mvn clean -Dmaven.repo.local=%s %s 1>%s/clean.txt 2>&1" % (mvn_repo, mvn_profile, output_dir)) if rc != 0: result.fatal("failed to clean project (exit code %d)" % (rc)) def mvn_install(result, mvn_repo, output_dir, mvn_profile): - output_file = output_dir+'/install.txt' - rc = execute("mvn install -U -DskipTests -Dmaven.repo.local=%s %s 1>%s 2>&1" % (mvn_repo, mvn_profile, output_file), output_file) + rc = execute("mvn install -U -DskipTests -Dmaven.repo.local=%s %s 1>%s/install.txt 2>&1" % (mvn_repo, mvn_profile, output_dir)) if rc != 0: result.fatal("failed to build with patch (exit code %d)" % (rc)) @@ -155,8 +146,7 @@ def find_all_files(top): yield os.path.join(root, f) def mvn_test(result, mvn_repo, output_dir, mvn_profile): - output_file = output_dir+'/test.txt' - rc = execute("mvn verify --fail-at-end -Dmaven.repo.local=%s %s 1>%s 2>&1" % (mvn_repo, mvn_profile, output_file), output_file) + rc = execute("mvn verify --fail-at-end -Dmaven.repo.local=%s %s 1>%s/test.txt 2>&1" % (mvn_repo, mvn_profile, output_dir)) if rc == 0: result.success("all tests passed") else:
