databricks-cli/acceptance/bin
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
..
callserver.py Add -inprocess mode for acceptance tests (#2184) 2025-01-21 21:21:12 +00:00
diff.py acc: add a helper to diff with replacements (#2352) 2025-02-14 11:02:12 +00:00
sort_blocks.py Format Python code with ruff (#2166) 2025-01-17 07:38:47 +00:00
sort_lines.py Always print warnings and errors; clean up format (#2213) 2025-02-07 11:29:40 +00:00