Skip to content

Commit b56f245

Browse files
authored
Enable "direct" deployment method tests on CI (#3139)
The "direct deployment" PR has a last minute change of env var value from "direct" to "direct-exp" (b47b1f6) but CI settings were not updated, thus disabling direct tests on CI. This enables them back ## Tests Manually: ``` ~/work/cli/acceptance/bundle/resources/jobs % ENVFILTER=DATABRICKS_CLI_DEPLOYMENT=terraform testme -v -count=1 | egrep 'PASS|SKIP|FAIL' + go test ../../.. -run ^TestAccept$/^bundle$/^resources$/^jobs$ -v -count=1 --- SKIP: TestAccept/bundle/resources/jobs/DATABRICKS_CLI_DEPLOYMENT=direct-exp (0.01s) --- PASS: TestAccept/bundle/resources/jobs/DATABRICKS_CLI_DEPLOYMENT=terraform (4.74s) ~/work/cli/acceptance/bundle/resources/jobs % ENVFILTER=DATABRICKS_CLI_DEPLOYMENT=direct testme -v -count=1 | egrep 'PASS|SKIP|FAIL' + go test ../../.. -run ^TestAccept$/^bundle$/^resources$/^jobs$ -v -count=1 --- PASS: TestAccept (1.07s) --- PASS: TestAccept/bundle/resources/jobs (0.00s) --- SKIP: TestAccept/bundle/resources/jobs/DATABRICKS_CLI_DEPLOYMENT=terraform (0.01s) --- PASS: TestAccept/bundle/resources/jobs/DATABRICKS_CLI_DEPLOYMENT=direct-exp (2.34s) ~/work/cli/acceptance/bundle/resources/jobs % ENVFILTER=DATABRICKS_CLI_DEPLOYMENT=direct-exp testme -v -count=1 | egrep 'PASS|SKIP|FAIL' + go test ../../.. -run ^TestAccept$/^bundle$/^resources$/^jobs$ -v -count=1 --- PASS: TestAccept (1.04s) --- PASS: TestAccept/bundle/resources/jobs (0.00s) --- SKIP: TestAccept/bundle/resources/jobs/DATABRICKS_CLI_DEPLOYMENT=terraform (0.01s) --- PASS: TestAccept/bundle/resources/jobs/DATABRICKS_CLI_DEPLOYMENT=direct-exp (2.37s) ~/work/cli/acceptance/bundle/resources/jobs % ENVFILTER=DATABRICKS_CLI_DEPLOYMENT=bla testme -v -count=1 | egrep 'PASS|SKIP|FAIL' + go test ../../.. -run ^TestAccept$/^bundle$/^resources$/^jobs$ -v -count=1 --- PASS: TestAccept (1.02s) --- PASS: TestAccept/bundle/resources/jobs (0.00s) --- SKIP: TestAccept/bundle/resources/jobs/DATABRICKS_CLI_DEPLOYMENT=direct-exp (0.00s) --- SKIP: TestAccept/bundle/resources/jobs/DATABRICKS_CLI_DEPLOYMENT=terraform (0.00s) ```
1 parent 2a3d002 commit b56f245

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

acceptance/acceptance_test.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,7 @@ func getEnvFilters(t *testing.T) []string {
304304
}
305305

306306
filters := strings.Split(envFilterValue, ",")
307+
outFilters := make([]string, len(filters))
307308

308309
for _, filter := range filters {
309310
items := strings.Split(filter, "=")
@@ -313,9 +314,17 @@ func getEnvFilters(t *testing.T) []string {
313314
key := items[0]
314315
// Clear it just to be sure, since it's going to be part of os.Environ() and we're going to add different value based on settings.
315316
os.Unsetenv(key)
317+
318+
if key == "DATABRICKS_CLI_DEPLOYMENT" && items[1] == "direct" {
319+
// CLI only recognizes "direct-exp" at the moment, but in the future will recognize "direct" as well.
320+
// On CI we set "direct". To avoid renaming jobs in CI on the future, we correct direct -> direct-exp here
321+
items[1] = "direct-exp"
322+
}
323+
324+
outFilters = append(outFilters, key+"="+items[1])
316325
}
317326

318-
return filters
327+
return outFilters
319328
}
320329

321330
func getTests(t *testing.T) []string {

0 commit comments

Comments
 (0)