Repository navigation
Add HTTP/1.1 wire tests for One’s server - #1334
HarshPopat23 wants to merge 2 commits into
Conversation
Exercise the real HTTP wrappers over loopback with RFC-based cases informed by h1spec. Register the fixture and runner with CTest. Signed-off-by: HarshPopat23 <musichk61@gmail.com>
There was a problem hiding this comment.
All reported issues were addressed across 6 files
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
Signed-off-by: HarshPopat23 <musichk61@gmail.com>
|
PTAL : @jviotti |
There was a problem hiding this comment.
In general try to avoid these markdown files. Its unnecessary documentation that can easily go out of date.
jviotti
left a comment
There was a problem hiding this comment.
I get the idea but I think an actual unit test runner for this would be something to do when the HTTP server gets into the Core repo.
I think for now the most important one would be to test the HTTP parser, independently, on the Core repo, and grow that enough to attempt an implementation on top of uSockets.
Because the HTTP parser is essentially a pure function, we can unit test it a lot for adversarial cases, etc. So maybe let's start with that?
|
Thanks, Juan. I’ll close this PR and start with a standalone HTTP/1.1 parser and direct unit tests in Core. Once the HTTP server is in Core, I’ll revisit the wire-level test runner and refer back to this PR for any fixtures that still apply. |
Description
Adds a
one.http.wireCTest target that sends raw HTTP/1.1 requests over loopback to a test-only echo server built with One’sHTTPServer,HTTPRequest, andHTTPResponsewrappers. The tests establish a baseline for evaluating future HTTP parser changes.The seven cases cover request-target parsing, requests split across writes, fixed-length binary bodies, chunked bodies, rejection of a missing
Hostheader, and payloads at and above the configured body limit. The cases were written against RFC 9112 and informed by theh1specrevision pinned by uWebSockets. The test README documents the selected coverage and exclusions.The fixture binds to an OS-assigned loopback port, announces readiness, and shuts down after the run. The runner bounds request and shutdown waits. The existing CTest job picks up the suite when server tests are enabled.
Validation