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

Always output docker logs in CI #371

Merged
merged 4 commits into from
Sep 27, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 13 additions & 1 deletion .github/workflows/built_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -483,13 +483,17 @@ jobs:
DATABASE_IMAGE_NAME: ${{ matrix.databaseImageName }}
run: make test SUITE=${{ matrix.suite }}

- name: Report
- name: Report Selenium
if: always()
run: |
cd test/reporter
npm install
SUITE=${{ matrix.suite }} node report.js

- name: docker logs
if: always()
run: test/docker_logs.sh

- name: Archive docker test artifacts
uses: actions/upload-artifact@v3
if: always()
Expand Down Expand Up @@ -529,6 +533,10 @@ jobs:
timeout-minutes: 10
run: make test-upgrade VERSION=${{ matrix.version }} TO_VERSION=${{ env.env_file }}

- name: docker logs
if: always()
run: test/docker_logs.sh

- name: Archive docker test artifacts
uses: actions/upload-artifact@v3
if: always()
Expand Down Expand Up @@ -565,6 +573,10 @@ jobs:
timeout-minutes: 10
run: make test-upgrade VERSION=${{ matrix.version }} TO_VERSION=${{ env.env_file }}

- name: docker logs
if: always()
run: test/docker_logs.sh

- name: Archive docker test artifacts
uses: actions/upload-artifact@v3
if: always()
Expand Down
10 changes: 10 additions & 0 deletions test/docker_logs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
# run `docker logs` for all containers
# Used in CI for outputing all logs when a run has failed
set -e

for container in $(docker ps --all | awk '{if(NR>1) print $NF}')
do
echo "Container: $container"
docker logs "$container"
done