diff --git a/examples/skip_flags/README.md b/examples/skip_flags/README.md index b17dff2e..6b1f239f 100644 --- a/examples/skip_flags/README.md +++ b/examples/skip_flags/README.md @@ -57,4 +57,55 @@ To skip a particular labeled feature , do the following ```shell ./skipflags.test --skip-labels "env=prod" -``` \ No newline at end of file +``` + +### Skip tests using built in -skip flag in go test + +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 + +```shell +go test -v . -skip // +``` + +To skip a test by test function name `TestSkipFlags`, do the following + +```shell +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 +``` + + +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 +``` + +It is not possible to skip features by label name with this option + + +### Skip tests using both -skip flag and --skip-xxx flags + +We can also use the combination of `-skip` flag built in `go test` and `-skip-xxx` flags provided by the e2e-framework to skip multiple tests + + +To skip a feature `pod list` within test function `TestSkipFlags` and feature `appsv1/deployment` within test function `TestSkipFlags`, do the following + +```shell +go test -v . -skip TestSkipFlags/appsv1/deployment -args --skip-features "pod list" +``` + +To skip a particular labeled feature with label `env=prod` and assesment `deployment creation` within feature `appsv1/deployment` within test function `TestSkipFlags`, do the following + +```shell +go test -v . -skip TestSkipFlags/appsv1/deployment/deployment_creation -args --skip-labels "env=prod" +```