databricks-cli/bundle/tests
Andrew Nester 83443bae8d
Make resource and artifact paths in bundle config relative to config folder (#708)
# Warning: breaking change

## Changes
Instead of having paths in bundle config files be relative to bundle
root even if the config file is nested, this PR makes such paths
relative to the folder where the config is located.

When bundle is initialised, these paths will be transformed to relative
paths based on bundle root. For example,
we have file structure like this
```
- mybundle
| - bundle.yml
| - subfolder
| -- resource.yml
| -- my.whl
```

Previously, we had to reference `my.whl` in resource.yml like this,
which was confusing because resource.yml is in the same subfolder
```
sync:
  include:
    - ./subfolder/*.whl
...
tasks:
  - task_key: name
    libraries:
      - whl: ./subfolder/my.whl
...
```

After the change we can reference it like this (which is in line with
the current behaviour for notebooks)

```
sync:
  include:
    - ./*.whl
...
tasks:
  - task_key: name
    libraries:
      - whl: ./my.whl
...
```

## Tests
Existing `translate_path_tests` successfully passed after refactoring.

Added a couple of uses cases for `Libraries` paths.

Added a bundle config tests with include config and sync section

---------

Co-authored-by: Pieter Noordhuis <pieter.noordhuis@databricks.com>
2023-09-04 09:55:01 +00:00
..
autoload_git Renamed `environments` to `targets` in bundle configuration (#670) 2023-08-17 15:22:32 +00:00
basic First look for databricks.yml before falling back to bundle.yml (#580) 2023-07-18 12:16:34 +02:00
bundle Allow referencing local Python wheels without artifacts section defined (#703) 2023-08-28 16:29:04 +00:00
conflicting_resource_ids Require include glob patterns to be explicitly defined (#602) 2023-07-25 10:00:46 +02:00
environment_overrides Confirm that override with a zero value doesn't work (#669) 2023-08-16 11:28:57 +00:00
environments_autoload_git Renamed `environments` to `targets` in bundle configuration (#670) 2023-08-17 15:22:32 +00:00
environments_job_and_pipeline Renamed `environments` to `targets` in bundle configuration (#670) 2023-08-17 15:22:32 +00:00
environments_override_job_cluster Renamed `environments` to `targets` in bundle configuration (#670) 2023-08-17 15:22:32 +00:00
git_branch_validation Fix bundle git branch validation (#645) 2023-08-07 17:29:02 +00:00
include_default Require include glob patterns to be explicitly defined (#602) 2023-07-25 10:00:46 +02:00
include_invalid First look for databricks.yml before falling back to bundle.yml (#580) 2023-07-18 12:16:34 +02:00
include_multiple Require include glob patterns to be explicitly defined (#602) 2023-07-25 10:00:46 +02:00
include_with_glob First look for databricks.yml before falling back to bundle.yml (#580) 2023-07-18 12:16:34 +02:00
interpolation First look for databricks.yml before falling back to bundle.yml (#580) 2023-07-18 12:16:34 +02:00
interpolation_target Renamed `environments` to `targets` in bundle configuration (#670) 2023-08-17 15:22:32 +00:00
job_and_pipeline Renamed `environments` to `targets` in bundle configuration (#670) 2023-08-17 15:22:32 +00:00
override_job_cluster Renamed `environments` to `targets` in bundle configuration (#670) 2023-08-17 15:22:32 +00:00
relative_path_with_includes Make resource and artifact paths in bundle config relative to config folder (#708) 2023-09-04 09:55:01 +00:00
run_as Added run_as section for bundle configuration (#692) 2023-08-23 16:47:07 +00:00
target_empty Renamed `environments` to `targets` in bundle configuration (#670) 2023-08-17 15:22:32 +00:00
target_overrides Renamed `environments` to `targets` in bundle configuration (#670) 2023-08-17 15:22:32 +00:00
variables Renamed `environments` to `targets` in bundle configuration (#670) 2023-08-17 15:22:32 +00:00
yaml_anchors First look for databricks.yml before falling back to bundle.yml (#580) 2023-07-18 12:16:34 +02:00
README.md Move mutator interface to top level bundle package (#105) 2022-11-28 10:59:43 +01:00
basic_test.go Move mutator interface to top level bundle package (#105) 2022-11-28 10:59:43 +01:00
conflicting_resource_ids_test.go Log the bundle root configuration file if applicable (#657) 2023-08-11 12:28:05 +00:00
environment_git_test.go Renamed `environments` to `targets` in bundle configuration (#670) 2023-08-17 15:22:32 +00:00
environment_overrides_test.go Renamed `environments` to `targets` in bundle configuration (#670) 2023-08-17 15:22:32 +00:00
environments_job_and_pipeline_test.go Renamed `environments` to `targets` in bundle configuration (#670) 2023-08-17 15:22:32 +00:00
environments_override_job_cluster_test.go Renamed `environments` to `targets` in bundle configuration (#670) 2023-08-17 15:22:32 +00:00
git_test.go Renamed `environments` to `targets` in bundle configuration (#670) 2023-08-17 15:22:32 +00:00
include_test.go Log the bundle root configuration file if applicable (#657) 2023-08-11 12:28:05 +00:00
interpolation_test.go Renamed `environments` to `targets` in bundle configuration (#670) 2023-08-17 15:22:32 +00:00
job_and_pipeline_test.go Renamed `environments` to `targets` in bundle configuration (#670) 2023-08-17 15:22:32 +00:00
loader.go Renamed `environments` to `targets` in bundle configuration (#670) 2023-08-17 15:22:32 +00:00
override_job_cluster_test.go Renamed `environments` to `targets` in bundle configuration (#670) 2023-08-17 15:22:32 +00:00
relative_path_with_includes_test.go Make resource and artifact paths in bundle config relative to config folder (#708) 2023-09-04 09:55:01 +00:00
run_as_test.go Added run_as section for bundle configuration (#692) 2023-08-23 16:47:07 +00:00
target_empty_test.go Renamed `environments` to `targets` in bundle configuration (#670) 2023-08-17 15:22:32 +00:00
target_overrides_test.go Renamed `environments` to `targets` in bundle configuration (#670) 2023-08-17 15:22:32 +00:00
variables_test.go Renamed `environments` to `targets` in bundle configuration (#670) 2023-08-17 15:22:32 +00:00
yaml_anchors_test.go Revert "Rename jobs -> workflows" (#118) 2022-12-01 22:39:15 +01:00

README.md

Bundle configuration tests

Every test here uses an example bundle configuration. Each bundle configuration is located in a dedicated subdirectory.