From 5cdc06f3c79fb3b773ec95a29845cbc59f7ed6a9 Mon Sep 17 00:00:00 2001 From: Denis Bilenko Date: Thu, 25 Jun 2026 10:47:41 +0200 Subject: [PATCH] acceptance: add -clipath flag to use a prebuilt CLI binary The acceptance runner always builds $CLI from the current source (or downloads a release with -useversion). -clipath lets a caller point the tests at an already built binary instead, so the test runner and tests can stay on one branch while exercising a CLI built elsewhere (e.g. from main, for regression comparison). Co-authored-by: Isaac --- acceptance/acceptance_test.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/acceptance/acceptance_test.go b/acceptance/acceptance_test.go index d05035652e..4614534f31 100644 --- a/acceptance/acceptance_test.go +++ b/acceptance/acceptance_test.go @@ -45,6 +45,7 @@ var ( LogRequests bool LogConfig bool UseVersion string + CLIPath string WorkspaceTmpDir bool OnlyOutTestToml bool Subset bool @@ -75,6 +76,7 @@ func init() { flag.BoolVar(&LogRequests, "logrequests", false, "Log request and responses from testserver") flag.BoolVar(&LogConfig, "logconfig", false, "Log merged for each test case") flag.StringVar(&UseVersion, "useversion", "", "Download previously released version of CLI and use it to run the tests") + flag.StringVar(&CLIPath, "clipath", "", "Use the CLI binary at this path instead of building from source (e.g. a CLI built from main for regression comparison)") // DABs in the workspace runs on the workspace file system. This flags does the same for acceptance tests // to simulate an identical environment. @@ -285,7 +287,11 @@ func testAccept(t *testing.T, inprocessMode bool, singleTest string) int { t.Setenv("CMD_SERVER_URL", cmdServer.URL) execPath = filepath.Join(cwd, "bin", "callserver.py") } else { - if UseVersion != "" { + if CLIPath != "" { + // Use a prebuilt binary (e.g. a CLI built from main) instead of building + // from the current source, so the test infra and tests stay on this branch. + execPath = CLIPath + } else if UseVersion != "" { version := UseVersion if version == "latest" { version = resolveLatestVersion(t, buildDir)