Separate containerd logs in GitHub Actions' console
`::group::` groups containerd logs by default. https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#grouping-log-lines Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
This commit is contained in:
parent
e47bdbd16f
commit
a76d68ee48
15
.github/workflows/ci.yml
vendored
15
.github/workflows/ci.yml
vendored
@ -411,6 +411,7 @@ jobs:
|
|||||||
path: |
|
path: |
|
||||||
${{github.workspace}}/*-junit.xml
|
${{github.workspace}}/*-junit.xml
|
||||||
${{github.workspace}}/*-gotest.json
|
${{github.workspace}}/*-gotest.json
|
||||||
|
${{github.workspace}}/report/*.log
|
||||||
|
|
||||||
integration-linux:
|
integration-linux:
|
||||||
name: Linux Integration
|
name: Linux Integration
|
||||||
@ -532,10 +533,15 @@ jobs:
|
|||||||
ENABLE_CRI_SANDBOXES: ${{ matrix.enable_cri_sandboxes }}
|
ENABLE_CRI_SANDBOXES: ${{ matrix.enable_cri_sandboxes }}
|
||||||
run: |
|
run: |
|
||||||
BDIR="$(mktemp -d -p $PWD)"
|
BDIR="$(mktemp -d -p $PWD)"
|
||||||
|
mkdir -p ${{github.workspace}}/report
|
||||||
|
|
||||||
function cleanup() {
|
function cleanup() {
|
||||||
sudo pkill containerd || true
|
sudo pkill containerd || true
|
||||||
cat ${BDIR}/containerd-cri.log
|
|
||||||
|
echo ::group::containerd logs
|
||||||
|
cat ${{github.workspace}}/report/containerd.log
|
||||||
|
echo ::endgroup::
|
||||||
|
|
||||||
sudo -E rm -rf ${BDIR}
|
sudo -E rm -rf ${BDIR}
|
||||||
}
|
}
|
||||||
trap cleanup EXIT
|
trap cleanup EXIT
|
||||||
@ -547,9 +553,9 @@ jobs:
|
|||||||
runtime_type = "${TEST_RUNTIME}"
|
runtime_type = "${TEST_RUNTIME}"
|
||||||
EOF
|
EOF
|
||||||
sudo ls /etc/cni/net.d
|
sudo ls /etc/cni/net.d
|
||||||
sudo -E PATH=$PATH /usr/local/bin/containerd -a ${BDIR}/c.sock --config ${BDIR}/config.toml --root ${BDIR}/root --state ${BDIR}/state --log-level debug &> ${BDIR}/containerd-cri.log &
|
sudo -E PATH=$PATH /usr/local/bin/containerd -a ${BDIR}/c.sock --config ${BDIR}/config.toml --root ${BDIR}/root --state ${BDIR}/state --log-level debug &> ${{github.workspace}}/report/containerd.log &
|
||||||
sudo -E PATH=$PATH /usr/local/bin/ctr -a ${BDIR}/c.sock version
|
sudo -E PATH=$PATH /usr/local/bin/ctr -a ${BDIR}/c.sock version
|
||||||
sudo -E PATH=$PATH critest --report-dir "${{github.workspace}}/critestreport" --runtime-endpoint=unix:///${BDIR}/c.sock --parallel=8
|
sudo -E PATH=$PATH critest --report-dir "${{github.workspace}}/report" --runtime-endpoint=unix:///${BDIR}/c.sock --parallel=8
|
||||||
|
|
||||||
# Log the status of this VM to investigate issues like
|
# Log the status of this VM to investigate issues like
|
||||||
# https://github.com/containerd/containerd/issues/4969
|
# https://github.com/containerd/containerd/issues/4969
|
||||||
@ -567,7 +573,8 @@ jobs:
|
|||||||
path: |
|
path: |
|
||||||
*-junit.xml
|
*-junit.xml
|
||||||
*-gotest.json
|
*-gotest.json
|
||||||
${{github.workspace}}/critestreport/*.xml
|
${{github.workspace}}/report/*.xml
|
||||||
|
${{github.workspace}}/report/*.log
|
||||||
|
|
||||||
tests-mac-os:
|
tests-mac-os:
|
||||||
name: MacOS unit tests
|
name: MacOS unit tests
|
||||||
|
2
Makefile
2
Makefile
@ -220,7 +220,7 @@ bin/cri-integration.test:
|
|||||||
|
|
||||||
cri-integration: binaries bin/cri-integration.test ## run cri integration tests (example: FOCUS=TestContainerListStats make cri-integration)
|
cri-integration: binaries bin/cri-integration.test ## run cri integration tests (example: FOCUS=TestContainerListStats make cri-integration)
|
||||||
@echo "$(WHALE) $@"
|
@echo "$(WHALE) $@"
|
||||||
@bash -x ./script/test/cri-integration.sh
|
@bash ./script/test/cri-integration.sh
|
||||||
@rm -rf bin/cri-integration.test
|
@rm -rf bin/cri-integration.test
|
||||||
|
|
||||||
# build runc shimv2 with failpoint control, only used by integration test
|
# build runc shimv2 with failpoint control, only used by integration test
|
||||||
|
@ -59,7 +59,17 @@ ${CMD} --test.run="${FOCUS}" --test.v \
|
|||||||
--containerd-bin="${CONTAINERD_BIN}" \
|
--containerd-bin="${CONTAINERD_BIN}" \
|
||||||
--image-list="${TEST_IMAGE_LIST:-}" && test_exit_code=$? || test_exit_code=$?
|
--image-list="${TEST_IMAGE_LIST:-}" && test_exit_code=$? || test_exit_code=$?
|
||||||
|
|
||||||
test $test_exit_code -ne 0 && \
|
if [[ "$test_exit_code" -ne 0 ]]; then
|
||||||
cat "$REPORT_DIR/containerd.log"
|
if [[ -e "$GITHUB_WORKSPACE" ]]; then
|
||||||
|
mkdir -p "$GITHUB_WORKSPACE/report"
|
||||||
|
mv "$REPORT_DIR/containerd.log" "$GITHUB_WORKSPACE/report"
|
||||||
|
|
||||||
|
echo ::group::containerd logs
|
||||||
|
cat "$GITHUB_WORKSPACE/report/containerd.log"
|
||||||
|
echo ::endgroup::
|
||||||
|
else
|
||||||
|
cat "$REPORT_DIR/containerd.log"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
exit ${test_exit_code}
|
exit ${test_exit_code}
|
||||||
|
Loading…
Reference in New Issue
Block a user