databricks-cli/libs
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
..
auth Enable perfsprint linter and apply autofix (#2071) 2025-01-07 10:49:23 +00:00
cmdgroup Add error checking in tests and enable errcheck there (#1980) 2024-12-09 13:56:41 +01:00
cmdio Enable perfsprint linter and apply autofix (#2071) 2025-01-07 10:49:23 +00:00
databrickscfg Enable perfsprint linter and apply autofix (#2071) 2025-01-07 10:49:23 +00:00
dbr Extract functionality to detect if the CLI is running on DBR (#1889) 2024-11-14 16:10:45 +00:00
diag Properly read Git metadata when running inside workspace (#1945) 2024-12-05 10:13:13 +00:00
dyn Enable perfsprint linter and apply autofix (#2071) 2025-01-07 10:49:23 +00:00
env Add acceptance tests (#2081) 2025-01-08 12:41:08 +00:00
errs Enable perfsprint linter and apply autofix (#2071) 2025-01-07 10:49:23 +00:00
exec Enable perfsprint linter and apply autofix (#2071) 2025-01-07 10:49:23 +00:00
fakefs Enable perfsprint linter and apply autofix (#2071) 2025-01-07 10:49:23 +00:00
filer Enable perfsprint linter and apply autofix (#2071) 2025-01-07 10:49:23 +00:00
fileset Enable testifylint and fix the issues (#2065) 2025-01-02 12:03:41 +01:00
flags Enable perfsprint linter and apply autofix (#2071) 2025-01-07 10:49:23 +00:00
folders Enable testifylint and fix the issues (#2065) 2025-01-02 12:03:41 +01:00
git Enable perfsprint linter and apply autofix (#2071) 2025-01-07 10:49:23 +00:00
iamutil Move utility functions dealing with IAM to libs/iamutil (#1820) 2024-10-10 13:02:25 +00:00
jsonschema Enable perfsprint linter and apply autofix (#2071) 2025-01-07 10:49:23 +00:00
locker Enable perfsprint linter and apply autofix (#2071) 2025-01-07 10:49:23 +00:00
log Enable gofumpt and goimports in golangci-lint (#1999) 2024-12-12 10:28:42 +01:00
notebook Enable testifylint and fix the issues (#2065) 2025-01-02 12:03:41 +01:00
process Enable perfsprint linter and apply autofix (#2071) 2025-01-07 10:49:23 +00:00
python Enable testifylint and fix the issues (#2065) 2025-01-02 12:03:41 +01:00
set Show actionable errors for collaborative deployment scenarios (#1386) 2024-10-10 11:18:23 +00:00
sync Enable perfsprint linter and apply autofix (#2071) 2025-01-07 10:49:23 +00:00
tags Enable perfsprint linter and apply autofix (#2071) 2025-01-07 10:49:23 +00:00
template Enable perfsprint linter and apply autofix (#2071) 2025-01-07 10:49:23 +00:00
terraform Move to a single prompt during bundle destroy (#1583) 2024-07-24 13:02:19 +00:00
testdiff Add acceptance tests (#2081) 2025-01-08 12:41:08 +00:00
testfile Refactor and cover edge cases in sync integration tests (#160) 2023-01-10 13:16:30 +01:00
textutil Enable gofumpt and goimports in golangci-lint (#1999) 2024-12-12 10:28:42 +01:00
vfs Enable testifylint and fix the issues (#2065) 2025-01-02 12:03:41 +01:00