Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SkipTestMain utility function for clearer output #6794

Merged
merged 5 commits into from
Apr 30, 2024

Conversation

bbrks
Copy link
Member

@bbrks bbrks commented Apr 30, 2024

This change makes it much more obvious that the package's tests are being completely skipped.

Formatting details can be negotiated. I tried to match the regular test output format for any parsers that may be interpreting this, however that may be more trouble than it's worth.

There's also no special exit code that we can return other than 0 for TestMain that would show skipped instead of ok. Any non-zero code shows FAIL.

Before

$ go test -v -count=1 -run '^TestAutoImportUserXattrNoSyncData$' ./rest/importuserxattrtest
ok  	github.com/couchbase/sync_gateway/rest/importuserxattrtest	0.574s

After

$ go test -v -count=1 -run '^TestAutoImportUserXattrNoSyncData$' ./rest/importuserxattrtest
=== RUN   TestMain
    main_test.go:24: user xattr tests require xattrs and EE
--- SKIP: TestMain (0.00s)
ok  	github.com/couchbase/sync_gateway/rest/importuserxattrtest	0.582s

Copy link
Collaborator

@torcolvin torcolvin left a comment

Choose a reason for hiding this comment

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

This seems great, I've definitely been confused by this.


if !base.TestUseXattrs() { // import tests only run if xattrs are enabled

should get added too.

@bbrks bbrks enabled auto-merge (squash) April 30, 2024 13:40
@bbrks bbrks merged commit 1c07c86 into main Apr 30, 2024
16 of 17 checks passed
@bbrks bbrks deleted the clearer_importuserxattrtest_skip branch April 30, 2024 13:43
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