Repository navigation
add curl conformance harness - #760
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ffa2dfe1b7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| conformance-test: | ||
| @BASH_PATH=$$(./scripts/ensure-bash.sh) || exit 1; \ | ||
| CURL_PATH=$$(./scripts/ensure-curl.sh) || exit 1; \ |
There was a problem hiding this comment.
Defer curl oracle setup for bash-only conformance filters
conformance-test now unconditionally runs ./scripts/ensure-curl.sh before invoking go test -run "$(CONFORMANCE_RUN)", so bash-only runs like CONFORMANCE_RUN='TestConformance/bash' fail on machines without the pinned curl even though no curl subtests are selected. This is a regression in filtered workflows: the target should only require curl when the selected conformance scope actually includes the curl suite.
Useful? React with 👍 / 👎.
Summary
Add a curl parity harness under
internal/conformancethat compares gbash's builtincurlagainst a pinned Nixcurloracle over a deterministic local HTTP server.What changed
flake.nix,scripts/ensure-curl.sh,Makefile, andinternal/testutil/nix_curl.gohttptest.Serverand a focused spec corpus covering GET, redirects, auth/header shaping, form uploads, file uploads, output modes, header inclusion, HEAD, and-f -sSWhy
The existing curl coverage was mostly unit-level and stub-client based. This adds real end-to-end parity coverage against an actual pinned curl binary so behavior regressions show up the same way bash conformance regressions do.
Root cause fixed
The first oracle run exposed a real mismatch in
--data-urlencode: gbash encoded spaces as%20while upstream curl emits+. This PR fixes the builtin to match upstream curl and updates the corresponding unit test.Impact
make testpathmake conformance-testValidation
go test ./internal/testutil ./internal/conformancego test ./internal/builtins -run 'TestCurl'make conformance-test CONFORMANCE_RUN='TestConformance/curl'GBASH_CONFORMANCE_DIFF=$(./scripts/ensure-diffutils.sh) go test ./internal/builtins ./internal/testutil ./internal/conformance