From d798ac57a7550bd63279809c3f52184152a2be27 Mon Sep 17 00:00:00 2001 From: Karol Latecki Date: Mon, 26 Mar 2018 10:32:16 +0200 Subject: [PATCH] autorun_post: save aggregated test completion list to file First save the list of run / not run tests to file for easier re-use later and then print to screen. Change-Id: I1cb4ea057a75f08cac43853299f509d03b299709 Signed-off-by: Karol Latecki Reviewed-on: https://review.gerrithub.io/405222 Tested-by: SPDK Automated Test System Reviewed-by: Daniel Verkamp Reviewed-by: Jim Harris --- autorun_post.py | 41 +++++++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/autorun_post.py b/autorun_post.py index ba23d70d9..98eaf8a18 100755 --- a/autorun_post.py +++ b/autorun_post.py @@ -78,6 +78,7 @@ def aggregateCompletedTests(output_dir, repo_dir): completionFilePath = os.path.join(output_dir, '**', 'test_completions.txt') testFiles = glob.glob(testFilePath, recursive=True) completionFiles = glob.glob(completionFilePath, recursive=True) + testSummary = os.path.join(output_dir, "test_execution.log") if len(testFiles) == 0: print("Unable to perform test completion aggregator. No input files.") @@ -108,27 +109,31 @@ def aggregateCompletedTests(output_dir, repo_dir): except KeyError: continue - print("\n\n-----Tests Executed in Build------") - for item in sorted(test_list): - if test_list[item][0]: - print(item) + with open(testSummary, 'w') as fh: + fh.write("\n\n-----Tests Executed in Build------\n") + for item in sorted(test_list): + if test_list[item][0]: + fh.write(item + "\n") - print("\n\n-----Tests Missing From Build------") - if not test_unit_with_valgrind: - print("UNITTEST_WITH_VALGRIND\n") - for item in sorted(test_list): - if test_list[item][0] is False: - print(item) + fh.write("\n\n-----Tests Missing From Build------\n") + if not test_unit_with_valgrind: + fh.write("UNITTEST_WITH_VALGRIND\n") + for item in sorted(test_list): + if test_list[item][0] is False: + fh.write(item + "\n") - print("\n\n-----Tests Missing ASAN------") - for item in sorted(test_list): - if test_list[item][1] is False: - print(item) + fh.write("\n\n-----Tests Missing ASAN------\n") + for item in sorted(test_list): + if test_list[item][1] is False: + fh.write(item + "\n") - print("\n\n-----Tests Missing UBSAN------") - for item in sorted(test_list): - if test_list[item][2] is False: - print(item) + fh.write("\n\n-----Tests Missing UBSAN------\n") + for item in sorted(test_list): + if test_list[item][2] is False: + fh.write(item + "\n") + + with open(testSummary, 'r') as fh: + print(fh.read()) def main(output_dir, repo_dir):