Skip to content

Commit

Permalink
update --skip to -skip and add new line
Browse files Browse the repository at this point in the history
  • Loading branch information
reetasingh committed Feb 20, 2023
1 parent d8b66b1 commit 032076c
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions examples/skip_flags/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,30 +59,35 @@ To skip a particular labeled feature , do the following
./skipflags.test --skip-labels "env=prod"
```
### Skip tests using built in --skip flag in go test
### Skip tests using built in -skip flag in go test
Go 1.20 introduces the ```-skip``` flag for ```go test``` command to skip tests.
Go 1.20 introduces the `-skip` flag for `go test` command to skip tests.
Tests can also be skipped based on test function name, feature name and assesment name with ```-skip``` flag
Tests can also be skipped based on test function name, feature name and assesment name with `-skip` flag
```shell
go test -v . --skip <test_function_name>/<feature_name>/<assesment_name>
go test -v . -skip <test_function_name>/<feature_name>/<assesment_name>
```
To skip a test by test function name `TestSkipFlags`, do the following
```shell
go test -v . --skip TestSkipFlags
go test -v . -skip TestSkipFlags
```
To skip a feature with name `pod list` within test function `TestSkipFlags`, do the following
```shell
go test -v . --skip TestSkipFlags/pod list
go test -v . -skip TestSkipFlags/pod list
```
To skip a assesment with name `pods from kube-system` within feature `pod list` within test function `TestSkipFlags`, do the following
```shell
go test -v . --skip TestSkipFlags/pod list/pods from kube-system
go test -v . -skip TestSkipFlags/pod list/pods from kube-system
```
It is not possible to skip features by label name with this option

0 comments on commit 032076c

Please sign in to comment.