Skip to content

Commit

Permalink
support skip_test option in yaml file (GoogleCloudPlatform#12273)
Browse files Browse the repository at this point in the history
Co-authored-by: Stephen Lewis (Burrows) <[email protected]>
  • Loading branch information
iyabchen and melinath authored Nov 13, 2024
1 parent 4dc6dd6 commit b27a58f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mmv1/api/resource/examples.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,10 @@ type Examples struct {
// Or a config with two fine grained resources that have a race condition during create
SkipVcr bool `yaml:"skip_vcr,omitempty"`

// The reason to skip a test. For example, a link to a ticket explaining the issue that needs to be resolved before
// unskipping the test. If this is not empty, the test will be skipped.
SkipTest string `yaml:"skip_test,omitempty"`

// Specify which external providers are needed for the testcase.
// Think before adding as there is latency and adds an external dependency to
// your test so avoid if you can.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ import (
)
{{ range $e := $.Res.TestExamples }}
func TestAcc{{ $e.TestSlug $.Res.ProductMetadata.Name $.Res.Name }}(t *testing.T) {
{{- if $e.SkipTest }}
t.Skip("{{$e.SkipTest}}")
{{- end }}

{{- if $e.SkipVcr }}
acctest.SkipIfVcr(t)
{{- end }}
Expand Down

0 comments on commit b27a58f

Please sign in to comment.