Skip to content
Merged
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
8 changes: 7 additions & 1 deletion acceptance/acceptance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ var (
LogRequests bool
LogConfig bool
UseVersion string
CLIPath string
WorkspaceTmpDir bool
OnlyOutTestToml bool
Subset bool
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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)
Expand Down
Loading