Latest Results
Remove more duplication in `show_settings` tests (#19664)
## Summary
A follow up from #19654. Now with an even larger total diff.
This PR does three things (let me know if you'd rather it be 3 stacked
PRs).
Firstly, it reduces the `diff_uv_snapshot` and `capture_uv_snapshot`
context down to the regular 3. It keeps the 10 override for existing
users. This leads to a loss of ~200 lines in the existing cases. I think
the new context size is perfectly appropriate for these tests.
Secondly, it converts all the applicable show_settings tests to the new
approach.
And, lastly, it removes the need for every test to have a big initial
snapshot to diff against, by quietly generating a relevant baseline and
then diffing against that. Because we'd be losing some test cases, it
reproduces these baselines as some dedicated tests instead.
## Review Guide
The PR is split into 10 commits which are intended to aid in reviewing
it.
1. Reduce diff snapshot context: This makes the necessary adjustments to
reduce the size of the diff context, and amends the existing converted
tests from the previous PR.
2. Refactor uv diff snapshot helpers: This is just a small change to
de-duplicate some of the logic from the previous PR and set up for a
`capture_uv_snapshot` that does not assert. This is needed for quietly
generating baseline snapshots.
3. Remove snapshot contents: This commit deletes the snapshot contents
for all snapshots which will subsequently need updating. This commit is
solely here to make it easier to follow the following commits. The
intent was that this would be just deletions, and it _is_ just
deletions, except the default git diff algorithm doesn't realise this.
You need `--patience` or `--histogram` to see that this is the case.
4. Use baselines and diff snapshots: This commit converts all remaining
`show_settings` tests to using diff snapshots _and_ introduces the
baselines to remove their snapshots. The previously affected tests from
the previous PR are _not_ touched here (intentionally).
5. Use intra-test diffs: This commit develops on the previous by adding
diffs between outputs within test cases to further reduce duplication
and clarify/highlight dependent test-cases within a test function. The
idea being that the diff is happening against a more relevant command to
further minimise the snapshot sizes.
6. Populate diff snapshots: This commit is the counterpart to commit 3.
It re-populates the changed snapshots. This is, again, to aid in review
if going commit-by-commit. Commits 4 and 5 have some minor adjustments
that are beyond their stated purpose in order to allow this commit to be
100% added lines only.
7. Improve existing diff snapshots: This is a cleanup pass on the
existing diffs (from the previous PR) to upgrade them to using the
baseline snapshots. The change should be just that.
8. Clarify existing diff snapshot comparisons: I've improved (I hope) on
the existing comments from the previous PR for cases where intra-test
diffs are used. I've also added missing comments. The goal is to make it
clear why a specific previous snapshot is being diffed against so that
the following diff snapshot combined with any existing normal "what is
this snapshot supposed to tell me" comments makes sense to anyone who
may encounter it in the future.
9. Add baseline tests: This introduces the now missing test cases for
the baseline cases which the other tests use for their diffs.
10. Populate baseline snapshots: Again, in order to keep commit 9 easier
to review, the snapshot population was split off.
## Test Plan
Baseline tests added, otherwise N/A. Latest Branches
+5%
0%
tk/more-showsettings-reduction -1%
charlie/remote-wheel-sha256 © 2026 CodSpeed Technology