Skip to content

Remove UI tests that only restate the code they cover - #3982

Merged
siegfriedpammer merged 2 commits into
masterfrom
remove-ui-test-probes
Aug 12, 2026
Merged

Remove UI tests that only restate the code they cover#3982
siegfriedpammer merged 2 commits into
masterfrom
remove-ui-test-probes

Conversation

@siegfriedpammer

Copy link
Copy Markdown
Member

Stacked on #3981 (base branch christophwille/nu0826), which removes the two 900-iteration
process-list scroll tests. This is the follow-up sweep for the rest of the same category.

#3981 found the one test pair that was actually expensive. Auditing the rest of ILSpy.Tests
for tests of the same kind turned up seven more that assert nothing a user could notice:

  • ContentPageHierarchyTests (deleted) - reflection asserting that four types derive from
    their base and that ContentTabPage.Content has the type it is declared with. The compiler
    enforces all three.
  • ToolPaneDeferredContentTests (deleted) - asserts a one-line property override returns
    false; its own comment gives the reason as "without this, tests can't reach descendants of
    a pane".
  • BookmarksPaneStructureTests - dropped MinHeight == 29 / Padding == 3 /
    BorderThickness == (0,0,0,1), copied out of BookmarksPane.axaml. The cell-template test
    in the same fixture stays.
  • DocumentationRendererTooltipWidthTests - dropped MaxWidth >= 900, a constant pinned
    by the change that chose it. The wrapping test stays.
  • StartupPerfTests - dropped the one non-[Explicit] test, which asserted that copying
    CoreLib 8x and settling the list takes under 15s, i.e. let a shared CI runner decide the
    verdict. Both [Explicit] benchmarks are untouched; the deleted one was the "CI-runnable
    variant" of one of them and has no purpose off CI.

Two are trimmed rather than deleted, because their kernel is real coverage:

  • XmlDocumentationTests - XmlDocLoader's modern-.NET ref-pack fallback has no other
    test in the repo. Now a plain [Test] that opens CoreLib through AssemblyList, instead of
    booting MainWindow and expanding System.String in the tree to reach the same call.
  • MenuIconWiringProbe -> MainMenuIconTests - the File > Open assertion guards
    MEF-MenuIcon-metadata to NativeMenuItem.Icon rasterisation, which the Avalonia port
    dropped once already. The surrounding menu walk and the "at least 5 leaves have an icon"
    threshold are gone.

Cost

Worth stating plainly: about two seconds. These are not slow - they are noise. Measured
locally, the eight removed tests total 2.1s and the XmlDocLoader trim saves another 0.6s.
The CI win in this area was #3981's, not this PR's.

For scale, from the same measurement run (1180 tests before #3981): the scroll pair was 618s of
1236s. Of the remaining 618s, 559s (90%) belongs to the 547 tests that boot the app or reach
into CoreLib/System.Linq, at a mean of 1.02s each; the 631 tests that stay off the BCL cost
59s total, 0.09s each. Moving heavy tests onto the existing FixtureAssembly stub is where
the remaining time is - that is a separate change.

Verification

ILSpy.Tests on Linux: 1171 tests, 0 failures, 3 skipped ([Explicit]).

Base automatically changed from christophwille/nu0826 to master August 11, 2026 19:56
These fixtures were written while porting to Avalonia, as an author's own
verification step rather than as coverage: reflection asserting that a type
derives from its base and that a property has the type it is declared with;
literals (MinHeight 29, Padding 3, MaxWidth 900) copied out of the .axaml
beside them; a property override asserted only so pane descendants stay
reachable from tests. None of them can fail except when someone deliberately
edits the line they mirror, and then they fail as a chore.

StartupPerfTests keeps its two [Explicit] benchmarks, which print per-phase
timings worth reading. The third was a wall-clock assertion (8 CoreLib copies
must settle in under 15s) that ran in CI, where a shared runner decides the
verdict; as [Explicit] it would be strictly dominated by the 200-assembly
benchmark it was derived from, so it goes.

Two fixtures are trimmed rather than deleted, because their kernel is real:
XmlDocLoader's ref-pack fallback has no other test in the repo, and the
MenuIcon metadata rasterisation was dropped once during the port already.
Both now assert that without booting MainWindow to reach it.

This is worth about two seconds - it buys reviewers less to read, not CI
less to do.

Assisted-by: Claude:claude-opus-5:Claude Code
Five fixtures covered the "Use nested namespace structure" setting, four of
them running the same toggle at a different layer: the model shape, the same
toggle awaited live, and the same toggle again asserting it reached the
SharpTreeView's rows. Each paid its own boot for a scenario that is one story
end to end, and together they were the second-largest block of time in the
suite after the process-list scroll loops. One test now walks the whole path
once, carrying every assertion the four had, including the nesting depth only
the first checked.

The comparison view's model-is-bound test is dropped: the test after it
renders rows out of that model, which cannot happen unless it is bound, and
it opened two fixture assemblies to prove it.

The expander hitbox test asserted the toggle measures 13x16 and its glyph 9x9,
then clicked 14px down to prove the area below the glyph is live. The click
proves the geometry; the measurements only restate it, and would fail on a
font-metric change that broke nothing. Its layout-settling loop slept 200ms
unconditionally, which is a race that usually wins - it now waits for the
condition it needs.

Assisted-by: Claude:claude-opus-5:Claude Code
@siegfriedpammer
siegfriedpammer merged commit dc5b70f into master Aug 12, 2026
15 checks passed
@siegfriedpammer
siegfriedpammer deleted the remove-ui-test-probes branch August 13, 2026 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants