Skip to content

test: stop executing the live remote-URL doc examples#259

Merged
fredbi merged 1 commit into
go-openapi:masterfrom
fredbi:test/fix-flaky-remote-spec
Jun 10, 2026
Merged

test: stop executing the live remote-URL doc examples#259
fredbi merged 1 commit into
go-openapi:masterfrom
fredbi:test/fix-flaky-remote-spec

Conversation

@fredbi

@fredbi fredbi commented Jun 10, 2026

Copy link
Copy Markdown
Member

ExampleSpec_second and ExampleSpecValidator_Validate_url load a spec from http://petstore.swagger.io/v2/swagger.json, a live host that intermittently returns HTTP 403, making the suite flaky.

Drop their "// Output:" directives so Go still compiles them (they remain in godoc with the real URL and cannot bit-rot) but no longer runs them under go test. The remote path exercises loads.JSONSpec + network rather than validate logic, which is already covered by the file-based examples and tests, so executed coverage is not lost. A note on each example explains why the directive is intentionally absent.

Change type

Please select: 🆕 New feature or enhancement|🔧 Bug fix'|📃 Documentation update

Short description

Fixes

Full description

Checklist

  • I have signed all my commits with my name and email (see DCO. This does not require a PGP-signed commit
  • I have rebased and squashed my work, so only one commit remains
  • I have added tests to cover my changes.
  • I have properly enriched go doc comments in code.
  • I have properly documented any breaking change.

ExampleSpec_second and ExampleSpecValidator_Validate_url load a spec from
http://petstore.swagger.io/v2/swagger.json, a live host that intermittently
returns HTTP 403, making the suite flaky.

Drop their "// Output:" directives so Go still compiles them (they remain in
godoc with the real URL and cannot bit-rot) but no longer runs them under
go test. The remote path exercises loads.JSONSpec + network rather than
validate logic, which is already covered by the file-based examples and
tests, so executed coverage is not lost. A note on each example explains why
the directive is intentionally absent.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
@fredbi fredbi merged commit e5b5ca2 into go-openapi:master Jun 10, 2026
40 of 43 checks passed
@fredbi fredbi deleted the test/fix-flaky-remote-spec branch June 10, 2026 15:08
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