fix: tighten audit log count assertion in integration test - #89
Merged
Senthil455 merged 1 commit intoJun 17, 2026
Merged
Conversation
The audit log count check used -ge 0, which passes for any non-negative integer including 0. Combined with 2>/dev/null, this assertion could never fail, even if the audit service returned an empty response. Changes: - Replace -ge 0 with -gt 0 to require at least one audit entry - Remove 2>/dev/null to surface potential parsing errors - Exit immediately with code 1 on failure so broken audit logging is not silently ignored Fixes Senthil455#51
Collaborator
Author
|
Thanks for the review. Confirmed the CI failures (notification-go-service, auth-service docker builds) are pre-existing and unrelated to this change -- this PR only touches the shell assertion logic in |
Senthil455
reviewed
Jun 17, 2026
Senthil455
left a comment
Owner
There was a problem hiding this comment.
gh: Not Found (HTTP 404)
{"message":"Not Found","documentation_url":"https://docs.github.com/rest/issues/comments#get-an-issue-comment","status":"404"}
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
Fixes #51 -- The audit log count assertion used
-ge 0, which can never fail because every non-negative integer (including 0) satisfies it. Combined with2>/dev/null, even a completely empty or failed response would silently pass.Root Cause
Line 402 in
run-integration-tests.sh:Three problems:
-ge 0is always true for any non-negative integer (0, 1, 42, etc.)2>/dev/nullhides bash errors if$AUDIT_COUNTis empty or not a numberAUDIT_COUNTdefaults to"0", which still satisfies-ge 0The assertion was mathematically incapable of failing.
Changes
-ge 0-gt 0(requires at least 1 entry)2>/dev/nullsuppressed errorsreport_fail(soft failure, test continues)exit 1(hard failure, stops the suite)The integration test suite will now correctly fail if the audit service stops recording logs, preventing silent audit compliance gaps.