Skip to content

Commit

Permalink
Add post-execution kafka warnings checks
Browse files Browse the repository at this point in the history
  • Loading branch information
mensfeld committed Jan 22, 2025
1 parent 97bb4e6 commit 5f4359c
Show file tree
Hide file tree
Showing 3 changed files with 24 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
20 changes: 20 additions & 0 deletions bin/verify_kafka_warnings
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

# Checks Kafka logs for warning patterns that indicate incorrect Karafka usage
# These warnings should never occur as Karafka should prevent such operations

patterns=(
"as well as transactional"
)

found=0
for pattern in "${patterns[@]}"; do
output=$(docker logs kafka | grep WARN | grep "$pattern")
if [ -n "$output" ]; then
echo "Found warning pattern: $pattern"
echo "$output"
found=1
fi
done

exit $found
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 5f4359c

Please sign in to comment.