jaegertracing / jaeger

CNCF Jaeger, a Distributed Tracing Platform
https://www.jaegertracing.io/
Apache License 2.0
20.52k stars 2.44k forks source link

Reliably dump logs from integration tests #5912

Closed yurishkuro closed 2 months ago

yurishkuro commented 2 months ago

We used to call docker ... log from GitHub Action workflows as a follow-up step when the main step in the workflow fails. However, recently we switched to using docker compose to bring up storage backends, and our integration scripts do docker compose down as a teardown step in the script itself. This means that calling docker compose .. logs from the workflow afterwards does nothing, since the containers are gone. The "right" way to do this is like this: https://github.com/jaegertracing/jaeger/blob/9a30dfc15df4e6712cf02344acae18256781153a/scripts/cassandra-integration-test.sh#L30-L43

Task: apply the above approach to other scripts as needed and clean up their corresponding workflows.

$ rg 'docker compose.*logs' .github
.github/workflows/ci-e2e-elasticsearch.yml
63:      run: docker compose -f ${{ steps.test-execution.outputs.docker_compose_file }} logs

.github/workflows/ci-e2e-opensearch.yml
61:      run: docker compose -f ${{ steps.test-execution.outputs.docker_compose_file }} logs

.github/workflows/ci-e2e-cassandra.yml
49:      run: docker compose -f ${{ steps.test-execution.outputs.docker_compose_file }} logs

.github/workflows/ci-docker-hotrod.yml
62:      run: docker compose -f ./examples/hotrod/docker-compose.yml logs

$ rg 'docker compose.*logs' scripts
scripts/spm-integration-test.sh
142:  docker compose -f $compose_file logs

scripts/es-integration-test.sh
59:    docker compose -f "${compose_file}" logs

scripts/cassandra-integration-test.sh
33:  docker compose -f "${compose_file}" logs

scripts/kafka-integration-test.sh
49:  docker compose -f "${compose_file}" logs
mahadzaryab1 commented 2 months ago

I can pick this up!

mahadzaryab1 commented 2 months ago

@yurishkuro ready for review at https://github.com/jaegertracing/jaeger/pull/5915