Route test-run diagnostics to a temp log - #3
Merged
Merged
Conversation
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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Test suites exercise the same code paths as the app (store inits, integrity verdicts, rule supersession), and their
DiagnosticsLoglines were appended to the real~/Library/Logs/Argus/argus.log. Because log lines carry only basenames likerules-state.json, test noise was indistinguishable from real app activity when tailing the log.Under XCTest (detected via the
XCTestConfigurationFilePathenvironment variable or a loadedXCTestCaseclass), 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 testrun 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