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

Skip SSL tests instead silently passing them. #1500

Merged
merged 2 commits into from
Mar 20, 2018

Conversation

voxik
Copy link
Contributor

@voxik voxik commented Jan 4, 2018

If SSL is not used, the tests might be silently passing, while they are
not executed at all.

Let me explain.

The think is that you might not be testing some functionality of Puma and you might not even notice it, because the behavior of test suite apparently depends on load order.

E.g. the test suite is failing for me when I try to execute the test suite like this:

$ ruby -e 'Dir.glob "./test/**/test_*.rb", &method(:require)' -- -v

... snip ...

  1) Failure:
TestPumaServerSSL#test_ssl_v3_rejection [/builddir/build/BUILD/puma-3.11.0/usr/share/gems/gems/puma-3.11.0/test/test_puma_server_ssl.rb:119]:
Expected /wrong\ version\ number/ to match # encoding: ASCII-8BIT
"OpenSSL error: error:1417D102:SSL routines:tls_process_client_hello:unsupported protocol - 337105154".

177 runs, 372 assertions, 1 failures, 0 errors, 0 skips

But if you use the right load order, the test suite pass, although it ignores some tests:

$ ruby -r./test/test_puma_server_ssl -e 'Dir.glob "./test/**/test_*.rb", &method(:require)' -- -v

... snip ...

177 runs, 351 assertions, 0 failures, 0 errors, 0 skips

But with the patch applied, you can see that some tests were actually skipped:

$ ruby -r./test/test_puma_server_ssl -e 'Dir.glob "./test/**/test_*.rb", &method(:require)' -- -v

... snip ...

177 runs, 351 assertions, 0 failures, 0 errors, 4 skips

If SSL is not used, the tests might be silently passing, while they are
not executed at all.
@voxik
Copy link
Contributor Author

voxik commented Jan 4, 2018

Now I noticed that the "TestPumaServerSSLClient" tests suffers the same issue. BTW this was introduced in d421a53

@olleolleolle
Copy link
Contributor

This looks like a good update to the test suite!

@nateberkopec nateberkopec merged commit 7e932d0 into puma:master Mar 20, 2018
@schneems
Copy link
Contributor

This broke master, the scope of the variable @host was changed to host in another commit. Going to try working on a fix on #1542

schneems added a commit to schneems/puma that referenced this pull request Mar 20, 2018
Broke after puma#1500.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants