Skip to content

add curl conformance harness - #760

Merged
ewhauser merged 2 commits into
mainfrom
ewhauser/curl-conformance-harness
Mar 28, 2026
Merged

ewhauser merged 2 commits into
mainfrom
ewhauser/curl-conformance-harness

Conversation

@ewhauser

Copy link
Copy Markdown
Owner

Summary

Add a curl parity harness under internal/conformance that compares gbash's builtin curl against a pinned Nix curl oracle over a deterministic local HTTP server.

What changed

  • add pinned Nix curl tooling via flake.nix, scripts/ensure-curl.sh, Makefile, and internal/testutil/nix_curl.go
  • extend the conformance runner so suites can inject env, oracle binaries, and a gbash runtime config overlay
  • add a local curl conformance suite with a deterministic httptest.Server and a focused spec corpus covering GET, redirects, auth/header shaping, form uploads, file uploads, output modes, header inclusion, HEAD, and -f -sS
  • document the new curl oracle path alongside existing bash/diff conformance docs

Why

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 %20 while upstream curl emits +. This PR fixes the builtin to match upstream curl and updates the corresponding unit test.

Impact

  • improves confidence in builtin curl behavior without changing the default make test path
  • keeps curl parity testing behind make conformance-test
  • makes the conformance environment reproducible across platforms with a pinned curl oracle

Validation

  • go test ./internal/testutil ./internal/conformance
  • go 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

@ewhauser ewhauser changed the title [codex] add curl conformance harness add curl conformance harness Mar 28, 2026
@ewhauser
ewhauser marked this pull request as ready for review March 28, 2026 16:02
@ewhauser
ewhauser merged commit 5f574bb into main Mar 28, 2026
15 checks passed
@ewhauser
ewhauser deleted the ewhauser/curl-conformance-harness branch March 28, 2026 16:02

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread Makefile

conformance-test:
@BASH_PATH=$$(./scripts/ensure-bash.sh) || exit 1; \
CURL_PATH=$$(./scripts/ensure-curl.sh) || exit 1; \

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant