Skip to content
Open
Show file tree
Hide file tree
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
9 changes: 0 additions & 9 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -584,19 +584,10 @@ tasks:
cmds:
- "go test ./acceptance -run '^TestAccept/bundle/templates' -update -timeout=${LOCAL_TIMEOUT:-60m}"

test-update-aws:
desc: Update acceptance test output (integration, requires deco access)
sources: *ACC_SOURCES_UPDATE
generates: *ACC_GENERATES_UPDATE
cmds:
- "deco env run -i -n aws-prod-ucws -- env DATABRICKS_TEST_SKIPLOCAL=true go test ./acceptance -run ^TestAccept$ -update -timeout=1h -v"

test-update-all:
desc: Update all acceptance test outputs
# Sequential: both tasks overwrite the same acceptance output files.
cmds:
- task: test-update
- task: test-update-aws

# Follows upstream HEAD, so its result changes over time: keep it out of
# `generate-check`, which requires byte-for-byte reproducible output.
Expand Down
9 changes: 3 additions & 6 deletions acceptance/acceptance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -449,9 +449,9 @@ func testAccept(t *testing.T, inprocessMode bool, singleTest string) int {
subset := newSubsetSelector(t, testdiff.OverwriteMode, Forcerun)

switch skipLocalMode {
case "", SkipLocalAll, SkipLocalWithChanged:
case "", SkipLocalWithChanged:
default:
t.Fatalf("Unsupported %s=%q, expected %q or %q", SkipLocalEnvVar, skipLocalMode, SkipLocalAll, SkipLocalWithChanged)
t.Fatalf("Unsupported %s=%q, expected %q", SkipLocalEnvVar, skipLocalMode, SkipLocalWithChanged)
}
skipLocalWithChanged := skipLocalMode == SkipLocalWithChanged

Expand Down Expand Up @@ -657,10 +657,7 @@ func validateTestPhase(phase int) error {
// skipLocalMode is the value of DATABRICKS_TEST_SKIPLOCAL read once at startup.
// changedTests maps test dirs to extra env filters; nil map means feature is off.
func getSkipReason(config *internal.TestConfig, configPath, dir, skipLocalMode string, changedTests map[string][]string) string {
switch skipLocalMode {
case SkipLocalAll:
return "Disabled via DATABRICKS_TEST_SKIPLOCAL=" + SkipLocalAll + " in " + configPath
case SkipLocalWithChanged:
if skipLocalMode == SkipLocalWithChanged {
if _, ok := changedTests[dir]; !ok {
return "Disabled via DATABRICKS_TEST_SKIPLOCAL=" + SkipLocalWithChanged + " in " + configPath
}
Expand Down
11 changes: 3 additions & 8 deletions acceptance/skiplocal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,14 @@ import (
"testing"
)

// DATABRICKS_TEST_SKIPLOCAL skips acceptance tests on cloud runs. All tests already
// run locally against the testserver; withchanged re-enables tests this branch touches.
// Cloud PR runs set DATABRICKS_TEST_SKIPLOCAL=withchanged to skip acceptance
// tests that already run locally, except those this branch touches.
const (
SkipLocalEnvVar = "DATABRICKS_TEST_SKIPLOCAL"

// SkipLocalAll skips every acceptance test.
SkipLocalAll = "true"
// SkipLocalWithChanged skips acceptance tests except those added or changed
// relative to origin/main.
SkipLocalWithChanged = "withchanged"

// maxChangedLocalTests caps how many changed tests SkipLocalWithChanged re-enables,
// keeping the cloud run bounded. Added tests are preferred over modified ones.
// Cap re-enabled tests so cloud PR runs stay bounded; prefer added over modified.
maxChangedLocalTests = 50

invariantConfigsPrefix = "acceptance/bundle/invariant/configs/"
Expand Down
Loading