Skip to content

Windows shell: 20 Zig test files (~95 tests) are never executed by any harness #424

Description

@coneilen

Summary

Tools/windows/Tests/WindowsShell.Tests.ps1 runs Zig unit tests by a hand-maintained list of 19 explicit zig test src\<File>.zig invocations. Any test file not added to that list is silently never executed.

20 source files containing ~95 test blocks are currently never run by any harness, in CI or locally.

Affected files (test count)

File tests
Sidebar 22
WindowsRepositoryDialogs 13
WorktreeStatus 9
DraftAttachments 8
GraphContextMenu 8
App 4
MainWindow 4
WorktreeDialog 4
Accessibility 3
Dpi 3
TemplateLibrary 3
WorkspaceLifecycle 3
GdiGradient 2
Navigation 2
QuickChats 2
AppFont 1
GdiplusAA 1
UpdateOfferDialog 1
WindowsNativeDialogs 1
WorkspaceControls 1

Why imports do not save this

Zig runs test blocks from the root file passed to zig test. Tests in imported files are not included unless the root references their declarations, typically via std.testing.refAllDecls.

git grep refAllDecls -- graphcode-windows/src returns zero matches.

So transitive coverage does not exist. Sidebar.zig is imported by the wired GraphCanvas.zig, and its 22 tests still never run. Confirmed there is also no zig build test step: build.zig declares no test step, and addTest/test_step appear nowhere in build.zig, Tools/, or .github/. Only WindowsShell.Tests.ps1 invokes zig test; ValidationRunner.Tests.ps1 merely regex-asserts that the harness contains a WindowsUpdates line.

Impact

This is a gating failure, not a coverage gap. Tests that pass locally and are cited as evidence are not enforced by CI, so nothing prevents them from silently rotting.

Concretely, PR #408 added a mitigation test asserting the Move Project menu item is disabled. That test lives in GraphContextMenu.zig and has never run in CI.

This plausibly contributes to parity-ledger rows being marked Validated on evidence that no longer holds. Two such rows have already been found: row 53 (Project context menu) asserted the opposite of shipped behavior, and row 112 (Show in Graph) cited a live-gate walkthrough that does not exist (see #423).

Expected

Every graphcode-windows/src/*.zig file containing test blocks is executed by CI, and adding a new test file cannot silently escape the harness.

Suggested fix

  1. Wire the 20 orphaned files into WindowsShell.Tests.ps1 with the correct per-file link flags (several need -target x86_64-windows-msvc -lc plus specific libs, matching existing entries).
  2. Add a structural guard that enumerates src\*.zig, greps for ^test ", and fails if any such file is absent from the harness list. Without this the same drift recurs.
  3. Expect real failures. Some of these tests have not run in a long time; fix or explicitly quarantine each with a stated reason. Do not delete a failing test to make the suite green.

Note

GraphContextMenu.zig and MainWindow.zig are already being wired in by in-flight work on #418 - coordinate to avoid duplicate entries.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions