Skip to content

tests: gate remote flatten fixtures as long tests#222

Open
HNO3Miracle wants to merge 1 commit into
go-openapi:masterfrom
HNO3Miracle:hno3/gate-remote-flatten-test
Open

tests: gate remote flatten fixtures as long tests#222
HNO3Miracle wants to merge 1 commit into
go-openapi:masterfrom
HNO3Miracle:hno3/gate-remote-flatten-test

Conversation

@HNO3Miracle

Copy link
Copy Markdown

TestFlatten_RemoteAbsolute fetches the CloudEvents v0.2 schema from raw.githubusercontent.com. Reuse the existing -enable-long test switch so the default unit suite works offline while preserving an explicit path to run the remote fixture coverage.

Tested with go test ./....

Signed-off-by: HNO3Miracle <xiangao.or@isrc.iscas.ac.cn>
@codecov

codecov Bot commented Jul 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.44%. Comparing base (f65b576) to head (dfb6db4).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #222      +/-   ##
==========================================
- Coverage   91.83%   91.44%   -0.39%     
==========================================
  Files          30       30              
  Lines        3393     4244     +851     
==========================================
+ Hits         3116     3881     +765     
- Misses        194      281      +87     
+ Partials       83       82       -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@fredbi fredbi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Instead of simply disabling the test, I'd prefer that the spec is served on an embedded httpttest server.

Comment thread flatten_test.go
}

func TestFlatten_RemoteAbsolute(t *testing.T) {
if !antest.LongTestsEnabled() {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Disabling the test is not desirable, and I disagree with weakening the test suite.

What is needed instead to really improve this test is to serve the entire spec locally (e.g. with a httptest server like you've seen in your "go-openapi/validate" PR). But the fixture needs some tweaking to resolve remotes against a localhost test server.

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.

2 participants