Repository navigation
test: keep blocked audit export trail beside the log file - #2068
Merged
Merged
Conversation
The #877 retarget of the audit logger had no regression test. A logger already pointed elsewhere must not keep the finding.
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.
Summary
_audit_log_file_response: a blocked/logsexport writesAuditTrailFindingnext to the exported file, not in a directory the audit logger was already using.Risky behavior now covered
configure_audit_log_directory(path.parent)runs beforelog_audit_trail_finding. Without this test, a later edit can drop that call and the trail goes back to whatever directory the process logger already had (often the working directory), while/logsstill returns 422.Test files
tests/test_log_self_scan.py—test_blocked_export_writes_audit_trail_beside_the_exported_fileTest plan
uv run pytest tests/test_log_self_scan.py./scripts/check-all.sh --enforced(exit 0)