From 509f5aba6ad74765e97e87adf34694967da119f6 Mon Sep 17 00:00:00 2001 From: shreyas-goenka <88374338+shreyas-goenka@users.noreply.github.com> Date: Thu, 2 Jan 2025 17:09:11 +0530 Subject: [PATCH] Snooze mlops-stacks integration test (#2063) ## Changes https://github.com/databricks/mlops-stacks/pull/187 broke mlops-stacks deployments for non-UC projects. Snoozing the test until upstream is fixed. ## Tests The test is skipped on my local machine. CI run will verify it's also skipped on Github Actions runners. --- integration/bundle/init_test.go | 2 ++ internal/testutil/helpers.go | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/integration/bundle/init_test.go b/integration/bundle/init_test.go index f5c263ca3..bc81cd3a8 100644 --- a/integration/bundle/init_test.go +++ b/integration/bundle/init_test.go @@ -39,6 +39,8 @@ func TestBundleInitErrorOnUnknownFields(t *testing.T) { // make changes that can break the MLOps Stacks DAB. In which case we should // skip this test until the MLOps Stacks DAB is updated to work again. func TestBundleInitOnMlopsStacks(t *testing.T) { + testutil.SkipUntil(t, "2025-01-09") + ctx, wt := acc.WorkspaceTest(t) w := wt.W diff --git a/internal/testutil/helpers.go b/internal/testutil/helpers.go index 019a8e618..44c2c9375 100644 --- a/internal/testutil/helpers.go +++ b/internal/testutil/helpers.go @@ -5,6 +5,9 @@ import ( "math/rand" "os" "strings" + "time" + + "github.com/stretchr/testify/require" ) // GetEnvOrSkipTest proceeds with test only with that env variable. @@ -30,3 +33,12 @@ func RandomName(prefix ...string) string { } return string(b) } + +func SkipUntil(t TestingT, date string) { + deadline, err := time.Parse(time.DateOnly, date) + require.NoError(t, err) + + if time.Now().Before(deadline) { + t.Skipf("Skipping test until %s. Time right now: %s", deadline.Format(time.DateOnly), time.Now()) + } +}