rdmbair15m5-changelog-20260922-0447-task-20260904-06-ecs0lib-test-target-split
rdmbair15m5-changelog-20260922-0447-task-20260904-06-ecs0lib-test-target-split
One-line summary: Split the single monolithic ecs0lib test target into 11 per-product targets plus shared support and integration suites, and gated live host probes behind explicit opt-in environment variables.
Metadata
- Date: 2026-09-22 04:47:00 EDT
- Host:
rdmbair15m5(Apple Silicon M5, macOS 27.0) - Scope:
lib/ecs0libacrossrdmbair15m5andrdmsm4x - Ticket:
TASK-20260904-06(underEPIC-20260904-01) - Author:
agy@rdmbair15m5(29f62094-34ba-4142-899f-ba8be4898eeb) - Commits:
2ab8ed0(fix(tests): align Tier1 theme mode assertions with folded ECS0AppearanceMode)de70a61(feat(tests): split test targets and gate live/mutating probes (TASK-20260904-06))1c74c67(fix(ECS0Permissions): suppress FDA probe in headless sessions and gate live stress tests)
What Changed & Why It Matters
ecs0lib previously defined all 46 test files in a single
monolithic ECS0LibTests target. This caused two key
problems:
- Building tests for lightweight terminal/system components required compiling CoreML and linking AppKit and network stacks.
- Live probes against host state (system network services, status items, keychain, listening sockets, Apple Events, TCC) executed by default during unit test runs, causing environmental sensitivity, firewall popups, and kernel TCC hangs in headless SSH sessions.
Following docs/TEST-TARGET-SPLIT.md:
- Created
Tests/ECS0LibTestSupport/LiveProbes.swiftimplementing opt-in gates:LiveProbes.enabled: gated behindECS0_LIVE_PROBES == "1"LiveProbes.mutatingEnabled: gated behindECS0_MUTATING_PROBES == "1"
- Replaced monolithic
ECS0LibTestswith 11 per-product targets + support + integration targets:ECS0LibTestSupport(opt-in helpers)ECS0TerminalTests(21 tests)ECS0SystemTests(103 tests)ECS0PersistenceTests(6 tests)ECS0NetworkingTests(22 tests)ECSNetTopTests(11 tests)ECS0PermissionsTests(12 tests)ECS0AITests(13 tests)ECS0AgenticTests(48 tests)ECS0AppKitTests(9 tests)ECS0ConformanceTests(2 tests)ECS0UITests(0 XCTest tests; SwiftUI preview target)ECS0LibIntegrationTests(241 tests; multi-module tiers and stress tests)
- Moved all 46 test files into their designated target directories
(
git mv). - Gated live host inspection and mutation across XCTest tests and
swift-testing tests using
try XCTSkipUnless(LiveProbes.enabled, ...)and@Test(.enabled(if: LiveProbes.enabled)). - Fixed kernel TCC hang in
probeFullDiskAccess()by returning.deniedearly in headless sessions (isHeadlessSession == true), and cachedHeadlessDetector.currentLaunchctlManagerName()to eliminate repetitive subprocess spawning. - Rewrote
TEST_INFRA.mdand updatedCLAUDE.mdandAGENTS.md.
Exact Files Touched
Package.swiftTEST_INFRA.mdCLAUDE.mdAGENTS.mdSources/ECS0Permissions/ECS0Permissions.swiftTests/ECS0LibTestSupport/LiveProbes.swift(new)Tests/ECS0TerminalTests/*(2 files)Tests/ECS0SystemTests/*(10 files)Tests/ECS0PersistenceTests/*(1 file)Tests/ECS0NetworkingTests/*(4 files)Tests/ECSNetTopTests/*(1 file)Tests/ECS0PermissionsTests/*(2 files)Tests/ECS0AITests/*(2 files)Tests/ECS0AgenticTests/*(3 files)Tests/ECS0AppKitTests/*(3 files)Tests/ECS0ConformanceTests/*(1 file)Tests/ECS0LibIntegrationTests/*(16 files)Tests/ECS0UITests/*(1 file)
Verification Evidence
- Target Isolation Speed:
swift test --filter ECS0TerminalTests: compiles in ~2.5s, runs 21 tests in 0.003s.
- Ungated Unit Test Run (
swift test) verified on bothrdmbair15m5andrdmsm4x:- XCTest: 405 passed, 51 skipped, 0 failures.
- Swift-Testing: 77 passed, 1 skipped, 0 failures.
- Total: 488 accounted for (436 passed, 52 skipped, 0 failures), rc=0 in ~5s.
- Full Gated Live Probes Run
(
ECS0_LIVE_PROBES=1 ECS0_MUTATING_PROBES=1 swift test) verified on bothrdmbair15m5andrdmsm4x:- Total: 488 passed, 0 skipped, 0 failures, rc=0 in ~12s.
- Git Sync:
- Pushed to
origin(git.ecs0.net:git/lib/ecs0lib.git). - Synced to
rdmsm4x:~/dev/lib/ecs0lib(fleet,origin, andbackup).
- Pushed to
Rollback / Undo
git checkout eb45269restores the monolithic test target setup.