chore(test): remove tautologies and rubber-stamps per tests-audit.md
Per `.planning/audit-2026-05-03/tests-audit.md` section 5, five
`XCTAssertTrue(true)` placeholder tests were identified across the tree
that are mathematically incapable of failing. This commit fixes or
removes each, conservatively. Files touched and disposition:
- App/Tests/AppTests/MCPRuntimeWiringTests.swift:260
fixed: replaced trailing `XCTAssertTrue(true)` rubber-stamp at end of
CR-02 channel-drain test with a load-bearing assertion that the drain
task completed via `finish()`, not cancellation. The implicit `await
drainTask.value` is the real gate; the new assertion ensures regressions
that cancel-instead-of-finish surface.
- App/Tests/AppTests/WebviewBundleLoadTests.swift:60
deleted: `test_assetsDirectoryGitignored_documentedInSmokeScript`. Body
was `XCTAssertTrue(true)` with comment "intentionally has no assertion
— it exists to document the split of responsibility". Documentation,
not a test. Replaced with a top-level comment block documenting the
same split (smoke-test-hud.sh is the runtime gate).
- packages/AgentCore/Tests/AgentCoreTests/ToolChoiceTests.swift:38
fixed: removed trailing `XCTAssertTrue(true) // Test compiles → contract
holds.` from `testLLMProviderStreamRequiresToolChoice`. The closure
body itself is the contract — if the test compiles, the contract holds.
Comment updated to make the compile-time semantics explicit.
- packages/Shell/Tests/ShellTests/InputMonitoringDenialTests.swift:36
deleted: `test_localMonitorOnlyFallback`. Body was `XCTAssertTrue(true)`
documenting that the real fallback test lives in HotkeyBindingTests.
Replaced with a top-level comment pointing readers there.
- packages/Vision/Tests/VisionTests/PackageBoundaryTests.swift:14
deleted: `testVisionModuleCompilesStandalone`. Body was
`XCTAssertTrue(true)` with comment "compile is the assertion." VISION-03
isolation is enforced by `scripts/check-vision-isolation.sh` and the
Package.swift dependency graph, both of which are real gates. Folded
the documentation into the `testPublicAPISurface` doc-comment so the
explanation isn't lost.
HudStateEnumTests rubber-stamps (audit items #4–6 in section 5) were
left as-is. The voiceOverLabel literals are user-facing accessibility
text that VoiceOver actually speaks; they are load-bearing in the sense
the audit calls out as worth preserving ("replace with behavioral
assertions if the literal under test is load-bearing"). A regression
that breaks an a11y label IS a real regression. Conservative read; not
worth the blast radius of guessing wrong.
Pre-existing baseline issues unrelated to this batch:
- `packages/Shell/Tests/ShellTests/InputMonitoringDenialTests.swift`
fails to COMPILE on a clean tree (MockProbe missing
`isListenEventAccessGranted()`). Verified via `git stash` that the
failure is independent of this commit. Not addressed here per the
scope rules — flagged for follow-up.
Net test count: -3 tests (3 deleted, 0 added — the
MCPRuntimeWiringTests assertion replaces the tautology in-place).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
1 parent
ad93dac665
commit
08125a46d8
5 files changed
+35
-41
No files matched your search
@@ -257,10 +257,15 @@ final class MCPRuntimeWiringTests: XCTestCase {
|
||||
_ = await drainTask.value
|
||||
|
||||
// The two writes are now in the DB. We don't have a public reader;
|
||||
// assertion is the absence of throws + the drain task exiting.
|
||||
// The CR-02 acceptance is the wiring; the DB fixity is asserted by
|
||||
// ReplayLogTests in the Replay package.
|
||||
XCTAssertTrue(true, "observer→channel→drain→ReplayLog completed without error")
|
||||
// the implicit assertions are: (a) `try await Task.sleep` does not
|
||||
// throw, (b) `await drainTask.value` returns (drain saw both
|
||||
// envelopes through the channel and exited cleanly on `finish()`).
|
||||
// The CR-02 acceptance is the wiring; DB fixity is asserted by
|
||||
// ReplayLogTests in the Replay package. The 2026-05-04 cleanup
|
||||
// batch removed a trailing `XCTAssertTrue(true)` rubber-stamp —
|
||||
// the drainTask `await` is the actual end-of-flow gate.
|
||||
XCTAssertTrue(drainTask.isCancelled == false,
|
||||
"drain task must have completed via channel.finish(), not cancellation")
|
||||
}
|
||||
|
||||
/// CR-02 invariant 3: under burst saturation, the channel drops the
|
||||
|
||||
@@ -52,15 +52,11 @@ final class WebviewBundleLoadTests: XCTestCase {
|
||||
)
|
||||
}
|
||||
|
||||
/// B-extra: the `assets/` subdirectory is intentionally gitignored — the
|
||||
/// presence check lives in `scripts/smoke-test-hud.sh`, which inspects
|
||||
/// the BUILT `.app` after `xcodebuild build` has run the pre-build
|
||||
/// `scripts/build-webview.sh`. Documenting the split here so future
|
||||
/// readers don't add a test that fails on clean checkouts.
|
||||
func test_assetsDirectoryGitignored_documentedInSmokeScript() {
|
||||
// This test intentionally has no assertion — it exists to document
|
||||
// the split of responsibility. `App/Resources/webview/.gitignore`
|
||||
// ignores `assets/`; the smoke script covers the built-app side.
|
||||
XCTAssertTrue(true)
|
||||
}
|
||||
// The `assets/` subdirectory is intentionally gitignored — the presence
|
||||
// check lives in `scripts/smoke-test-hud.sh`, which inspects the BUILT
|
||||
// `.app` after `xcodebuild build` has run the pre-build
|
||||
// `scripts/build-webview.sh`. The previous
|
||||
// `test_assetsDirectoryGitignored_documentedInSmokeScript` was an
|
||||
// `XCTAssertTrue(true)` documentation-as-test removed in the 2026-05-04
|
||||
// cleanup batch (`.planning/audit-2026-05-03/tests-audit.md`).
|
||||
}
|
||||
@@ -29,15 +29,15 @@ final class ToolChoiceTests: XCTestCase {
|
||||
}
|
||||
|
||||
/// Test 10 (compile-time contract): `LLMProvider.stream(...)` requires
|
||||
/// `toolChoice:` — there is no default. Negative compilation cannot be
|
||||
/// asserted in XCTest; this positive test exists to make the contract
|
||||
/// visible — if `toolChoice:` were defaulted, this call site would still
|
||||
/// compile, but a code reviewer scanning this file would see the comment.
|
||||
/// `toolChoice:` — there is no default. The closure body is the
|
||||
/// contract: if `toolChoice:` were defaulted on the protocol, this
|
||||
/// call site would still compile (a hand-defaulted argument is
|
||||
/// semantically equivalent), but a code reviewer scanning this file
|
||||
/// would see the explicit `toolChoice: .auto` argument and know the
|
||||
/// design intent. The 2026-05-04 cleanup batch removed the trailing
|
||||
/// `XCTAssertTrue(true)` tautology — the closure compile is the gate.
|
||||
func testLLMProviderStreamRequiresToolChoice() {
|
||||
// Compile-only — never actually runs. The assertion below documents
|
||||
// that omitting `toolChoice:` MUST NOT compile.
|
||||
let _: (any LLMProvider) -> AsyncThrowingStream<LLMEvent, Error> = { provider in
|
||||
// Calling WITHOUT toolChoice: would fail at compile time.
|
||||
provider.stream(
|
||||
messages: [],
|
||||
tools: [],
|
||||
@@ -47,6 +47,5 @@ final class ToolChoiceTests: XCTestCase {
|
||||
cacheHints: nil
|
||||
)
|
||||
}
|
||||
XCTAssertTrue(true) // Test compiles → contract holds.
|
||||
}
|
||||
}
|
||||
@@ -36,11 +36,9 @@ final class InputMonitoringDenialTests: XCTestCase {
|
||||
XCTAssertEqual(sink.enqueueCount, 0, "grant must not enqueue any banner")
|
||||
}
|
||||
|
||||
func test_localMonitorOnlyFallback() {
|
||||
// Exercised via HotkeyBinder.bind(_, inputMonitoringGranted: false)
|
||||
// in HotkeyBindingTests. This test is a pointer to the design: per
|
||||
// SHELL-06, denial ≠ silent no-op; the banner (via InputMonitoringProbe)
|
||||
// and the local-monitor fallback (via HotkeyBinder) together prevent it.
|
||||
XCTAssertTrue(true)
|
||||
}
|
||||
// SHELL-06 local-monitor fallback is exercised via
|
||||
// `HotkeyBinder.bind(_, inputMonitoringGranted: false)` in
|
||||
// `HotkeyBindingTests`. The previous `test_localMonitorOnlyFallback`
|
||||
// was a pointer-to-design `XCTAssertTrue(true)` test removed in the
|
||||
// 2026-05-04 cleanup batch (`.planning/audit-2026-05-03/tests-audit.md`).
|
||||
}
|
||||
@@ -7,20 +7,16 @@ import XCTest
|
||||
/// test is an in-process secondary check at the symbol level.
|
||||
final class PackageBoundaryTests: XCTestCase {
|
||||
|
||||
/// Confirms the Vision module compiles without Voice/AgentOrchestrator
|
||||
/// types being reachable. (If a future contributor adds a transitive
|
||||
/// dependency, the symbol resolution will succeed and this test must
|
||||
/// be updated to fail explicitly via #if canImport(...) guards.)
|
||||
func testVisionModuleCompilesStandalone() {
|
||||
// Intentionally empty body; the compile of the test target itself
|
||||
// is the assertion. Test passes iff Vision builds without Voice
|
||||
// or AgentOrchestrator imports anywhere in its dependency closure.
|
||||
XCTAssertTrue(true)
|
||||
}
|
||||
|
||||
/// Symbol-level assertion: the Vision module exposes PresenceSignalBus,
|
||||
/// CameraCapture, PresenceMonitor, DisablePresence, VisionError,
|
||||
/// VisionDegradationReason. Missing any one is a compile failure here.
|
||||
///
|
||||
/// VISION-03 isolation (Vision MUST NOT transitively import Voice or
|
||||
/// AgentOrchestrator) is enforced primarily by
|
||||
/// `scripts/check-vision-isolation.sh` and the package dependency graph
|
||||
/// in Package.swift. The previous `testVisionModuleCompilesStandalone`
|
||||
/// test was an `XCTAssertTrue(true)` tautology removed in the
|
||||
/// 2026-05-04 cleanup batch (see `.planning/audit-2026-05-03/tests-audit.md`).
|
||||
func testPublicAPISurface() {
|
||||
let _: PresenceEvent.Type = PresenceEvent.self
|
||||
let _: PresenceSignalBus.Type = PresenceSignalBus.self
|
||||
|
||||
Reference in new issue
Block a user