-
Notifications
You must be signed in to change notification settings - Fork 125
Move integration tests to integration package
#2009
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
6e93dc1
Add test to confirm integration tests use build tags
pietern 65184fd
Build tag
pietern e236c8a
Move fs integration tests
pietern b1d4197
Assert on first line
pietern 0aeca5d
Move more tests
pietern dfd0bd0
Add build tags and package names
pietern 5196a53
Fix up missing helper
pietern 0df9154
Move bundle integration tests
pietern 2fd75ec
Remove unused functions
pietern b7fb0ab
Move remaining integration tests
pietern 23b15f7
Use build tag in Make target
pietern b8a34de
Add brief README about integration tests
pietern f687f3b
Mention requirement enforcement
pietern d750053
Skip auth describe failure test
pietern db905cc
Remove build tags
pietern 99f8413
Add TestMain to every integration test package
pietern d7b534a
Remove build tag from lint configuration
pietern d9e15ed
Remove build tag from Makefile target
pietern b4e4dc2
Don't export the deprecated ast.Package type
pietern 7638981
Revert vscode settings
pietern b3b6537
Update README
pietern 3b5c252
Update package name requirement
pietern faccf3c
Rename helper files
pietern da2d3fd
Skip auth describe success test
pietern File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| # Integration tests | ||
|
|
||
| This directory contains integration tests for the project. | ||
|
|
||
| The tree structure generally mirrors the source code tree structure. | ||
|
|
||
| Requirements for new files in this directory: | ||
| * Every package **must** be named after its directory with `_test` appended | ||
| * Requiring a different package name for integration tests avoids aliasing with the main package. | ||
| * Every integration test package **must** include a `main_test.go` file. | ||
|
|
||
| These requirements are enforced by a unit test in this directory. | ||
|
|
||
| ## Running integration tests | ||
|
|
||
| Integration tests require the following environment variables: | ||
| * `CLOUD_ENV` - set to the cloud environment to use (e.g. `aws`, `azure`, `gcp`) | ||
pietern marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| * `DATABRICKS_HOST` - set to the Databricks workspace to use | ||
| * `DATABRICKS_TOKEN` - set to the Databricks token to use | ||
|
|
||
| Optional environment variables: | ||
| * `TEST_DEFAULT_WAREHOUSE_ID` - set to the default warehouse ID to use | ||
| * `TEST_METASTORE_ID` - set to the metastore ID to use | ||
| * `TEST_INSTANCE_POOL_ID` - set to the instance pool ID to use | ||
| * `TEST_BRICKS_CLUSTER_ID` - set to the cluster ID to use | ||
|
|
||
| To run all integration tests, use the following command: | ||
|
|
||
| ```bash | ||
| go test ./integration/... | ||
| ``` | ||
|
|
||
| Alternatively: | ||
|
|
||
| ```bash | ||
| make integration | ||
| ``` | ||
2 changes: 1 addition & 1 deletion
2
internal/dashboard_assumptions_test.go → ...assumptions/dashboard_assumptions_test.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| package internal | ||
| package assumptions_test | ||
|
|
||
| import ( | ||
| "encoding/base64" | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| package assumptions_test | ||
|
|
||
| import ( | ||
| "testing" | ||
|
|
||
| "github.com/databricks/cli/integration/internal" | ||
| ) | ||
|
|
||
| // TestMain is the entrypoint executed by the test runner. | ||
| // See [internal.Main] for prerequisites for running integration tests. | ||
| func TestMain(m *testing.M) { | ||
| internal.Main(m) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @pietern we might want to re-think this - it turns out having TestMain disables go test's built-in caching, which could be useful in speeding up test runs both locally and on CI. |
||
| } | ||
2 changes: 1 addition & 1 deletion
2
internal/bundle/artifacts_test.go → integration/bundle/artifacts_test.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| package bundle | ||
| package bundle_test | ||
|
|
||
| import ( | ||
| "fmt" | ||
|
|
||
2 changes: 1 addition & 1 deletion
2
internal/bundle/basic_test.go → integration/bundle/basic_test.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| package bundle | ||
| package bundle_test | ||
|
|
||
| import ( | ||
| "os" | ||
|
|
||
2 changes: 1 addition & 1 deletion
2
internal/bundle/bind_resource_test.go → integration/bundle/bind_resource_test.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| package bundle | ||
| package bundle_test | ||
|
|
||
| import ( | ||
| "fmt" | ||
|
|
||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
internal/bundle/clusters_test.go → integration/bundle/clusters_test.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| package bundle | ||
| package bundle_test | ||
|
|
||
| import ( | ||
| "fmt" | ||
|
|
||
2 changes: 1 addition & 1 deletion
2
internal/bundle/dashboards_test.go → integration/bundle/dashboards_test.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| package bundle | ||
| package bundle_test | ||
|
|
||
| import ( | ||
| "fmt" | ||
|
|
||
2 changes: 1 addition & 1 deletion
2
internal/bundle/deploy_test.go → integration/bundle/deploy_test.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| package bundle | ||
| package bundle_test | ||
|
|
||
| import ( | ||
| "context" | ||
|
|
||
2 changes: 1 addition & 1 deletion
2
...ndle/deploy_then_remove_resources_test.go → ...ndle/deploy_then_remove_resources_test.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| package bundle | ||
| package bundle_test | ||
|
|
||
| import ( | ||
| "os" | ||
|
|
||
2 changes: 1 addition & 1 deletion
2
internal/bundle/deploy_to_shared_test.go → integration/bundle/deploy_to_shared_test.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| package bundle | ||
| package bundle_test | ||
|
|
||
| import ( | ||
| "fmt" | ||
|
|
||
2 changes: 1 addition & 1 deletion
2
internal/bundle/deployment_state_test.go → integration/bundle/deployment_state_test.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| package bundle | ||
| package bundle_test | ||
|
|
||
| import ( | ||
| "os" | ||
|
|
||
2 changes: 1 addition & 1 deletion
2
internal/bundle/destroy_test.go → integration/bundle/destroy_test.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| package bundle | ||
| package bundle_test | ||
|
|
||
| import ( | ||
| "errors" | ||
|
|
||
2 changes: 1 addition & 1 deletion
2
internal/bundle/empty_bundle_test.go → integration/bundle/empty_bundle_test.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| package bundle | ||
| package bundle_test | ||
|
|
||
| import ( | ||
| "fmt" | ||
|
|
||
2 changes: 1 addition & 1 deletion
2
internal/bundle/environments_test.go → integration/bundle/environments_test.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| package bundle | ||
| package bundle_test | ||
|
|
||
| import ( | ||
| "testing" | ||
|
|
||
2 changes: 1 addition & 1 deletion
2
internal/bundle/generate_job_test.go → integration/bundle/generate_job_test.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| package bundle | ||
| package bundle_test | ||
|
|
||
| import ( | ||
| "context" | ||
|
|
||
2 changes: 1 addition & 1 deletion
2
internal/bundle/generate_pipeline_test.go → integration/bundle/generate_pipeline_test.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| package bundle | ||
| package bundle_test | ||
|
|
||
| import ( | ||
| "context" | ||
|
|
||
2 changes: 1 addition & 1 deletion
2
internal/bundle/helpers.go → integration/bundle/helpers_test.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| package bundle | ||
| package bundle_test | ||
|
|
||
| import ( | ||
| "bytes" | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
internal/bundle/job_metadata_test.go → integration/bundle/job_metadata_test.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| package bundle | ||
| package bundle_test | ||
|
|
||
| import ( | ||
| "context" | ||
|
|
||
2 changes: 1 addition & 1 deletion
2
...rnal/bundle/local_state_staleness_test.go → ...tion/bundle/local_state_staleness_test.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| package bundle | ||
| package bundle_test | ||
|
|
||
| import ( | ||
| "context" | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| package bundle_test | ||
|
|
||
| import ( | ||
| "testing" | ||
|
|
||
| "github.com/databricks/cli/integration/internal" | ||
| ) | ||
|
|
||
| // TestMain is the entrypoint executed by the test runner. | ||
| // See [internal.Main] for prerequisites for running integration tests. | ||
| func TestMain(m *testing.M) { | ||
| internal.Main(m) | ||
| } |
2 changes: 1 addition & 1 deletion
2
internal/bundle/python_wheel_test.go → integration/bundle/python_wheel_test.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| package bundle | ||
| package bundle_test | ||
|
|
||
| import ( | ||
| "testing" | ||
|
|
||
2 changes: 1 addition & 1 deletion
2
internal/bundle/spark_jar_test.go → integration/bundle/spark_jar_test.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| package bundle | ||
| package bundle_test | ||
|
|
||
| import ( | ||
| "context" | ||
|
|
||
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
internal/bundle/validate_test.go → integration/bundle/validate_test.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| package bundle | ||
| package bundle_test | ||
|
|
||
| import ( | ||
| "context" | ||
|
|
||
2 changes: 1 addition & 1 deletion
2
internal/alerts_test.go → integration/cmd/alerts/alerts_test.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| package internal | ||
| package alerts_test | ||
|
|
||
| import ( | ||
| "testing" | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| package alerts_test | ||
|
|
||
| import ( | ||
| "testing" | ||
|
|
||
| "github.com/databricks/cli/integration/internal" | ||
| ) | ||
|
|
||
| // TestMain is the entrypoint executed by the test runner. | ||
| // See [internal.Main] for prerequisites for running integration tests. | ||
| func TestMain(m *testing.M) { | ||
| internal.Main(m) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| package internal | ||
| package api_test | ||
|
|
||
| import ( | ||
| "encoding/json" | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| package api_test | ||
|
|
||
| import ( | ||
| "testing" | ||
|
|
||
| "github.com/databricks/cli/integration/internal" | ||
| ) | ||
|
|
||
| // TestMain is the entrypoint executed by the test runner. | ||
| // See [internal.Main] for prerequisites for running integration tests. | ||
| func TestMain(m *testing.M) { | ||
| internal.Main(m) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| package auth_test | ||
|
|
||
| import ( | ||
| "testing" | ||
|
|
||
| "github.com/databricks/cli/integration/internal" | ||
| ) | ||
|
|
||
| // TestMain is the entrypoint executed by the test runner. | ||
| // See [internal.Main] for prerequisites for running integration tests. | ||
| func TestMain(m *testing.M) { | ||
| internal.Main(m) | ||
| } |
2 changes: 1 addition & 1 deletion
2
internal/clusters_test.go → integration/cmd/clusters/clusters_test.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| package internal | ||
| package clusters_test | ||
|
|
||
| import ( | ||
| "fmt" | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| package clusters_test | ||
|
|
||
| import ( | ||
| "testing" | ||
|
|
||
| "github.com/databricks/cli/integration/internal" | ||
| ) | ||
|
|
||
| // TestMain is the entrypoint executed by the test runner. | ||
| // See [internal.Main] for prerequisites for running integration tests. | ||
| func TestMain(m *testing.M) { | ||
| internal.Main(m) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| package internal | ||
| package fs_test | ||
|
|
||
| import ( | ||
| "context" | ||
|
|
||
2 changes: 1 addition & 1 deletion
2
internal/completer_test.go → integration/cmd/fs/completion_test.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| package internal | ||
| package fs_test | ||
|
|
||
| import ( | ||
| "context" | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| package internal | ||
| package fs_test | ||
|
|
||
| import ( | ||
| "context" | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| package fs_test | ||
|
|
||
| import ( | ||
| "os" | ||
| "path" | ||
| "path/filepath" | ||
|
|
||
| "github.com/databricks/cli/internal/acc" | ||
| "github.com/databricks/cli/internal/testutil" | ||
|
|
||
| "github.com/databricks/cli/libs/filer" | ||
| "github.com/stretchr/testify/require" | ||
| ) | ||
|
|
||
| func setupLocalFiler(t testutil.TestingT) (filer.Filer, string) { | ||
| t.Log(testutil.GetEnvOrSkipTest(t, "CLOUD_ENV")) | ||
|
|
||
| tmp := t.TempDir() | ||
| f, err := filer.NewLocalClient(tmp) | ||
| require.NoError(t, err) | ||
|
|
||
| return f, path.Join(filepath.ToSlash(tmp)) | ||
| } | ||
|
|
||
| func setupDbfsFiler(t testutil.TestingT) (filer.Filer, string) { | ||
| _, wt := acc.WorkspaceTest(t) | ||
|
|
||
| tmpdir := acc.TemporaryDbfsDir(wt) | ||
| f, err := filer.NewDbfsClient(wt.W, tmpdir) | ||
| require.NoError(t, err) | ||
| return f, path.Join("dbfs:/", tmpdir) | ||
| } | ||
|
|
||
| func setupUcVolumesFiler(t testutil.TestingT) (filer.Filer, string) { | ||
| _, wt := acc.WorkspaceTest(t) | ||
|
|
||
| if os.Getenv("TEST_METASTORE_ID") == "" { | ||
| t.Skip("Skipping tests that require a UC Volume when metastore id is not set.") | ||
| } | ||
|
|
||
| tmpdir := acc.TemporaryVolume(wt) | ||
| f, err := filer.NewFilesClient(wt.W, tmpdir) | ||
| require.NoError(t, err) | ||
|
|
||
| return f, path.Join("dbfs:/", tmpdir) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| package internal | ||
| package fs_test | ||
|
|
||
| import ( | ||
| "context" | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.