Skip to content

[Enhancement]: Tests — comments name tests that no longer exist, and nothing checks a cited name #2658

Description

@laurentiu021

Problem

Comments that name a test as the thing that pins a behaviour, where no test of that name exists any more, so a contributor who goes looking finds nothing. Measured on main at d0a9b50:

  • SysManager.Tests/AppUpdatesViewModelTests.cs:14, BulkInstallerViewModelTests.cs:18, RestorePointsViewModelTests.cs:27 and ServicesViewModelTests.cs:25: "Required by ArchitectureTests.DialogServiceSwappers_AreInTheSerializedCollection". The guard is ProcessWideStaticUsers_AreInTheSerializedCollection.
  • SysManager.Tests/UpdateServiceAuthenticodeTests.cs:142: "pinned by AuthenticodeTests.ValidateChain_UsesTheStrictPolicy_AndFailsClosed". The test is ValidateChain_BuildsWithThatPolicy_AndFailsClosed.
  • SysManager.Tests/StartupSignatureTests.cs:185: <see cref="AuthenticodeTests.TheInformationalPath_AsksForOfflineRevocation_SoItDoesNotFetchPerFile"/>. No such test; AuthenticodeTests has TheInformationalPath_DoesNotBuildAManagedChain and the offline-policy theory beside it.
  • SysManager.Tests/PowerShellRunnerTests.cs:335: the wiring "is proven end to end by PowerShellRunnerTests.RunspaceTeardown_StopsTheChildTheRunspaceWasBuiltWith in SysManager.IntegrationTests". The integration suite has no test of that name.
  • SysManager.IntegrationTests/EventLogServiceTests.cs:174: "what Read_Cancellation_StopsQuickly above already does". The test above is Read_Cancellation_StopsFast.
  • SysManager/App.xaml:170: "EveryOnScaleCornerRadius_UsesItsToken enforces the rest". No such test; the nearest is ArchitectureTests.EveryCornerRadius_IsOnTheScale.

The <see cref> compiles because no project generates documentation, so the compiler never resolves a cref. Built with GenerateDocumentationFile on and CS1591 off, it reports 17 crefs it cannot resolve (CS1574: 7 in the app, 10 in the unit tests, the one above among them), 14 ambiguous ones (CS0419), three comments that are not well-formed XML (CS1570: Helpers/ExplorerShell.cs:31, PutBackSignalTests.cs:19, AllViewModelsSweepTests.cs:12, each an unescaped &), one paramref to a parameter that does not exist (CS1734, ViewModelBaseInitFaultTests.cs:34), and 74 methods that document some parameters but not all (CS1573). With TreatWarningsAsErrors each of those is a build error. Notes that name a test only to say it was removed or renamed are fine and are not listed.

Proposed solution

Point each comment at the test that holds the behaviour today, or say what holds it if no test does. Then keep the names true mechanically: a guard that resolves every <Class>Tests.<Member> citation in the code and the docs against the members that class declares (with removal notes worded so they do not read as a citation), and GenerateDocumentationFile with CS1591 suppressed in the test projects, so a stale cref fails the build.

Affected tab

Tests

Activity

  1. added a commit that references this issue on Oct 9, 2026
    9704586
  2. laurentiu021 commented on Oct 9, 2026

    @laurentiu021
    OwnerAuthor

    Done in #2660. Tests and comments only, so it ships with the next release rather than making one; the published exe is byte-identical with the new setting on and off.

    Citations. The six places listed here are fixed, and one more turned up: AuthenticodeTests cited VerifyAuthenticode_PinsThePublisherAndBuildsAChain, which is VerifyAuthenticode_PinsThePublisherAndValidatesTheChain now. Each comment names the test as it is today; the informational path's comment now says it asks Windows through WinVerifyTrust, which TheInformationalPath_DoesNotBuildAManagedChain pins.

    Compiler. Directory.Build.props turns on GenerateDocumentationFile in every project, with CS1591 and CS1573 still allowed, so a cref that names nothing or two overloads, a paramref to a missing parameter and an unescaped & fail the build. The 35 that were there are fixed, among them a cref to TweakApplyResult, removed with Tweaks Hub in #2582. PublishDocumentationFile is off, so the 2.7 MB XML file does not land beside the published exe.

    Guard. ArchitectureTests.EveryTestCitedWithItsClass_StillExists resolves every SomethingTests.Member in plain comments, XAML and the Markdown docs against the members that class declares in code. Against the unfixed tree it failed on the eight such citations; seven mutations of it turn it red, and four mutations of the compiler's half each fail the build with CS1574, CS0419, CS1570 or CS1734.

    CONTRIBUTING now says doc comments are checked and how to name a test in prose.

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

    enhancementNew feature or requesttestsTest projects only

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions