From 5f29b5ecd94ead7c5feecf2066852635141e2559 Mon Sep 17 00:00:00 2001 From: shreyas-goenka <88374338+shreyas-goenka@users.noreply.github.com> Date: Wed, 13 Mar 2024 18:29:49 +0530 Subject: [PATCH] Fix TestAccBundleInitOnMlopsStacks to work on aws-prod-ucws (#1283) ## Changes aws-prod-ucws has CLOUD_ENV set to "ucws" which was failing the validation checks in the template itself. This PR fixes the test. ## Tests The tests pass now --- internal/init_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/init_test.go b/internal/init_test.go index 45e6d031..bed1119f 100644 --- a/internal/init_test.go +++ b/internal/init_test.go @@ -7,6 +7,7 @@ import ( "os" "path/filepath" "strconv" + "strings" "testing" "github.com/databricks/cli/bundle/config" @@ -39,7 +40,8 @@ func TestAccBundleInitErrorOnUnknownFields(t *testing.T) { // skip this test until the MLOps Stacks DAB is updated to work again. func TestAccBundleInitOnMlopsStacks(t *testing.T) { t.Parallel() - env := GetEnvOrSkipTest(t, "CLOUD_ENV") + env := testutil.GetCloud(t).String() + tmpDir1 := t.TempDir() tmpDir2 := t.TempDir() @@ -53,7 +55,7 @@ func TestAccBundleInitOnMlopsStacks(t *testing.T) { "input_project_name": projectName, "input_root_dir": "repo_name", "input_include_models_in_unity_catalog": "no", - "input_cloud": env, + "input_cloud": strings.ToLower(env), } b, err := json.Marshal(initConfig) require.NoError(t, err)