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: get container logs on console in e2es #685

Merged
merged 7 commits into from
Feb 22, 2024
Merged
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
16 changes: 13 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,11 @@ jobs:
run: ./tools/db/kordis-db.sh init e2edb
- name: Start API and SPA containers
run: |
docker run -d -p 3000:3333 -e MONGODB_URI=mongodb://host.docker.internal:27017/e2edb kordis-api:${{ github.sha }}
docker run -d -p 4200:8080 -e API_URL=http://localhost:3000 -e AUTH_PROVIDER=dev kordis-spa:${{ github.sha }}
docker run -d --name kordis-api-container -p 3000:3333 -e MONGODB_URI=mongodb://172.17.0.1:27017/e2edb -e AUTH_PROVIDER=dev kordis-api:${{ github.sha }}
docker run -d --name kordis-spa-container -p 4200:8080 -e API_URL=http://localhost:3000 kordis-spa:${{ github.sha }}
- name: Run E2Es
run: npx wait-on -t 30s tcp:3000 && npx wait-on -t 30s http://localhost:4200 && npx nx e2e spa-e2e --skipInstall
id: e2e-tests
run: npx wait-on -t 90s http://localhost:3000/health-check && npx wait-on -t 30s http://localhost:4200 && npx nx e2e spa-e2e --skipInstall
env:
E2E_BASE_URL: http://localhost:4200/
- uses: actions/upload-artifact@v4
Expand All @@ -75,6 +76,15 @@ jobs:
name: e2e-test-results
path: test-results/
if-no-files-found: ignore
- name: Print Container Logs
if: ${{ failure() && steps.e2e-tests.conclusion == 'failure' }}
run: |
echo "::group::Kordis API Container Logs"
docker logs kordis-api-container
echo "::endgroup::"
echo "::group::Kordis SPA Container Logs"
docker logs kordis-spa-container
echo "::endgroup::"

- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
Expand Down