Skip to content

Commit

Permalink
Merge pull request #178 from KKoukiou/shrink-journal-testing
Browse files Browse the repository at this point in the history
tests: cleanup journal before opening the report modal
  • Loading branch information
KKoukiou authored Feb 15, 2024
2 parents df3b813 + 8efe777 commit 6d95364
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
17 changes: 16 additions & 1 deletion test/check-basic
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ class TestBasic(anacondalib.VirtInstallMachineCase):
b.wait(lambda: self.file_exists(logfile))

# Reviewed log contains more than 100 lines
wait(lambda: int(m.execute(f"wc -l {logfile} | cut -d' ' -f1").strip()) > 100)
wait(lambda: int(m.execute(f"wc -l {logfile} | cut -d' ' -f1").strip()) > 1)

# Test editing of the log
user_text = "STRING_ADDED_BY_USER_TO_LOG"
Expand All @@ -188,6 +188,11 @@ class TestBasic(anacondalib.VirtInstallMachineCase):

b.click("#toggle-kebab")

# Clean up the journal before we open Report dialog
# (Report dialog presents all journal in a textarea)
# to avoid crashing the test browser
m.execute("journalctl --rotate; journalctl --vacuum-time=1s")

b.click("#about-modal-dropdown-item-report")

b.wait_visible("#user-issue-bz-report-modal.pf-v5-c-modal-box")
Expand Down Expand Up @@ -221,6 +226,11 @@ class TestBasic(anacondalib.VirtInstallMachineCase):
# FIXME: Remove PF5 specific selector: https://github.com/patternfly/patternfly-react/issues/9512
b.wait_not_present("#critical-error-bz-report-modal.pf-v5-c-modal-box")

# Clean up the journal before we open Report dialog
# (Report dialog presents all journal in a textarea)
# to avoid crashing the test browser
m.execute("journalctl --rotate; journalctl --vacuum-time=1s")

s.rescan_disks()

b.wait_visible("#critical-error-bz-report-modal.pf-v5-c-modal-box")
Expand All @@ -234,6 +244,11 @@ class TestBasic(anacondalib.VirtInstallMachineCase):

i.open()

# Clean up the journal before we open Report dialog
# (Report dialog presents all journal in a textarea)
# to avoid crashing the test browser
m.execute("journalctl --rotate; journalctl --vacuum-time=1s")

b.wait_not_present("#critical-error-bz-report-modal.pf-v5-c-modal-box")

with self.assertRaises(RuntimeError):
Expand Down
6 changes: 6 additions & 0 deletions test/check-language
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ class TestLanguage(anacondalib.VirtInstallMachineCase):
lang.select_locale("de_DE")
lang.check_selected_locale("de_DE")
i.reach(i.steps.INSTALLATION_METHOD)

# Clean up the journal before we open Report dialog
# (Report dialog presents all journal in a textarea)
# to avoid crashing the test browser
m.execute("journalctl --rotate; journalctl --vacuum-time=1s")

s.rescan_disks()

b.wait_in_text(
Expand Down

0 comments on commit 6d95364

Please sign in to comment.