Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix broken test suite when running in small console window #18380

Conversation

adfoster-r7
Copy link
Contributor

Fixes the test suite from breaking when running the test suite from a small console window

Verification

Before

Test failures:

bundle exec rspec ./spec/lib/msf/core/auxiliary/prometheus_s
pec.rb ./spec/lib/msf/db_manager/export_spec.rb

[...]

Finished in 2.05 seconds (files took 7.66 seconds to load)
57 examples, 14 failures

After

All tests pass

Finished in 2.13 seconds (files took 7.62 seconds to load)
57 examples, 0 failures

# https://github.com/rapid7/rex-text/blob/11e59416f7d8cce18b8b8b9893b3277e6ad0bea1/lib/rex/text/wrapped_table.rb#L74
# This can cause some integration tests to fail if the tests are run from smaller consoles
# This mock will ensure that the tests run without word-wrapping.
config.before(:each) do
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could have added the console size mocking to just the tests that were currently failing, but I imagined the possibility of someone adding brittle tests again in the future - so I just went with globally mocking things to future proof things.

@sjanusz-r7 sjanusz-r7 merged commit 1ef030d into rapid7:master Sep 20, 2023
32 checks passed
@adfoster-r7 adfoster-r7 added the rn-no-release-notes no release notes label Sep 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rn-no-release-notes no release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants