Skip to content

Commit

Permalink
Upload logs on integration test failures
Browse files Browse the repository at this point in the history
Logs emitted by integration tests should get attached to actions runs
for analysis now.
  • Loading branch information
tgeoghegan committed Sep 7, 2022
1 parent ab5d9ca commit 94cee06
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
17 changes: 17 additions & 0 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,24 @@ jobs:
- name: Build
run: cargo test --no-run --locked
- name: Test
id: test
env:
JANUS_E2E_LOGS_PATH: ${{ github.workspace }}/test-logs
run: cargo test
# Continue on error so we can upload logs
continue-on-error: true
- name: Upload container logs
# Only get logs on test failure
if: steps.test.outcome == 'failure'
uses: actions/upload-artifact@v3
with:
name: container-logs
path: ${{ github.workspace }}/test-logs/
if-no-files-found: error
# Force overall job to fail if tests fail
- name: test status
if: steps.test.outcome == 'failure'
run: exit 1

janus_lints:
runs-on: ubuntu-latest
Expand Down
3 changes: 2 additions & 1 deletion integration_tests/src/daphne.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ use testcontainers::{
clients::Cli, core::Port, images::generic::GenericImage, Container, RunnableImage,
};
use tokio::{select, sync::oneshot, task, time::interval};
use tracing::debug;

use crate::logs::CopyLogs;

Expand Down Expand Up @@ -310,7 +311,7 @@ impl<'a> CopyLogs for Daphne<'a> {
"--timestamps",
self.daphne_container.id(),
];
tracing::debug!(?args, "invoking docker");
debug!(?args, "invoking docker");
let child_status = Command::new("docker")
.args(args)
.stdin(Stdio::null())
Expand Down

0 comments on commit 94cee06

Please sign in to comment.