Skip to content

Commit

Permalink
basic selftests after changes fix
Browse files Browse the repository at this point in the history
A few basic tests related to logging has been masked because of #5817.
This is a fix for those tests to catch up with latest changes.

Signed-off-by: Jan Richter <[email protected]>
  • Loading branch information
richtja committed Dec 8, 2023
1 parent 5d68392 commit 41754c0
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions selftests/functional/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ def test_runner_timeout(self):
expected_rc,
f"Avocado did not return rc {expected_rc}:\n{result}",
)
self.assertIn("timeout", result_json["tests"][0]["fail_reason"])
self.assertIn("Timeout reached", result_json["tests"][0]["fail_reason"])
# Ensure no test aborted error messages show up
self.assertNotIn(b"TestAbortError: Test aborted unexpectedly", output)

Expand Down Expand Up @@ -552,9 +552,7 @@ def test_show_user_stream(self):
)
result = process.run(cmd_line, ignore_status=True)
self.assertEqual(result.exit_status, exit_codes.AVOCADO_ALL_OK)
self.assertIn(
b"Plant.test_plant_organic: preparing soil on row 0", result.stdout
)
self.assertIn(b"preparing soil on row 0", result.stdout)
lines = result.stdout.split(b"\n")
self.assertEqual(
len(lines), len(set(lines)), "The --show option has duplicities"
Expand Down Expand Up @@ -782,9 +780,7 @@ def test_store_logging_stream(self):
with open(progress_info, encoding="utf-8") as file:
stream_line = file.readline()
self.assertIn(
"avocado.test.progress INFO | "
"1-examples/tests/logging_streams.py:Plant.test_plant_organic: "
"preparing soil on row 0",
"logging_streams L0017 INFO | preparing soil on row 0",
stream_line,
)

Expand All @@ -804,10 +800,10 @@ def test_full_log(self):
self.assertTrue(os.path.exists(progress_info))
with open(progress_info, encoding="utf-8") as file:
stream = file.read()
self.assertIn("avocado.job", stream)
self.assertIn("avocado.core", stream)
self.assertIn("avocado.test", stream)
self.assertIn("avocado.app", stream)
self.assertIn("INFO | Avocado config:", stream)
self.assertIn("requested -> triagin", stream)
self.assertIn("preparing soil on row 0", stream)
self.assertIn("INFO | RESULTS : PASS 1 |", stream)

@unittest.skipUnless(
os.getenv("CI"),
Expand Down Expand Up @@ -890,7 +886,7 @@ def test_store_logging_stream_level(self):
with open(progress_info, encoding="utf-8") as file:
stream_line = file.readline()
self.assertIn(
"avocado.test.progress ERROR| Avocados are Gone",
"logging_streams L0037 ERROR| Avocados are Gone",
stream_line,
)
progress_info = os.path.join(
Expand All @@ -902,7 +898,7 @@ def test_store_logging_stream_level(self):
with open(progress_info, encoding="utf-8") as file:
stream_line = file.readline()
self.assertIn(
"avocado.test.progress ERROR| 1-examples/tests/logging_streams.py:Plant.test_plant_organic: Avocados are Gone",
"logging_streams L0037 ERROR| Avocados are Gone",
stream_line,
)

Expand Down

0 comments on commit 41754c0

Please sign in to comment.