File tree Expand file tree Collapse file tree 5 files changed +16
-10
lines changed
Expand file tree Collapse file tree 5 files changed +16
-10
lines changed Original file line number Diff line number Diff line change 1818 found .add (t )
1919 for t in must_not_find :
2020 if t in line :
21- sys .stderr .write (f"contains error: { t !r} was not expected\n " )
21+ sys .stderr .write (f"contains error: { t !r} was not expected: { line . strip ()!r } \n " )
2222
2323sys .stdout .flush ()
2424
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ cp databricks.yml LOG.config
1818
1919cleanup() {
2020 trace $CLI bundle destroy --auto-approve &> LOG.destroy
21- cat LOG.destroy | contains.py '!panic' '!internal error' > /dev/null
21+ cat LOG.destroy | contains.py '!panic: ' '!internal error' > /dev/null
2222
2323 # Run cleanup script if present
2424 CLEANUP_SCRIPT="$TESTDIR/../configs/$INPUT_CONFIG-cleanup.sh"
@@ -30,14 +30,14 @@ cleanup() {
3030trap cleanup EXIT
3131
3232trace DATABRICKS_BUNDLE_ENGINE=terraform $CLI bundle deploy &> LOG.deploy
33- cat LOG.deploy | contains.py '!panic' '!internal error' > /dev/null
33+ cat LOG.deploy | contains.py '!panic: ' '!internal error' > /dev/null
3434
3535echo INPUT_CONFIG_OK
3636
3737trace $CLI bundle deployment migrate &> LOG.migrate
3838
39- cat LOG.migrate | contains.py '!panic' '!internal error' > /dev/null
39+ cat LOG.migrate | contains.py '!panic: ' '!internal error' > /dev/null
4040
4141$CLI bundle plan -o json &> plan.json
42- cat plan.json | contains.py '!panic' '!internal error' > /dev/null
42+ cat plan.json | contains.py '!panic: ' '!internal error' > /dev/null
4343verify_no_drift.py plan.json
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ Failed script
2020=== This should complain about Hello present in output
2121>>> python3 ./success.py
2222Hello world
23- contains error: 'Hello' was not expected
23+ contains error: 'Hello' was not expected: 'Hello world'
2424
2525=== This should not complain
2626>>> python3 ./success.py
Original file line number Diff line number Diff line change 3939 globalConfig * Config
4040 generatedConfigOnce sync.Once
4141 generatedConfig * Config
42+ empty = ResourceLifecycleConfig {
43+ IgnoreRemoteChanges : nil ,
44+ IgnoreLocalChanges : nil ,
45+ RecreateOnChanges : nil ,
46+ UpdateIDOnChanges : nil ,
47+ }
4248)
4349
4450// MustLoadConfig loads and parses the embedded resources.yml configuration.
@@ -78,7 +84,7 @@ func GetResourceConfig(resourceType string) *ResourceLifecycleConfig {
7884 if rc , ok := cfg .Resources [resourceType ]; ok {
7985 return & rc
8086 }
81- return nil
87+ return & empty
8288}
8389
8490// GetGeneratedResourceConfig returns the generated lifecycle config for a given resource type.
@@ -88,5 +94,5 @@ func GetGeneratedResourceConfig(resourceType string) *ResourceLifecycleConfig {
8894 if rc , ok := cfg .Resources [resourceType ]; ok {
8995 return & rc
9096 }
91- return nil
97+ return & empty
9298}
Original file line number Diff line number Diff line change @@ -12,6 +12,6 @@ func TestMustLoadConfig(t *testing.T) {
1212}
1313
1414func TestGetResourceConfig (t * testing.T ) {
15- assert .NotNil (t , GetResourceConfig ("volumes" ))
16- assert .Nil (t , GetResourceConfig ("nonexistent" ))
15+ assert .NotEmpty (t , GetResourceConfig ("volumes" ). RecreateOnChanges )
16+ assert .Empty (t , GetResourceConfig ("nonexistent" ). RecreateOnChanges )
1717}
You can’t perform that action at this time.
0 commit comments