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

Remove assert matching stderr output in test_sni. #158

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jackorp
Copy link

@jackorp jackorp commented Nov 21, 2024

test_sni should be testing SNI use, it doesn't need to
check for specific stderr output which isn't shown by default.

The test test_sni in test_https.rb file checks stderr output for
information about primes being generated.
Since commit jackorp@6cb9bf6 the output is only
written if $VERBOSE is true. This happens when --verbose is provided
to the Ruby run arguments, or when the tests are ran via rake.

$stderr is still caught, but discarded to not pollute test run output.


Ran into this in Fedora when updating the gem. Since we do not use rake to cut down on dependencies in package buildroot, $VERBOSE isn't set, I assume rake at some point sets the variable to true. However, I believe that if there is an assert relying on a specific value of $VERBOSE it should be set for the duration it is needed in the test itself.

Copy link
Contributor

@jeremyevans jeremyevans left a comment

Choose a reason for hiding this comment

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

I think it would be better to remove this line instead:

assert_match(/\A([.+*]+\n)+\z/, stderr_buffer.string)

test_sni should be testing SNI use (and it does), it doesn't need to check for specific stderr output which isn't shown by default.

@jackorp jackorp changed the title Set VERBOSE to true in test_sni. Remove assert matching stderr output in test_sni. Nov 25, 2024
@jackorp
Copy link
Author

jackorp commented Nov 25, 2024

Sounds good, I have removed the line instead. I left catching the stderr in but now it just gets discarded, in order to not pollute test run output should $VERBOSE be true.

test_sni should be testing SNI use, it doesn't need to
check for specific stderr output which isn't shown by default.

The test test_sni in test_https.rb file checks stderr output for
information about primes being generated.
Since commit 6cb9bf6 the output is only
written if $VERBOSE is true. This happens when `--verbose` is provided
to the Ruby run arguments, or when the tests are ran via `rake`.

$stderr is still caught, but discarded to not pollute test run output
in the case $VERBOSE is true.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants