Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix] Print Kafka logs on test failure #5873

Merged
merged 3 commits into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .github/workflows/ci-e2e-kafka.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ jobs:
id: test-execution
run: bash scripts/kafka-integration-test.sh -j ${{ matrix.jaeger-version }}

- name: Output Kafka logs on failure
run: docker compose -f ${{ steps.test-execution.outputs.docker_compose_file }} logs
if: ${{ failure() }}

- name: Upload coverage to codecov
uses: ./.github/actions/upload-codecov
with:
Expand Down
12 changes: 12 additions & 0 deletions scripts/kafka-integration-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ echo "docker_compose_file=${compose_file}" >> "${GITHUB_OUTPUT:-/dev/null}"

jaeger_version=""
manage_kafka="true"
success="false"

print_help() {
echo "Usage: $0 [-K] -j <jaeger_version>"
Expand Down Expand Up @@ -43,7 +44,16 @@ setup_kafka() {
docker compose -f "${compose_file}" up -d kafka
}

dump_logs() {
echo "::group::Kafka logs"
docker compose -f "${compose_file}" logs
yurishkuro marked this conversation as resolved.
Show resolved Hide resolved
echo "::endgroup::"
}

teardown_kafka() {
if [[ "$success" == "false" ]]; then
dump_logs
fi
echo "Stopping Kafka..."
docker compose -f "${compose_file}" down
}
Expand Down Expand Up @@ -98,6 +108,8 @@ main() {
wait_for_kafka

run_integration_test

success="true"
}

main "$@"
Loading