databricks-cli/bundle/tests
Denis Bilenko 185bbd28e4
Add acceptance tests (#2081)
## Changes
- New kind of test is added - acceptance tests. See acceptance/README.md
for explanation.
- A few tests are converted to acceptance tests by moving databricks.yml
to acceptance/ and adding corresponding script files.

As these tests run against compiled binary and can capture full output
of the command, they can be useful to support major changes such as
refactoring internal logging / diagnostics or complex variable
interpolation.

These are currently run as part of 'make test' but the intention is to
run them as part of integration tests as well.

### Benefits

- Full binary is tested, exactly as users get it.
  - We're not testing custom set of mutators like many existing tests.
- Not mocking anything, real SDK is used (although the HTTP endpoint is
not a real Databricks env).
- Easy to maintain: output can be updated automatically.
- Can easily set up external env, such as env vars, CLI args,
.databrickscfg location etc.

### Gaps

The tests currently share the test server and there is global place to
define handlers. We should have a way for tests to override / add new
handlers.

## Tests
I manually checked that output of new acceptance tests matches previous
asserts.
2025-01-08 12:41:08 +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_permissions Added support for top-level permissions (#928) 2023-11-13 11:29:40 +00:00
environment_key_only Fixed seg fault when specifying environment key for tasks (#1443) 2024-05-21 10:00:04 +00:00
environment_overrides Use dynamic configuration model in bundles (#1098) 2024-02-16 19:41:58 +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 Fixed panic when loading incorrectly defined jobs (#1402) 2024-05-17 10:10:17 +00:00
include_with_glob Fixed panic when loading incorrectly defined jobs (#1402) 2024-05-17 10:10:17 +00: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
issue_1828 Handle normalization of `dyn.KindTime` into an any type (#1836) 2024-10-17 10:00:40 +00:00
job_and_pipeline Renamed `environments` to `targets` in bundle configuration (#670) 2023-08-17 15:22:32 +00:00
job_cluster_key Added validate mutator to surface additional bundle warnings (#1352) 2024-04-18 15:13:16 +00:00
job_with_spark_conf Test existing behavior when loading non-string spark conf values (#1071) 2023-12-18 11:22:22 +00:00
model_serving_endpoint Support Model Serving Endpoints in bundles (#682) 2023-09-07 21:54:31 +00:00
override_job_parameters Merge job parameters based on their name (#1659) 2024-08-06 16:12:18 +00:00
path_translation Rewrite relative paths using `dyn.Location` of the underlying value (#1273) 2024-03-18 16:23:39 +00:00
pipeline_glob_paths Move bundle tests into bundle/tests (#1299) 2024-03-21 10:37:05 +00:00
presets Add configurable presets for name prefixes, tags, etc. (#1490) 2024-08-19 18:18:50 +00:00
python_wheel Update target references to use `${bundle.target}` (#1935) 2024-11-27 11:51:08 +00:00
quality_monitor Pause quality monitors when "mode: development" is used (#1481) 2024-06-19 13:54:35 +00:00
registered_model Support Unity Catalog Registered Models in bundles (#846) 2023-10-16 15:32:49 +00:00
relative_path_translation Retain location information of variable reference (#1333) 2024-04-03 10:40:29 +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 Compare `.Kind()` instead of direct equality checks on a `dyn.Value` (#1520) 2024-06-27 13:28:19 +00:00
sync Add paths field to bundle sync configuration (#1694) 2024-08-21 15:33:25 +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
undefined_resources Report all empty resources present in error diagnostic (#1685) 2024-08-20 00:22:00 +00:00
validate Use dynamic walking to validate unique resource keys (#1614) 2024-07-29 13:04:02 +00:00
yaml_anchors First look for databricks.yml before falling back to bundle.yml (#580) 2023-07-18 12:16:34 +02:00
yaml_anchors_separate_block Do not emit warning on YAML anchor blocks (#1354) 2024-04-10 09:55:02 +00: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
bundle_permissions_test.go Return `diag.Diagnostics` from mutators (#1305) 2024-03-25 14:18:47 +00:00
enviroment_key_test.go Upload local libraries even if they don't have artifact defined (#1664) 2024-08-14 09:03:44 +00:00
environment_git_test.go Enable testifylint and fix the issues (#2065) 2025-01-02 12:03:41 +01:00
environment_overrides_test.go Enable testifylint and fix the issues (#2065) 2025-01-02 12:03:41 +01:00
environments_job_and_pipeline_test.go Enable testifylint and fix the issues (#2065) 2025-01-02 12:03:41 +01: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 Enable testifylint and fix the issues (#2065) 2025-01-02 12:03:41 +01:00
include_test.go Stop tracking file path locations in bundle resources (#1673) 2024-08-13 12:50:15 +00:00
interpolation_test.go Return `diag.Diagnostics` from mutators (#1305) 2024-03-25 14:18:47 +00:00
issue_1828_test.go Enable testifylint and fix the issues (#2065) 2025-01-02 12:03:41 +01:00
job_and_pipeline_test.go Enable testifylint and fix the issues (#2065) 2025-01-02 12:03:41 +01:00
job_cluster_key_test.go Enable testifylint and fix the issues (#2065) 2025-01-02 12:03:41 +01:00
job_with_spark_conf_test.go Use dynamic configuration model in bundles (#1098) 2024-02-16 19:41:58 +00:00
loader.go Add paths field to bundle sync configuration (#1694) 2024-08-21 15:33:25 +00:00
model_serving_endpoint_test.go Enable testifylint and fix the issues (#2065) 2025-01-02 12:03:41 +01:00
override_job_parameters_test.go Merge job parameters based on their name (#1659) 2024-08-06 16:12:18 +00:00
path_translation_test.go Return `diag.Diagnostics` from mutators (#1305) 2024-03-25 14:18:47 +00:00
pipeline_glob_paths_test.go Always prepend bundle remote paths with /Workspace (#1724) 2024-10-02 15:34:00 +00:00
presets_test.go Enable testifylint and fix the issues (#2065) 2025-01-02 12:03:41 +01:00
python_wheel_test.go Enable testifylint and fix the issues (#2065) 2025-01-02 12:03:41 +01:00
quality_monitor_test.go Enable testifylint and fix the issues (#2065) 2025-01-02 12:03:41 +01:00
registered_model_test.go Enable testifylint and fix the issues (#2065) 2025-01-02 12:03:41 +01:00
relative_path_translation_test.go Always prepend bundle remote paths with /Workspace (#1724) 2024-10-02 15:34:00 +00:00
relative_path_with_includes_test.go Return `diag.Diagnostics` from mutators (#1305) 2024-03-25 14:18:47 +00:00
run_as_test.go Enable perfsprint linter and apply autofix (#2071) 2025-01-07 10:49:23 +00:00
suggest_target_test.go Move the CLI test runner to `internal/testcli` package (#2004) 2024-12-12 16:48:51 +00:00
sync_include_exclude_no_matches_test.go Enable testifylint and fix the issues (#2065) 2025-01-02 12:03:41 +01:00
sync_test.go Enable testifylint and fix the issues (#2065) 2025-01-02 12:03:41 +01: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
undefined_resources_test.go Report all empty resources present in error diagnostic (#1685) 2024-08-20 00:22:00 +00:00
validate_test.go Use dynamic walking to validate unique resource keys (#1614) 2024-07-29 13:04:02 +00:00
yaml_anchors_test.go Do not emit warning on YAML anchor blocks (#1354) 2024-04-10 09:55:02 +00:00

README.md

Bundle configuration tests

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