Repository navigation
Local test server - #407
Merged
Merged
Conversation
The tests depended on httpbin.org, badssl.com, nghttp2.org and other third-party hosts, so a change in any of them failed CI. LocalHttpBin serves the same routes from the test process on every OS the CI matrix uses.
On macOS the handshake succeeds despite the client security level, so the request runs into the transfer timeout instead of a TLS error.
Member
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The test suite depends on third-party hosts: httpbin.org, badssl.com, nghttp2.org, cdn77.org, stackoverflow.com
and amphp.org. A change on any of them fails CI for unrelated pull requests. For example, #405 failed on
testReasonandtestMultipartBodyRequestbecause of httpbin.org responses, and fail-fast then cancelled theremaining jobs.
Solution
LocalHttpBinintest/Supportserves the routes the tests need from the test process, over HTTP and HTTPS. It usesamphp/http-server, asHttp2IntegrationTestandInterceptorTestalready do, so there are no new dependencies andno external services. It works on every OS in the CI matrix.
Test changes
testGzipBomb,testHttp2TeHeaderandtestHttp2UpgradeResponseare no longer skipped.testGzipBombnow expectsStreamException, which is what the size limit throws, instead ofParseException.testReasonuses a raw server response, becauseamphp/http-serversends no reason for 418.testSingleConnectionDoNotUseBodyandtestSingleConnectionDoNotUseBodyHttp2now await both requests, so thesecond one isn't aborted when the server stops.
testDhKeyTooSmallcan't use a 512-bit key: OpenSSL 3.5 refuses to load it on the server. The server uses a 2048-bitkey from
test/tls/dh2048.pemover TLS 1.2, and the client sets security level 3, which gives the samedh key too smallerror.testDhKeyTooSmallruns on Linux only. On macOS the handshake succeeded and the request hit the transfer timeout,so the test didn't reach the expected error. The cause isn't known yet.
testHttp2Pushstays skipped and still refers to its old external URL. A local run didn't work: the pushed responsedidn't arrive within 100 ms of the parent request.
CI
There is a new PHP 8.6 job on Ubuntu with
continue-on-error, so its failures don't block the other jobs. Psalm, thestyle fixer and composer-require-checker are off for this job, and Composer runs with
--ignore-platform-req=php+.