Skip to content

Commit 5f34258

Browse files
authored
acc: Don't auto-enable -subset when -run specifies a variant (#4837)
When -update is used with a -run filter that likely includes a specific EnvMatrix variant (detected by presence of '='), subset selection is not needed — Go's test framework already limits execution to the requested variant. Follow-up to #4800.
1 parent 0d0ebe4 commit 5f34258

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

acceptance/acceptance_test.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ func init() {
7979
// to simulate an identical environment.
8080
flag.BoolVar(&WorkspaceTmpDir, "workspace-tmp-dir", false, "Run tests on the workspace file system (For DBR testing).")
8181
flag.BoolVar(&OnlyOutTestToml, "only-out-test-toml", false, "Only regenerate out.test.toml files without running tests")
82-
flag.BoolVar(&Subset, "subset", false, "Select a subset of EnvMatrix variants that cover all output files. Auto-enabled on -update.")
82+
flag.BoolVar(&Subset, "subset", false, "Select a subset of EnvMatrix variants that cover all output files. Auto-enabled on -update (unless -run specifies a variant with '=').")
8383
}
8484

8585
const (
@@ -179,8 +179,15 @@ func anyHelperScriptUsesEngine(dir string) bool {
179179
return result
180180
}
181181

182+
// hasRunFilter returns true if the -run flag contains '=', indicating a specific
183+
// EnvMatrix variant was requested (e.g. DATABRICKS_BUNDLE_ENGINE=direct).
184+
func hasRunFilter() bool {
185+
f := flag.Lookup("test.run")
186+
return f != nil && strings.Contains(f.Value.String(), "=")
187+
}
188+
182189
func testAccept(t *testing.T, inprocessMode bool, singleTest string) int {
183-
if testdiff.OverwriteMode {
190+
if testdiff.OverwriteMode && !hasRunFilter() {
184191
Subset = true
185192
}
186193

0 commit comments

Comments
 (0)