Skip to content

Commit

Permalink
verify post execution kafka warnings (#510)
Browse files Browse the repository at this point in the history
* verify post execution kafka warnings

* fix
  • Loading branch information
mensfeld authored Jan 22, 2025
1 parent 00b7ee4 commit 3c94af9
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ jobs:
KARAFKA_PRO_LICENSE_TOKEN: ${{ secrets.KARAFKA_PRO_LICENSE_TOKEN }}
run: bin/rspecs

- name: Check Kafka logs for unexpected warnings
run: bin/verify_kafka_warnings

diffend:
runs-on: ubuntu-latest
strategy:
Expand Down
31 changes: 31 additions & 0 deletions bin/verify_kafka_warnings
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash

# Checks Kafka logs for unsupported warning patterns
# Only specified warnings are allowed, all others should trigger failure

allowed_patterns=(
"Performing controller activation"
"registered with feature metadata.version"
)

# Get all warnings
warnings=$(docker logs kafka | grep WARN)
exit_code=0

while IFS= read -r line; do
allowed=0
for pattern in "${allowed_patterns[@]}"; do
if echo "$line" | grep -q "$pattern"; then
allowed=1
break
fi
done

if [ $allowed -eq 0 ]; then
echo "Unexpected warning found:"
echo "$line"
exit_code=1
fi
done <<< "$warnings"

exit $exit_code

0 comments on commit 3c94af9

Please sign in to comment.