diff --git a/reframe/core/pipeline.py b/reframe/core/pipeline.py index 298ee257b8..6e1faa9c8e 100644 --- a/reframe/core/pipeline.py +++ b/reframe/core/pipeline.py @@ -1134,19 +1134,19 @@ def check_performance(self): "tag `%s' not resolved in references for `%s'" % (tag, self._current_partition.fullname)) - self._perfvalues[key] = (tag, value, *self.reference[key]) + self._perfvalues[key] = (value, *self.reference[key]) self._perf_logger.log_performance(logging.INFO, tag, value, *self.reference[key]) - for values in self._perfvalues.values(): - tag, val, ref, low_thres, high_thres, *_ = values + for key, values in self._perfvalues.items(): + val, ref, low_thres, high_thres, *_ = values + tag = key.split(':')[-1] try: evaluate( assert_reference( val, ref, low_thres, high_thres, msg=('failed to meet reference: %s={0}, ' - 'expected {1} (l={2}, u={3})' % tag), - ) + 'expected {1} (l={2}, u={3})' % tag)) ) except SanityError as e: raise PerformanceError(e) diff --git a/unittests/test_cli.py b/unittests/test_cli.py index c89e89acfc..69ffb3c3f1 100644 --- a/unittests/test_cli.py +++ b/unittests/test_cli.py @@ -221,6 +221,15 @@ def test_performance_check_failure(self): ['login'], self.environs)) self.assertTrue(self._perflog_exists('PerformanceFailureCheck')) + def test_performance_report(self): + self.checkpath = ['unittests/resources/checks/frontend_checks.py'] + self.more_options = ['-t', 'PerformanceFailureCheck', + '--performance-report'] + returncode, stdout, stderr = self._run_reframe() + + self.assertIn(r'PERFORMANCE REPORT', stdout) + self.assertIn(r'perf: 10 Gflop/s', stdout) + def test_skip_system_check_option(self): self.checkpath = ['unittests/resources/checks/frontend_checks.py'] self.more_options = ['--skip-system-check', '-t', 'NoSystemCheck']