Fixed python wheel test (#608)

## Changes
Fixed python wheel test

## Tests
<!-- How is this tested? -->
This commit is contained in:
Andrew Nester 2023-07-26 11:02:17 +02:00 committed by GitHub
parent 1d21d3cfd3
commit 5e0a096722
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 8 deletions

View File

@ -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

View File

@ -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:

View File

@ -2,18 +2,15 @@ package bundle
import (
"context"
"os"
"path/filepath"
"testing"
"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)
@ -21,6 +18,7 @@ func TestAccBundlePythonWheelBuild(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))
}