Skip to content

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

Open
siegfriedpammer wants to merge 1 commit into
christophwille/nu0826from
remove-ui-test-probes
Open

Remove UI tests that only restate the code they cover#3982
siegfriedpammer wants to merge 1 commit into
christophwille/nu0826from
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]).

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant