Skip to content

Route test-run diagnostics to a temp log - #3

Merged
MarkRWatts merged 1 commit into
mainfrom
fix/test-log-isolation
Aug 21, 2026
Merged

MarkRWatts merged 1 commit into
mainfrom
fix/test-log-isolation

Conversation

@MarkRWatts

Copy link
Copy Markdown
Owner

Test suites exercise the same code paths as the app (store inits, integrity verdicts, rule supersession), and their DiagnosticsLog lines were appended to the real ~/Library/Logs/Argus/argus.log. Because log lines carry only basenames like rules-state.json, test noise was indistinguishable from real app activity when tailing the log.

Under XCTest (detected via the XCTestConfigurationFilePath environment variable or a loaded XCTestCase class), the log destination is now a per-process file under the temp directory. The write path still runs for real in tests; the user's log stays an honest record of the app alone.

Verified: a full swift test run adds zero lines to the real log, the per-process temp file receives the redirected lines, all 170 tests pass, and the app bundle still builds.

🤖 Generated with Claude Code

Test suites exercise the same code paths as the app (store inits,
integrity verdicts, rule supersession), and their DiagnosticsLog lines
landed in the real ~/Library/Logs/Argus/argus.log — indistinguishable
from app activity, since log lines carry only basenames like
rules-state.json. Under XCTest (env var or loaded XCTestCase class) the
log now goes to a per-process file under the temp directory; the write
path still runs for real, and the user's log stays an honest record of
the app alone. Verified: a full test run adds zero lines to the real
log and the temp file receives them.

Co-Authored-By: Claude Fable 5 <[email protected]>
@MarkRWatts
MarkRWatts merged commit c9d6d4d into main Aug 21, 2026
2 checks passed
@MarkRWatts
MarkRWatts deleted the fix/test-log-isolation branch August 21, 2026 14:36
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