Skip to content

Commit

Permalink
Add post-execution kafka warnings checks (#556)
Browse files Browse the repository at this point in the history
* Add post-execution kafka warnings checks

* remarks
  • Loading branch information
mensfeld authored Jan 22, 2025
1 parent 97bb4e6 commit 07231f4
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ jobs:
GITHUB_COVERAGE: ${{matrix.coverage}}
run: bundle exec rspec

- 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
2 changes: 1 addition & 1 deletion waterdrop.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Gem::Specification.new do |spec|

spec.cert_chain = %w[certs/cert.pem]
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(spec)/}) }
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
spec.executables = []
spec.require_paths = %w[lib]

spec.metadata = {
Expand Down

0 comments on commit 07231f4

Please sign in to comment.