Skip to content

Commit

Permalink
Debug filer tests
Browse files Browse the repository at this point in the history
  • Loading branch information
shreyas-goenka committed Dec 5, 2024
1 parent 0ad790e commit ea3dcc5
Show file tree
Hide file tree
Showing 45 changed files with 148 additions and 148 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ Internal:
* Remove unused `IS_OWNER` constant ([#1823](https://github.com/databricks/cli/pull/1823)).
* Assert SDK version is consistent in the CLI generation process ([#1814](https://github.com/databricks/cli/pull/1814)).
* Fixed unmarshalling json input into `interface{}` type ([#1832](https://github.com/databricks/cli/pull/1832)).
* Fix `TestAccFsMkdirWhenFileExistsAtPath` in isolated Azure environments ([#1833](https://github.com/databricks/cli/pull/1833)).
* Fix `TestFsMkdirWhenFileExistsAtPath` in isolated Azure environments ([#1833](https://github.com/databricks/cli/pull/1833)).
* Add behavioral tests for examples from the YAML spec ([#1835](https://github.com/databricks/cli/pull/1835)).
* Remove Terraform conversion function that's no longer used ([#1840](https://github.com/databricks/cli/pull/1840)).
* Encode assumptions about the dashboards API in a test ([#1839](https://github.com/databricks/cli/pull/1839)).
Expand Down Expand Up @@ -1680,7 +1680,7 @@ Internal:
* Remove dependency on global state for the root command ([#606](https://github.com/databricks/cli/pull/606)).
* Add merge_group trigger for build ([#612](https://github.com/databricks/cli/pull/612)).
* Added support for build command chaining and error on missing wheel ([#607](https://github.com/databricks/cli/pull/607)).
* Add TestAcc prefix to filer test and fix any failing tests ([#611](https://github.com/databricks/cli/pull/611)).
* Add Test prefix to filer test and fix any failing tests ([#611](https://github.com/databricks/cli/pull/611)).
* Add url parse helper function for templates ([#600](https://github.com/databricks/cli/pull/600)).
* Remove dependency on global state for remaining commands ([#613](https://github.com/databricks/cli/pull/613)).
* Update CHANGELOG template ([#588](https://github.com/databricks/cli/pull/588)).
Expand Down
2 changes: 1 addition & 1 deletion cmd/root/auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func expectReturns(t *testing.T, fn promptFn, config *config.Config) {
require.NotNil(t, client)
}

func TestAccountClientOrPrompt(t *testing.T) {
func TestountClientOrPrompt(t *testing.T) {
testutil.CleanupEnvironment(t)

dir := t.TempDir()
Expand Down
2 changes: 1 addition & 1 deletion internal/alerts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/stretchr/testify/assert"
)

func TestAccAlertsCreateErrWhenNoArguments(t *testing.T) {
func TestAlertsCreateErrWhenNoArguments(t *testing.T) {
t.Log(GetEnvOrSkipTest(t, "CLOUD_ENV"))

_, _, err := RequireErrorRun(t, "alerts-legacy", "create")
Expand Down
4 changes: 2 additions & 2 deletions internal/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
_ "github.com/databricks/cli/cmd/api"
)

func TestAccApiGet(t *testing.T) {
func TestApiGet(t *testing.T) {
t.Log(GetEnvOrSkipTest(t, "CLOUD_ENV"))

stdout, _ := RequireSuccessfulRun(t, "api", "get", "/api/2.0/preview/scim/v2/Me")
Expand All @@ -27,7 +27,7 @@ func TestAccApiGet(t *testing.T) {
assert.NotNil(t, out["id"])
}

func TestAccApiPost(t *testing.T) {
func TestApiPost(t *testing.T) {
env := GetEnvOrSkipTest(t, "CLOUD_ENV")
t.Log(env)
if env == "gcp" {
Expand Down
10 changes: 5 additions & 5 deletions internal/bundle/artifacts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func touchEmptyFile(t *testing.T, path string) {
f.Close()
}

func TestAccUploadArtifactFileToCorrectRemotePath(t *testing.T) {
func TestUploadArtifactFileToCorrectRemotePath(t *testing.T) {
ctx, wt := acc.WorkspaceTest(t)
w := wt.W
dir := t.TempDir()
Expand Down Expand Up @@ -95,7 +95,7 @@ func TestAccUploadArtifactFileToCorrectRemotePath(t *testing.T) {
)
}

func TestAccUploadArtifactFileToCorrectRemotePathWithEnvironments(t *testing.T) {
func TestUploadArtifactFileToCorrectRemotePathWithEnvironments(t *testing.T) {
ctx, wt := acc.WorkspaceTest(t)
w := wt.W
dir := t.TempDir()
Expand Down Expand Up @@ -160,7 +160,7 @@ func TestAccUploadArtifactFileToCorrectRemotePathWithEnvironments(t *testing.T)
)
}

func TestAccUploadArtifactFileToCorrectRemotePathForVolumes(t *testing.T) {
func TestUploadArtifactFileToCorrectRemotePathForVolumes(t *testing.T) {
ctx, wt := acc.WorkspaceTest(t)
w := wt.W

Expand Down Expand Up @@ -230,7 +230,7 @@ func TestAccUploadArtifactFileToCorrectRemotePathForVolumes(t *testing.T) {
)
}

func TestAccUploadArtifactFileToVolumeThatDoesNotExist(t *testing.T) {
func TestUploadArtifactFileToVolumeThatDoesNotExist(t *testing.T) {
ctx, wt := acc.UcWorkspaceTest(t)
w := wt.W

Expand Down Expand Up @@ -267,7 +267,7 @@ func TestAccUploadArtifactFileToVolumeThatDoesNotExist(t *testing.T) {
assert.Equal(t, "", stderr.String())
}

func TestAccUploadArtifactToVolumeNotYetDeployed(t *testing.T) {
func TestUploadArtifactToVolumeNotYetDeployed(t *testing.T) {
ctx, wt := acc.UcWorkspaceTest(t)
w := wt.W

Expand Down
2 changes: 1 addition & 1 deletion internal/bundle/basic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/stretchr/testify/require"
)

func TestAccBasicBundleDeployWithFailOnActiveRuns(t *testing.T) {
func TestBasicBundleDeployWithFailOnActiveRuns(t *testing.T) {
ctx, _ := acc.WorkspaceTest(t)

nodeTypeId := internal.GetNodeTypeId(env.Get(ctx, "CLOUD_ENV"))
Expand Down
6 changes: 3 additions & 3 deletions internal/bundle/bind_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"github.com/stretchr/testify/require"
)

func TestAccBindJobToExistingJob(t *testing.T) {
func TestBindJobToExistingJob(t *testing.T) {
env := internal.GetEnvOrSkipTest(t, "CLOUD_ENV")
t.Log(env)

Expand Down Expand Up @@ -80,7 +80,7 @@ func TestAccBindJobToExistingJob(t *testing.T) {
require.Contains(t, job.Settings.Tasks[0].SparkPythonTask.PythonFile, "hello_world.py")
}

func TestAccAbortBind(t *testing.T) {
func TestAbortBind(t *testing.T) {
env := internal.GetEnvOrSkipTest(t, "CLOUD_ENV")
t.Log(env)

Expand Down Expand Up @@ -128,7 +128,7 @@ func TestAccAbortBind(t *testing.T) {
require.Contains(t, job.Settings.Tasks[0].NotebookTask.NotebookPath, "test")
}

func TestAccGenerateAndBind(t *testing.T) {
func TestGenerateAndBind(t *testing.T) {
env := internal.GetEnvOrSkipTest(t, "CLOUD_ENV")
t.Log(env)

Expand Down
2 changes: 1 addition & 1 deletion internal/bundle/clusters_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"github.com/stretchr/testify/require"
)

func TestAccDeployBundleWithCluster(t *testing.T) {
func TestDeployBundleWithCluster(t *testing.T) {
ctx, wt := acc.WorkspaceTest(t)

if testutil.IsAWSCloud(wt.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/bundle/dashboards_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/stretchr/testify/require"
)

func TestAccDashboards(t *testing.T) {
func TestDashboards(t *testing.T) {
ctx, wt := acc.WorkspaceTest(t)

warehouseID := acc.GetEnvOrSkipTest(t, "TEST_DEFAULT_WAREHOUSE_ID")
Expand Down
12 changes: 6 additions & 6 deletions internal/bundle/deploy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func setupUcSchemaBundle(t *testing.T, ctx context.Context, w *databricks.Worksp
return bundleRoot
}

func TestAccBundleDeployUcSchema(t *testing.T) {
func TestBundleDeployUcSchema(t *testing.T) {
ctx, wt := acc.UcWorkspaceTest(t)
w := wt.W

Expand All @@ -105,7 +105,7 @@ func TestAccBundleDeployUcSchema(t *testing.T) {
assert.Equal(t, "SCHEMA_DOES_NOT_EXIST", apiErr.ErrorCode)
}

func TestAccBundleDeployUcSchemaFailsWithoutAutoApprove(t *testing.T) {
func TestBundleDeployUcSchemaFailsWithoutAutoApprove(t *testing.T) {
ctx, wt := acc.UcWorkspaceTest(t)
w := wt.W

Expand All @@ -127,7 +127,7 @@ func TestAccBundleDeployUcSchemaFailsWithoutAutoApprove(t *testing.T) {
assert.Contains(t, stdout.String(), "the deployment requires destructive actions, but current console does not support prompting. Please specify --auto-approve if you would like to skip prompts and proceed")
}

func TestAccBundlePipelineDeleteWithoutAutoApprove(t *testing.T) {
func TestBundlePipelineDeleteWithoutAutoApprove(t *testing.T) {
ctx, wt := acc.WorkspaceTest(t)
w := wt.W

Expand Down Expand Up @@ -176,7 +176,7 @@ properties such as the 'catalog' or 'storage' are changed:

}

func TestAccBundlePipelineRecreateWithoutAutoApprove(t *testing.T) {
func TestBundlePipelineRecreateWithoutAutoApprove(t *testing.T) {
ctx, wt := acc.UcWorkspaceTest(t)
w := wt.W
uniqueId := uuid.New().String()
Expand Down Expand Up @@ -214,7 +214,7 @@ properties such as the 'catalog' or 'storage' are changed:
assert.Contains(t, stdout.String(), "the deployment requires destructive actions, but current console does not support prompting. Please specify --auto-approve if you would like to skip prompts and proceed")
}

func TestAccDeployBasicBundleLogs(t *testing.T) {
func TestDeployBasicBundleLogs(t *testing.T) {
ctx, wt := acc.WorkspaceTest(t)

nodeTypeId := internal.GetNodeTypeId(env.Get(ctx, "CLOUD_ENV"))
Expand Down Expand Up @@ -244,7 +244,7 @@ func TestAccDeployBasicBundleLogs(t *testing.T) {
assert.Equal(t, "", stdout)
}

func TestAccDeployUcVolume(t *testing.T) {
func TestDeployUcVolume(t *testing.T) {
ctx, wt := acc.UcWorkspaceTest(t)
w := wt.W

Expand Down
2 changes: 1 addition & 1 deletion internal/bundle/deploy_then_remove_resources_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"github.com/stretchr/testify/require"
)

func TestAccBundleDeployThenRemoveResources(t *testing.T) {
func TestBundleDeployThenRemoveResources(t *testing.T) {
ctx, wt := acc.WorkspaceTest(t)
w := wt.W

Expand Down
2 changes: 1 addition & 1 deletion internal/bundle/deploy_to_shared_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/stretchr/testify/require"
)

func TestAccDeployBasicToSharedWorkspacePath(t *testing.T) {
func TestDeployBasicToSharedWorkspacePath(t *testing.T) {
ctx, wt := acc.WorkspaceTest(t)

nodeTypeId := internal.GetNodeTypeId(env.Get(ctx, "CLOUD_ENV"))
Expand Down
2 changes: 1 addition & 1 deletion internal/bundle/deployment_state_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"github.com/stretchr/testify/require"
)

func TestAccFilesAreSyncedCorrectlyWhenNoSnapshot(t *testing.T) {
func TestFilesAreSyncedCorrectlyWhenNoSnapshot(t *testing.T) {
env := internal.GetEnvOrSkipTest(t, "CLOUD_ENV")
t.Log(env)

Expand Down
2 changes: 1 addition & 1 deletion internal/bundle/destroy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"github.com/stretchr/testify/require"
)

func TestAccBundleDestroy(t *testing.T) {
func TestBundleDestroy(t *testing.T) {
ctx, wt := acc.WorkspaceTest(t)
w := wt.W

Expand Down
2 changes: 1 addition & 1 deletion internal/bundle/empty_bundle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/stretchr/testify/require"
)

func TestAccEmptyBundleDeploy(t *testing.T) {
func TestEmptyBundleDeploy(t *testing.T) {
ctx, _ := acc.WorkspaceTest(t)

// create empty bundle
Expand Down
2 changes: 1 addition & 1 deletion internal/bundle/environments_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/stretchr/testify/require"
)

func TestAccPythonWheelTaskWithEnvironmentsDeployAndRun(t *testing.T) {
func TestPythonWheelTaskWithEnvironmentsDeployAndRun(t *testing.T) {
t.Skip("Skipping test until serveless is enabled")

ctx, _ := acc.WorkspaceTest(t)
Expand Down
2 changes: 1 addition & 1 deletion internal/bundle/generate_job_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"github.com/stretchr/testify/require"
)

func TestAccGenerateFromExistingJobAndDeploy(t *testing.T) {
func TestGenerateFromExistingJobAndDeploy(t *testing.T) {
ctx, wt := acc.WorkspaceTest(t)
gt := &generateJobTest{T: t, w: wt.W}

Expand Down
2 changes: 1 addition & 1 deletion internal/bundle/generate_pipeline_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"github.com/stretchr/testify/require"
)

func TestAccGenerateFromExistingPipelineAndDeploy(t *testing.T) {
func TestGenerateFromExistingPipelineAndDeploy(t *testing.T) {
ctx, wt := acc.WorkspaceTest(t)
gt := &generatePipelineTest{T: t, w: wt.W}

Expand Down
2 changes: 1 addition & 1 deletion internal/bundle/job_metadata_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"github.com/stretchr/testify/require"
)

func TestAccJobsMetadataFile(t *testing.T) {
func TestJobsMetadataFile(t *testing.T) {
ctx, wt := acc.WorkspaceTest(t)
w := wt.W

Expand Down
2 changes: 1 addition & 1 deletion internal/bundle/local_state_staleness_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"github.com/stretchr/testify/require"
)

func TestAccLocalStateStaleness(t *testing.T) {
func TestLocalStateStaleness(t *testing.T) {
ctx, wt := acc.WorkspaceTest(t)
w := wt.W

Expand Down
6 changes: 3 additions & 3 deletions internal/bundle/python_wheel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ func runPythonWheelTest(t *testing.T, templateName string, sparkVersion string,
require.Contains(t, out, "['my_test_code', 'param1', 'param2']")
}

func TestAccPythonWheelTaskDeployAndRunWithoutWrapper(t *testing.T) {
func TestPythonWheelTaskDeployAndRunWithoutWrapper(t *testing.T) {
runPythonWheelTest(t, "python_wheel_task", "13.3.x-snapshot-scala2.12", false)
}

func TestAccPythonWheelTaskDeployAndRunWithWrapper(t *testing.T) {
func TestPythonWheelTaskDeployAndRunWithWrapper(t *testing.T) {
runPythonWheelTest(t, "python_wheel_task", "12.2.x-scala2.12", true)
}

func TestAccPythonWheelTaskDeployAndRunOnInteractiveCluster(t *testing.T) {
func TestPythonWheelTaskDeployAndRunOnInteractiveCluster(t *testing.T) {
_, wt := acc.WorkspaceTest(t)

if testutil.IsAWSCloud(wt.T) {
Expand Down
4 changes: 2 additions & 2 deletions internal/bundle/spark_jar_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func runSparkJarTestFromWorkspace(t *testing.T, sparkVersion string) {
runSparkJarTestCommon(t, ctx, sparkVersion, "n/a")
}

func TestAccSparkJarTaskDeployAndRunOnVolumes(t *testing.T) {
func TestSparkJarTaskDeployAndRunOnVolumes(t *testing.T) {
internal.GetEnvOrSkipTest(t, "CLOUD_ENV")
testutil.RequireJDK(t, context.Background(), "1.8.0")

Expand All @@ -76,7 +76,7 @@ func TestAccSparkJarTaskDeployAndRunOnVolumes(t *testing.T) {
}
}

func TestAccSparkJarTaskDeployAndRunOnWorkspace(t *testing.T) {
func TestSparkJarTaskDeployAndRunOnWorkspace(t *testing.T) {
internal.GetEnvOrSkipTest(t, "CLOUD_ENV")
testutil.RequireJDK(t, context.Background(), "1.8.0")

Expand Down
2 changes: 1 addition & 1 deletion internal/bundle/validate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/stretchr/testify/require"
)

func TestAccBundleValidate(t *testing.T) {
func TestBundleValidate(t *testing.T) {
testutil.GetEnvOrSkipTest(t, "CLOUD_ENV")

tmpDir := t.TempDir()
Expand Down
4 changes: 2 additions & 2 deletions internal/clusters_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

var clusterId string

func TestAccClustersList(t *testing.T) {
func TestClustersList(t *testing.T) {
t.Log(GetEnvOrSkipTest(t, "CLOUD_ENV"))

stdout, stderr := RequireSuccessfulRun(t, "clusters", "list")
Expand All @@ -25,7 +25,7 @@ func TestAccClustersList(t *testing.T) {
assert.NotEmpty(t, clusterId)
}

func TestAccClustersGet(t *testing.T) {
func TestClustersGet(t *testing.T) {
t.Log(GetEnvOrSkipTest(t, "CLOUD_ENV"))

stdout, stderr := RequireSuccessfulRun(t, "clusters", "get", clusterId)
Expand Down
2 changes: 1 addition & 1 deletion internal/completer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func setupCompletionFile(t *testing.T, f filer.Filer) {
require.NoError(t, err)
}

func TestAccFsCompletion(t *testing.T) {
func TestFsCompletion(t *testing.T) {
f, tmpDir := setupDbfsFiler(t)
setupCompletionFile(t, f)

Expand Down
2 changes: 1 addition & 1 deletion internal/dashboard_assumptions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (

// Verify that importing a dashboard through the Workspace API retains the identity of the underying resource,
// as well as properties exclusively accessible through the dashboards API.
func TestAccDashboardAssumptions_WorkspaceImport(t *testing.T) {
func TestDashboardAssumptions_WorkspaceImport(t *testing.T) {
ctx, wt := acc.WorkspaceTest(t)

t.Parallel()
Expand Down
Loading

0 comments on commit ea3dcc5

Please sign in to comment.