-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Check frameworks for HTTP compliance #9440
Comments
We created our own functional tests for Adapterman and Workerman. All the tests: As only 1 test is specific to PHP, recently we have move it to it's own project to use with any server or app server. Actually we have 103 tests and 511 assertions. But for run the tests we need a file in the server to return the values. So with the code that we have from this bench, the number of tests that we can run it's very small and never will be realistic. Only will detect the more radical implementations. |
Nice, thanks - yes, without the server fulfilling some contract we can test only a few assertions. Nevertheless detecting and disabling radical implementations on official rounds already would be a great improvement as they tend to be on top - so I would encourage such an usage of your suite with just a few of the tests. |
We can start a list of the tests, that we can use in this bench:
|
I think it's fine for a server to return 200 OK for a non-existent URL so the tests need to be very defensive - but yes, based on the test spec we should be able to find some things to be tested. Some frameworks have very simplified socket handling (e.g. they expect the full request to be already in the buffer), but this would require something different than a HTTP client - the approach above would probably be fine. |
A non-existent URL is always a |
Another problem that we had some years ago, and still now, it's that some frameworks return a compressed response always. Added to the list, only with |
@NateBrady23 what do you think about this test list ? |
@joanhey This is a good list! I also like the idea of failing the build if the test is marked as realistic but fails this list. |
Currently there are a lot of frameworks marked as
realistic
that do not provide a proper HTTP webserver implementation but just respond to the test tools in the expected manner. As they skip a lot of scenarios a real-world web server has to handle, they are of course faster.After the discussion in #9391 I've created a project intended to check a HTTP web server for compliance with the HTTP specification. This is a very rough draft because this is a functionality not very much projects would need - so I am willing to spend more time only, if you are interested in integrating such tool into your test framework. The executable will take an HTTP endpoint and return a status code whether the server is compliant or not.
You can find the project here: https://github.com/Kaliumhexacyanoferrat/http-conformity
The information provided by the tool could be used in various ways:
realistic
Please let me know what you think :)
The text was updated successfully, but these errors were encountered: