Show More
@@ -3,10 +3,10 b'' | |||||
3 | """ |
|
3 | """ | |
4 | from test_pr import load_results, post_logs, post_results_comment, print_results |
|
4 | from test_pr import load_results, post_logs, post_results_comment, print_results | |
5 |
|
5 | |||
6 | num, results, pr = load_results() |
|
6 | num, results, pr, unavailable_pythons = load_results() | |
7 | results_urls = post_logs(results) |
|
7 | results_urls = post_logs(results) | |
8 | print_results(pr, results_urls) |
|
8 | print_results(pr, results_urls, unavailable_pythons) | |
9 | post_results_comment(pr, results_urls, num) |
|
9 | post_results_comment(pr, results_urls, num, unavailable_pythons) | |
10 |
|
10 | |||
11 | print() |
|
11 | print() | |
12 | print("Posted test results to pull request") |
|
12 | print("Posted test results to pull request") |
@@ -128,7 +128,7 b' def run_tests(venv):' | |||||
128 | # Restore $PATH |
|
128 | # Restore $PATH | |
129 | os.environ["PATH"] = orig_path |
|
129 | os.environ["PATH"] = orig_path | |
130 |
|
130 | |||
131 | def markdown_format(pr, results_urls): |
|
131 | def markdown_format(pr, results_urls, unavailable_pythons): | |
132 | def format_result(py, passed, gist_url, missing_libraries): |
|
132 | def format_result(py, passed, gist_url, missing_libraries): | |
133 | s = "* %s: " % py |
|
133 | s = "* %s: " % py | |
134 | if passed: |
|
134 | if passed: | |
@@ -151,11 +151,11 b' def markdown_format(pr, results_urls):' | |||||
151 | "Not available for testing: " + ", ".join(unavailable_pythons)] |
|
151 | "Not available for testing: " + ", ".join(unavailable_pythons)] | |
152 | return "\n".join(lines) |
|
152 | return "\n".join(lines) | |
153 |
|
153 | |||
154 | def post_results_comment(pr, results, num): |
|
154 | def post_results_comment(pr, results, num, unavailable_pythons=unavailable_pythons): | |
155 | body = markdown_format(pr, results) |
|
155 | body = markdown_format(pr, results, unavailable_pythons) | |
156 | gh_api.post_issue_comment(gh_project, num, body) |
|
156 | gh_api.post_issue_comment(gh_project, num, body) | |
157 |
|
157 | |||
158 | def print_results(pr, results_urls): |
|
158 | def print_results(pr, results_urls, unavailable_pythons=unavailable_pythons): | |
159 | print("\n") |
|
159 | print("\n") | |
160 | if pr['mergeable']: |
|
160 | if pr['mergeable']: | |
161 | print("**Test results for commit %s merged into master**" % pr['head']['sha'][:7]) |
|
161 | print("**Test results for commit %s merged into master**" % pr['head']['sha'][:7]) | |
@@ -174,7 +174,7 b' def print_results(pr, results_urls):' | |||||
174 |
|
174 | |||
175 | def dump_results(num, results, pr): |
|
175 | def dump_results(num, results, pr): | |
176 | with open(os.path.join(basedir, 'lastresults.pkl'), 'wb') as f: |
|
176 | with open(os.path.join(basedir, 'lastresults.pkl'), 'wb') as f: | |
177 | pickle.dump((num, results, pr), f) |
|
177 | pickle.dump((num, results, pr, unavailable_pythons), f) | |
178 |
|
178 | |||
179 | def load_results(): |
|
179 | def load_results(): | |
180 | with open(os.path.join(basedir, 'lastresults.pkl'), 'rb') as f: |
|
180 | with open(os.path.join(basedir, 'lastresults.pkl'), 'rb') as f: |
General Comments 0
You need to be logged in to leave comments.
Login now