Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
510 views
in Technique[技术] by (71.8m points)

testing - Skip some tests with go test

Is it possible to skip/exclude some tests from being run with go test?

I have a fairly large amount of integration type tests which call a rest service written as standard go tests, and run with go test. When a new feature is developed its sometimes useful to be able to skip some of the tests, for example if the new feature is not yet deployed on the testing server and I still want to run all the existing tests (except those new ones which tests the new feature).

I know about -run, but I dont want to specify all tests I want to run, that would be a long list. At the same time I have not been able to write a regex for excluding tests.

Another option would be to not commit the tests which dont run in the same branch, but it would be easier if I could just specify what to exclude.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

56.8k users

...