From 561bd84d519edffc047e16062191204cd3b1c8d9 Mon Sep 17 00:00:00 2001 From: Andrew Nester Date: Wed, 26 Jul 2023 10:26:26 +0200 Subject: [PATCH 1/3] Fixed python wheel test --- bundle/tests/bundle/python_wheel/bundle.yml | 2 +- bundle/tests/bundle/wheel_test.go | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/bundle/tests/bundle/python_wheel/bundle.yml b/bundle/tests/bundle/python_wheel/bundle.yml index 9c518589df7..b3a793a63d5 100644 --- a/bundle/tests/bundle/python_wheel/bundle.yml +++ b/bundle/tests/bundle/python_wheel/bundle.yml @@ -5,7 +5,7 @@ artifacts: my_test_code: type: whl path: "./my_test_code" - build: "/usr/local/bin/python setup.py bdist_wheel" + build: "python setup.py bdist_wheel" resources: jobs: diff --git a/bundle/tests/bundle/wheel_test.go b/bundle/tests/bundle/wheel_test.go index 9a6b2fd2cb3..f30ed2aafde 100644 --- a/bundle/tests/bundle/wheel_test.go +++ b/bundle/tests/bundle/wheel_test.go @@ -7,13 +7,10 @@ import ( "github.com/databricks/cli/bundle" "github.com/databricks/cli/bundle/phases" - "github.com/databricks/cli/internal" "github.com/stretchr/testify/require" ) -func TestAccBundlePythonWheelBuild(t *testing.T) { - t.Log(internal.GetEnvOrSkipTest(t, "CLOUD_ENV")) - +func TestBundlePythonWheelBuild(t *testing.T) { b, err := bundle.Load("./python_wheel") require.NoError(t, err) From cb11f0451b93531e9732c63f8cf4093ace1a2bd5 Mon Sep 17 00:00:00 2001 From: Andrew Nester Date: Wed, 26 Jul 2023 10:31:40 +0200 Subject: [PATCH 2/3] use glob --- bundle/tests/bundle/wheel_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bundle/tests/bundle/wheel_test.go b/bundle/tests/bundle/wheel_test.go index f30ed2aafde..5b786185b48 100644 --- a/bundle/tests/bundle/wheel_test.go +++ b/bundle/tests/bundle/wheel_test.go @@ -2,7 +2,7 @@ package bundle import ( "context" - "os" + "path/filepath" "testing" "github.com/databricks/cli/bundle" @@ -18,6 +18,7 @@ func TestBundlePythonWheelBuild(t *testing.T) { err = m.Apply(context.Background(), b) require.NoError(t, err) - _, err = os.Stat("./python_wheel/my_test_code/dist/my_test_code-0.0.1-py2-none-any.whl") + matches, err := filepath.Glob("python_wheel/my_test_code/dist/my_test_code-*.whl") require.NoError(t, err) + require.Equal(t, 1, len(matches)) } From b56914b09c35879bcf2e5dcd6415fbd3c86c3b30 Mon Sep 17 00:00:00 2001 From: Andrew Nester Date: Wed, 26 Jul 2023 10:42:52 +0200 Subject: [PATCH 3/3] install wheel --- .github/workflows/push.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 7e1bc2437a8..2406ed71f26 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -39,7 +39,9 @@ jobs: go install honnef.co/go/tools/cmd/staticcheck@latest - name: Pull external libraries - run: make vendor + run: | + make vendor + pip install wheel - name: Run tests run: make test