databricks-cli/internal/testutil
Pieter Noordhuis ad8e61c739
Fix ability to import the CLI repository as module (#1671)
## Changes

While investigating #1629, I found that Go doesn't allow characters
outside the set documented at
https://pkg.go.dev/golang.org/x/mod/module#CheckFilePath.

To fix this, I changed the relevant test case to create the fixtures it
needs instead of loading it from the `testdata` directory (in
`renderer_test.go`).

Some test cases in `config_test.go` depended on templated paths without
needing to do so. In the process of fixing this, I refactored these
tests slightly to reduce dependencies between them.

This change also adds a test case to ensure that all files in the
repository are allowed to be part of a module (per the earlier
`CheckFilePath` function).

Fixes #1629.

## Tests

I manually confirmed I could import the repository as a Go module.
2024-08-12 14:20:04 +00:00
..
cloud.go Fix CLI nightlies on our UC workspaces (#1225) 2024-02-21 13:06:03 +00:00
copy.go Fix ability to import the CLI repository as module (#1671) 2024-08-12 14:20:04 +00:00
env.go Add integration test for mlops-stacks initialization (#1155) 2024-03-12 14:15:54 +00:00
file.go Serialize dynamic value for `bundle validate` output (#1499) 2024-06-18 15:04:20 +00:00
jdk.go Run Spark JAR task test on multiple DBR versions (#1665) 2024-08-09 15:13:31 +00:00
requirement.go Run tests to verify backend tag validation behavior (#814) 2023-09-29 08:38:06 +00:00