From ce24500f161538d7b2fb7e510d7091a566fb5756 Mon Sep 17 00:00:00 2001 From: Matt Guthaus Date: Fri, 7 Dec 2018 14:25:03 -0800 Subject: [PATCH 1/4] Add cwd in coverage since the files must exist and another runner could be on the other paths --- .coveragerc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.coveragerc b/.coveragerc index a9eb6a64..53aa9cdf 100644 --- a/.coveragerc +++ b/.coveragerc @@ -10,6 +10,7 @@ omit = debug.py [paths] source = + . /home/gitlab-runner/builds/2fd64746/0 /home/gitlab-runner/builds/2fd64746/1 /home/gitlab-runner/builds/2fd64746/2 @@ -25,4 +26,4 @@ exclude_lines = raise NotImplementedError if 0: if __name__ == "__main__": - if not OPTS.is_unit_test \ No newline at end of file + if not OPTS.is_unit_test From 3f468b1c183f63825e01d860cf950332e2d5ad7a Mon Sep 17 00:00:00 2001 From: Matt Guthaus Date: Fri, 7 Dec 2018 15:14:28 -0800 Subject: [PATCH 2/4] Only print_time when not a unit test or debug_level set --- compiler/globals.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/compiler/globals.py b/compiler/globals.py index f6a2820b..90a209f5 100644 --- a/compiler/globals.py +++ b/compiler/globals.py @@ -395,11 +395,15 @@ def import_tech(): def print_time(name, now_time, last_time=None, indentation=2): """ Print a statement about the time delta. """ - if last_time: - time = str(round((now_time-last_time).total_seconds(),1)) + " seconds" - else: - time = now_time.strftime('%m/%d/%Y %H:%M:%S') - print("{0} {1}: {2}".format("*"*indentation,name,time)) + global OPTS + + # Don't print during testing + if not OPTS.is_unit_test or OPTS.debug_level>0: + if last_time: + time = str(round((now_time-last_time).total_seconds(),1)) + " seconds" + else: + time = now_time.strftime('%m/%d/%Y %H:%M:%S') + print("{0} {1}: {2}".format("*"*indentation,name,time)) def report_status(): From 428432dacdde9c99ea7fdd15a3672797cc87e765 Mon Sep 17 00:00:00 2001 From: Matt Guthaus Date: Fri, 7 Dec 2018 15:17:58 -0800 Subject: [PATCH 3/4] Merge coverage and change to parent parent dir --- .coveragerc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.coveragerc b/.coveragerc index 53aa9cdf..0df8ae34 100644 --- a/.coveragerc +++ b/.coveragerc @@ -10,7 +10,7 @@ omit = debug.py [paths] source = - . + ../.. /home/gitlab-runner/builds/2fd64746/0 /home/gitlab-runner/builds/2fd64746/1 /home/gitlab-runner/builds/2fd64746/2 From b15584a821932b80d8ddca857d3146f21c99dfd9 Mon Sep 17 00:00:00 2001 From: Matt Guthaus Date: Fri, 7 Dec 2018 15:50:18 -0800 Subject: [PATCH 4/4] Print start time after banner and init --- compiler/openram.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/compiler/openram.py b/compiler/openram.py index 4900e054..fa52f3a2 100755 --- a/compiler/openram.py +++ b/compiler/openram.py @@ -26,15 +26,15 @@ if len(args) != 1: # These depend on arguments, so don't load them until now. import debug -# Keep track of running stats -start_time = datetime.datetime.now() -print_time("Start",start_time) - init_openram(config_file=args[0], is_unit_test=False) # Only print banner here so it's not in unit tests print_banner() +# Keep track of running stats +start_time = datetime.datetime.now() +print_time("Start",start_time) + # Output info about this run report_status()