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_test option in yaml file #12273

Merged
merged 3 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading