databricks-cli/acceptance/selftest
Denis Bilenko c0a56a93fb
acc: add a helper to diff with replacements (#2352)
## Changes

diff.py is like "diff -r -U2" but it applies replacements first to the
argument.

This allows comparing different output files and directories but ignore
differences that are going to be replaced by placeholders.

This is useful for tests that record large amount of files, specifically
"bundle init" with standard templates. In those tests, changing one
parameter results in a small diff so recording the full directory is not
helpful, because it's hard to see what changed there. I'm using it in
implementation of serverless mode for templates that need it: #2348 The
serverless templates are slightly different from classic, capturing the
diff helps to see exactly where.

Related small changes:
- Add [TESTROOT] replacement for absolute path to acceptance directory
in git repo.
- Add $TESTDIR env var for absolute path to a given test in git repo.

## Tests
- New test acceptance/selftest/diff to test the helper.
- Via #2348 which makes use of this feature.
2025-02-14 11:02:12 +00:00
..
basic acc: Allow mixing custom stubs with default server impl (#2334) 2025-02-11 15:03:41 +00:00
diff acc: add a helper to diff with replacements (#2352) 2025-02-14 11:02:12 +00:00
server acc: Simplify writing handlers; support headers in responses (#2338) 2025-02-12 13:00:57 +00:00
test.toml acc: add a helper to diff with replacements (#2352) 2025-02-14 11:02:12 +00:00