-
Notifications
You must be signed in to change notification settings - Fork 18
Use locally hosted services for tests #246
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
Conversation
96083ac to
5e7866c
Compare
00b3559 to
79ae29a
Compare
79ae29a to
8254da5
Compare
0beea46 to
8fad2d9
Compare
8fad2d9 to
4bf82b6
Compare
pquentin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! This is a great step forward - there are possible improvements, but they can be treated as follow ups.
|
|
||
| @pytest.mark.asyncio | ||
| async def test_async_transport_httpbin(httpbin_node_config): | ||
| async def test_async_transport_httpbin(httpbin_node_config, httpbin): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: as a follow-up, we could add an url property to NodeConfig, which would avoid accepting both httpbin and httpbin_node_config. (It took me a while to understand.)
| # This is the root CA for httpbin.org with a leading comma to denote more than one cert was listed. | ||
| assert ', "8ecde6884f3d87b1125ba31ac3fcb13d7016de7f57cc904fe1cb97c6ae98196e"' in err | ||
| assert ', "cbb522d7b7f127ad6a0113865bdf1cd4102e7d0759af635a7cf4720dc963c53b"' in err |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The certificate is currently generated by trustme: kevin1024/pytest-httpbin#90. Since it generates its own CA, this is going to be less stable than before. Additionally, the comment is out of date.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the root CA for www.elastic.co, this is the one test that does not use the local httpbin.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, sorry. This should be pretty stable. Can we update the comment above then?
* Use a locally hosted httpbin for tests * use a www.elastic.co instead of httpbin.org for SSL tests * use pytest-httpbin instead of a local service * use pytest-httpbin also for SSL tests * fix inaccurate comment (cherry picked from commit 23d0f56)
* Use a locally hosted httpbin for tests * use a www.elastic.co instead of httpbin.org for SSL tests * use pytest-httpbin instead of a local service * use pytest-httpbin also for SSL tests * fix inaccurate comment (cherry picked from commit 23d0f56)
* Use a locally hosted httpbin for tests * use a www.elastic.co instead of httpbin.org for SSL tests * use pytest-httpbin instead of a local service * use pytest-httpbin also for SSL tests * fix inaccurate comment (cherry picked from commit 23d0f56)
* Use a locally hosted httpbin for tests * use a www.elastic.co instead of httpbin.org for SSL tests * use pytest-httpbin instead of a local service * use pytest-httpbin also for SSL tests * fix inaccurate comment (cherry picked from commit 23d0f56) Co-authored-by: Miguel Grinberg <[email protected]>
* Use a locally hosted httpbin for tests * use a www.elastic.co instead of httpbin.org for SSL tests * use pytest-httpbin instead of a local service * use pytest-httpbin also for SSL tests * fix inaccurate comment (cherry picked from commit 23d0f56) Co-authored-by: Miguel Grinberg <[email protected]>
* Use a locally hosted httpbin for tests * use a www.elastic.co instead of httpbin.org for SSL tests * use pytest-httpbin instead of a local service * use pytest-httpbin also for SSL tests * fix inaccurate comment (cherry picked from commit 23d0f56) Co-authored-by: Miguel Grinberg <[email protected]>
Replace calls to httpbin.org with a locally hosted hhtpbin server to avoid the high number of 502s in test runs. The pytest-httpbin plugin is used for this. There is a test that requires a certificate chain. For that I'm using www.elastic.co instead of the flaky httpbin.org, which hopefully is going to be more reliable. I also haven't touched the tests that send requests to badssl.com, since those appear to be stable in CI.