diff --git a/acceptance/acceptance_test.go b/acceptance/acceptance_test.go index 385f45b6d..456558aa3 100644 --- a/acceptance/acceptance_test.go +++ b/acceptance/acceptance_test.go @@ -124,6 +124,7 @@ func testAccept(t *testing.T, InprocessMode bool, singleTest string) int { testdiff.PrepareReplacementsUser(t, &repls, *user) testdiff.PrepareReplacementsWorkspaceClient(t, &repls, workspaceClient) testdiff.PrepareReplacementsUUID(t, &repls) + testdiff.PrepareReplacementsDevVersion(t, &repls) testDirs := getTests(t) require.NotEmpty(t, testDirs) diff --git a/acceptance/bundle/debug/out.stderr.txt b/acceptance/bundle/debug/out.stderr.txt index a2d2c8b1d..52d4028a2 100644 --- a/acceptance/bundle/debug/out.stderr.txt +++ b/acceptance/bundle/debug/out.stderr.txt @@ -1,4 +1,4 @@ -Info: start version=0.0.0-dev+abe693a9ae98 args="$CLI, bundle, validate, --debug" +Info: start version=$DEV_VERSION args="$CLI, bundle, validate, --debug" Debug: Found bundle root at $TMPDIR (file $TMPDIR/databricks.yml) Debug: Apply mutator=load Info: Phase: load mutator=load diff --git a/libs/testdiff/replacement.go b/libs/testdiff/replacement.go index 865192662..c69604abb 100644 --- a/libs/testdiff/replacement.go +++ b/libs/testdiff/replacement.go @@ -23,6 +23,7 @@ var ( uuidRegex = regexp.MustCompile(`[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}`) numIdRegex = regexp.MustCompile(`[0-9]{3,}`) privatePathRegex = regexp.MustCompile(`(/tmp|/private)(/.*)/([a-zA-Z0-9]+)`) + devVersionRegex = regexp.MustCompile(`0\.0\.0-dev\+[a-f0-9]{10,16}`) ) type Replacement struct { @@ -207,3 +208,8 @@ func PrepareReplacementsTemporaryDirectory(t testutil.TestingT, r *ReplacementsC t.Helper() r.append(privatePathRegex, "/tmp/.../$3") } + +func PrepareReplacementsDevVersion(t testutil.TestingT, r *ReplacementsContext) { + t.Helper() + r.append(devVersionRegex, "$$DEV_VERSION") +}