Skip to content

Commit

Permalink
Move bundle tests into bundle/tests (#1299)
Browse files Browse the repository at this point in the history
## Changes

These tests were located in `bundle/tests/bundle` which meant they were
unable to reuse the helper functions defined in the `bundle/tests`
package. There is no need for these tests to live outside the package.

## Tests

Existing tests pass.
  • Loading branch information
pietern authored Mar 21, 2024
1 parent 0ef93c2 commit f202596
Show file tree
Hide file tree
Showing 19 changed files with 12 additions and 38 deletions.
26 changes: 0 additions & 26 deletions bundle/tests/bundle/loader.go

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package bundle
package config_tests

import (
"context"
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package bundle
package config_tests

import (
"context"
Expand All @@ -11,16 +11,16 @@ import (
"github.com/stretchr/testify/require"
)

func TestBundlePythonWheelBuild(t *testing.T) {
func TestPythonWheelBuild(t *testing.T) {
ctx := context.Background()
b, err := bundle.Load(ctx, "./python_wheel")
b, err := bundle.Load(ctx, "./python_wheel/python_wheel")
require.NoError(t, err)

m := phases.Build()
err = bundle.Apply(ctx, b, m)
require.NoError(t, err)

matches, err := filepath.Glob("python_wheel/my_test_code/dist/my_test_code-*.whl")
matches, err := filepath.Glob("./python_wheel/python_wheel/my_test_code/dist/my_test_code-*.whl")
require.NoError(t, err)
require.Equal(t, 1, len(matches))

Expand All @@ -29,16 +29,16 @@ func TestBundlePythonWheelBuild(t *testing.T) {
require.NoError(t, err)
}

func TestBundlePythonWheelBuildAutoDetect(t *testing.T) {
func TestPythonWheelBuildAutoDetect(t *testing.T) {
ctx := context.Background()
b, err := bundle.Load(ctx, "./python_wheel_no_artifact")
b, err := bundle.Load(ctx, "./python_wheel/python_wheel_no_artifact")
require.NoError(t, err)

m := phases.Build()
err = bundle.Apply(ctx, b, m)
require.NoError(t, err)

matches, err := filepath.Glob("python_wheel/my_test_code/dist/my_test_code-*.whl")
matches, err := filepath.Glob("./python_wheel/python_wheel_no_artifact/dist/my_test_code-*.whl")
require.NoError(t, err)
require.Equal(t, 1, len(matches))

Expand All @@ -47,9 +47,9 @@ func TestBundlePythonWheelBuildAutoDetect(t *testing.T) {
require.NoError(t, err)
}

func TestBundlePythonWheelWithDBFSLib(t *testing.T) {
func TestPythonWheelWithDBFSLib(t *testing.T) {
ctx := context.Background()
b, err := bundle.Load(ctx, "./python_wheel_dbfs_lib")
b, err := bundle.Load(ctx, "./python_wheel/python_wheel_dbfs_lib")
require.NoError(t, err)

m := phases.Build()
Expand All @@ -61,9 +61,9 @@ func TestBundlePythonWheelWithDBFSLib(t *testing.T) {
require.NoError(t, err)
}

func TestBundlePythonWheelBuildNoBuildJustUpload(t *testing.T) {
func TestPythonWheelBuildNoBuildJustUpload(t *testing.T) {
ctx := context.Background()
b, err := bundle.Load(ctx, "./python_wheel_no_artifact_no_setup")
b, err := bundle.Load(ctx, "./python_wheel/python_wheel_no_artifact_no_setup")
require.NoError(t, err)

m := phases.Build()
Expand Down

0 comments on commit f202596

Please sign in to comment.