From 50640d49243ab172f767789f03e3a8fac0b29fd7 Mon Sep 17 00:00:00 2001 From: Gregory Becker Date: Thu, 23 Apr 2020 14:05:55 -0700 Subject: [PATCH] update from Error to FAILED --- lib/spack/external/ctest_log_parser.py | 2 ++ lib/spack/spack/package.py | 4 ++-- lib/spack/spack/test/cmd/test.py | 11 +++++------ 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/lib/spack/external/ctest_log_parser.py b/lib/spack/external/ctest_log_parser.py index 0437b6e524b..b53d5a9148c 100644 --- a/lib/spack/external/ctest_log_parser.py +++ b/lib/spack/external/ctest_log_parser.py @@ -118,6 +118,8 @@ def match(self, text): "([^:]+): (Error:|error|undefined reference|multiply defined)", "([^ :]+) ?: (error|fatal error|catastrophic error)", "([^:]+)\\(([^\\)]+)\\) ?: (error|fatal error|catastrophic error)"), + "^FAILED", + "^==> \[\d\d\d\d-\d\d-\d\d-\d\d:\d\d:\d\d\.\d+, \d+\]\s*FAILED", "^[Bb]us [Ee]rror", "^[Ss]egmentation [Vv]iolation", "^[Ss]egmentation [Ff]ault", diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py index 2e2f0b5cad0..06eccad8b70 100644 --- a/lib/spack/spack/package.py +++ b/lib/spack/spack/package.py @@ -1685,12 +1685,12 @@ def run_test(self, exe, options=[], expected=[], status=None, try: self._run_test_helper( exe, options, expected, status, installed, purpose) - tty.msg("PASSED") + print("PASSED") except BaseException as e: # print a summary of the error to the log file # so that cdash and junit reporters know about it exc_type, _, tb = sys.exc_info() - print('Error: %s' % e) + print('FAILED: %s' % e) import traceback # remove the current call frame to get back to stack = traceback.extract_stack()[:-1] diff --git a/lib/spack/spack/test/cmd/test.py b/lib/spack/spack/test/cmd/test.py index 14ced337eb1..588452b8d60 100644 --- a/lib/spack/spack/test/cmd/test.py +++ b/lib/spack/spack/test/cmd/test.py @@ -69,7 +69,7 @@ def test_test_output(install_mockery, mock_archive, mock_fetch, assert "BEFORE TEST" in output assert "true: expect command status in [" in output assert "AFTER TEST" in output - assert "rror" not in output # no error + assert "FAILED" not in output def test_test_output_on_error(mock_packages, mock_archive, mock_fetch, @@ -80,7 +80,7 @@ def test_test_output_on_error(mock_packages, mock_archive, mock_fetch, out = spack_test('run', 'test-error', fail_on_error=False) assert "TestFailure" in out - assert "Error: Command exited with status 1" in out + assert "FAILED: Command exited with status 1" in out def test_test_output_on_failure(mock_packages, mock_archive, mock_fetch, @@ -90,7 +90,6 @@ def test_test_output_on_failure(mock_packages, mock_archive, mock_fetch, out = spack_test('run', 'test-fail', fail_on_error=False) assert "Expected 'not in the output' in output of `true`" in out - assert "Error:" in out assert "TestFailure" in out @@ -109,8 +108,8 @@ def test_show_log_on_error(mock_packages, mock_archive, mock_fetch, 'mock_packages', 'mock_archive', 'mock_fetch', 'install_mockery' ) @pytest.mark.parametrize('pkg_name,msgs', [ - ('test-error', ['Error: Command exited', 'TestFailure']), - ('test-fail', ['Error: Expected', 'TestFailure']) + ('test-error', ['FAILED: Command exited', 'TestFailure']), + ('test-fail', ['FAILED: Expected', 'TestFailure']) ]) def test_junit_output_with_failures(tmpdir, mock_test_stage, pkg_name, msgs): install(pkg_name) @@ -151,7 +150,7 @@ def test_cdash_output_test_error( report_file = report_dir.join('test-error_Test.xml') assert report_file in report_dir.listdir() content = report_file.open().read() - assert 'Error: Command exited with status 1' in content + assert 'FAILED: Command exited with status 1' in content def test_cdash_upload_clean_test(