Skip to content

Commit

Permalink
Adapt test to new output
Browse files Browse the repository at this point in the history
  • Loading branch information
Flamefire committed Oct 25, 2023
1 parent 0915a99 commit 96c7a04
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions test/framework/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -705,8 +705,9 @@ def test_check_log_for_errors(self):
"enabling -Werror",
"the process crashed with 0"
])
expected_msg = r"Found 2 error\(s\) in command output "\
r"\(output: error found\n\tthe process crashed with 0\)"
expected_msg = r"Found 2 error\(s\) in command output:\n"\
r"\terror found\n"\
r"\tthe process crashed with 0"

# String promoted to list
self.assertErrorRegex(EasyBuildError, expected_msg, check_log_for_errors, input_text,
Expand All @@ -718,14 +719,17 @@ def test_check_log_for_errors(self):
self.assertErrorRegex(EasyBuildError, expected_msg, check_log_for_errors, input_text,
[(r"\b(error|crashed)\b", ERROR)])

expected_msg = "Found 2 potential error(s) in command output " \
"(output: error found\n\tthe process crashed with 0)"
expected_msg = "Found 2 potential error(s) in command output:\n"\
"\terror found\n"\
"\tthe process crashed with 0"
init_logging(logfile, silent=True)
check_log_for_errors(input_text, [(r"\b(error|crashed)\b", WARN)])
stop_logging(logfile)
self.assertIn(expected_msg, read_file(logfile))

expected_msg = r"Found 2 error\(s\) in command output \(output: error found\n\ttest failed\)"
expected_msg = r"Found 2 error\(s\) in command output:\n"\
r"\terror found\n"\
r"\ttest failed"
write_file(logfile, '')
init_logging(logfile, silent=True)
self.assertErrorRegex(EasyBuildError, expected_msg, check_log_for_errors, input_text, [
Expand All @@ -735,7 +739,7 @@ def test_check_log_for_errors(self):
"fail"
])
stop_logging(logfile)
expected_msg = "Found 1 potential error(s) in command output (output: the process crashed with 0)"
expected_msg = "Found 1 potential error(s) in command output:\n\tthe process crashed with 0"
self.assertIn(expected_msg, read_file(logfile))

def test_run_cmd_with_hooks(self):
Expand Down

0 comments on commit 96c7a04

Please sign in to comment.