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

Support -skip of multiple tests #141

Open
lidel opened this issue Aug 14, 2023 · 3 comments
Open

Support -skip of multiple tests #141

lidel opened this issue Aug 14, 2023 · 3 comments
Assignees

Comments

@lidel
Copy link
Member

lidel commented Aug 14, 2023

(Not sure if I was doing something wrong or maybeit is just a part of our story that needs more polishing, filling issue to discuss)

i was trying to run tests on CI (ipfs-inactive/bifrost-gateway#190) with

args: -skip 'TestGatewayCache/GET_for_/ipfs/_with_only-if-cached_succeeds_when_in_local_datastore' -skip 'TestGatewayCache/HEAD_for_/ipfs/_with_only-if-cached_succeeds_when_in_local_datastore'

When run, only one of them was excluded.

I worked around it with regex (since bothe differ in HEAD/GET):

args: -skip 'TestGatewayCache/.*_for_/ipfs/_with_only-if-cached_succeeds_when_in_local_datastore'

but we should make it possible for people running test suite to exclude more than one pattern, as they may want to exclude multiple unrelated ones.

@lidel lidel changed the title Support skipping multiple tests Support -skip of multiple tests Aug 14, 2023
@lidel
Copy link
Member Author

lidel commented Aug 14, 2023

@laurentsenta thoughts?

If this is supported and i am just holding it wrong, maybe we just need to update README and add better example there :)

@laurentsenta
Copy link
Contributor

@lidel apologies for the slow response, it is not supported: that -skip is the regular go flag.
Skipping group of packages is not supported yet: golang/go#41583 (comment)

Your use case makes a lot of sense and I don't think we should wait for Golang to implement this feature (it probably makes less sense for the "average" use case of go tests). I'll look into implementing this feature.

@laurentsenta
Copy link
Contributor

laurentsenta commented Aug 24, 2023

@lidel following #148 (comment) could you try using

go test ... -skip 'TestGatewayCache/(GET|HEAD)_for_/ipfs/_with_only-if-cached_succeeds_when_in_local_datastore'

?

Notes from trying out the skip syntax: https://gist.github.com/laurentsenta/5ed9fe9954605eefc1ed9ee2db7f66a9

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

Successfully merging a pull request may close this issue.

2 participants