From 3ad385335bb473a445f523831300b87cc6180792 Mon Sep 17 00:00:00 2001 From: Denis Bilenko Date: Wed, 25 Mar 2026 14:00:12 +0100 Subject: [PATCH] acc: Don't auto-enable -subset when -run specifies a variant MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When -update is used with a -run filter that 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. Co-authored-by: Isaac --- acceptance/acceptance_test.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/acceptance/acceptance_test.go b/acceptance/acceptance_test.go index 90e983d438..eb2184ec85 100644 --- a/acceptance/acceptance_test.go +++ b/acceptance/acceptance_test.go @@ -79,7 +79,7 @@ func init() { // to simulate an identical environment. flag.BoolVar(&WorkspaceTmpDir, "workspace-tmp-dir", false, "Run tests on the workspace file system (For DBR testing).") flag.BoolVar(&OnlyOutTestToml, "only-out-test-toml", false, "Only regenerate out.test.toml files without running tests") - flag.BoolVar(&Subset, "subset", false, "Select a subset of EnvMatrix variants that cover all output files. Auto-enabled on -update.") + 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 '=').") } const ( @@ -179,8 +179,15 @@ func anyHelperScriptUsesEngine(dir string) bool { return result } +// hasRunFilter returns true if the -run flag contains '=', indicating a specific +// EnvMatrix variant was requested (e.g. DATABRICKS_BUNDLE_ENGINE=direct). +func hasRunFilter() bool { + f := flag.Lookup("test.run") + return f != nil && strings.Contains(f.Value.String(), "=") +} + func testAccept(t *testing.T, inprocessMode bool, singleTest string) int { - if testdiff.OverwriteMode { + if testdiff.OverwriteMode && !hasRunFilter() { Subset = true }