From f1eac39c68de6dfe2bf09793f600803a0fab50cb Mon Sep 17 00:00:00 2001 From: rafael Date: Mon, 5 Oct 2020 09:58:49 +0200 Subject: [PATCH 1/3] use env and partition of testcase for json report --- reframe/frontend/statistics.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/reframe/frontend/statistics.py b/reframe/frontend/statistics.py index af257e158a..5a7f66ac77 100644 --- a/reframe/frontend/statistics.py +++ b/reframe/frontend/statistics.py @@ -105,15 +105,10 @@ def json(self, force=False): 'time_setup': t.duration('setup'), 'time_total': t.duration('total') } - partition = check.current_partition - environ = check.current_environ - if partition: - entry['system'] = partition.fullname - entry['scheduler'] = partition.scheduler.registered_name - - if environ: - entry['environment'] = environ.name - + partition = t.testcase.partition + entry['system'] = partition.fullname + entry['scheduler'] = partition.scheduler.registered_name + entry['environment'] = t.testcase.environ.name if check.job: entry['jobid'] = check.job.jobid entry['job_stderr'] = check.stderr.evaluate() From e95305ed3979f46badb5826f34f53b408c685f78 Mon Sep 17 00:00:00 2001 From: rafael Date: Mon, 5 Oct 2020 10:17:31 +0200 Subject: [PATCH 2/3] fix comments --- reframe/frontend/statistics.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/reframe/frontend/statistics.py b/reframe/frontend/statistics.py index 5a7f66ac77..364f98b7c3 100644 --- a/reframe/frontend/statistics.py +++ b/reframe/frontend/statistics.py @@ -106,9 +106,13 @@ def json(self, force=False): 'time_total': t.duration('total') } partition = t.testcase.partition + environ = t.testcase.environ + # We take partition and environment from the test case and not + # from the check, since if the test fails before `setup()`, + # these are not set inside the check. entry['system'] = partition.fullname entry['scheduler'] = partition.scheduler.registered_name - entry['environment'] = t.testcase.environ.name + entry['environment'] = environ.name if check.job: entry['jobid'] = check.job.jobid entry['job_stderr'] = check.stderr.evaluate() From 86f194495d92b49ca34481fbe89d56c5a4b69774 Mon Sep 17 00:00:00 2001 From: Vasileios Karakasis Date: Tue, 6 Oct 2020 16:51:08 +0200 Subject: [PATCH 3/3] Reorder some statements --- reframe/frontend/statistics.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/reframe/frontend/statistics.py b/reframe/frontend/statistics.py index 364f98b7c3..1e2a44b91b 100644 --- a/reframe/frontend/statistics.py +++ b/reframe/frontend/statistics.py @@ -105,11 +105,12 @@ def json(self, force=False): 'time_setup': t.duration('setup'), 'time_total': t.duration('total') } - partition = t.testcase.partition - environ = t.testcase.environ + # We take partition and environment from the test case and not # from the check, since if the test fails before `setup()`, # these are not set inside the check. + partition = t.testcase.partition + environ = t.testcase.environ entry['system'] = partition.fullname entry['scheduler'] = partition.scheduler.registered_name entry['environment'] = environ.name