gha: Store journalctl logs

This PR stores the journalctl logs.

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
This commit is contained in:
Gabriela Cervantes 2024-02-27 21:36:16 +00:00
parent 342d3a320d
commit 7299dbdb43
2 changed files with 8 additions and 5 deletions

View File

@ -85,14 +85,14 @@ jobs:
timeout-minutes: 30
run: bash tests/integration/kubernetes/gha-run.sh run-tests
- name: Collect artifacts
- name: Collect artifacts ${{ matrix.vmm }}
run: bash tests/integration/kubernetes/gha-run.sh collect-artifacts
- name: Archive artifacts
- name: Archive artifacts ${{ matrix.vmm }}
uses: actions/upload-artifact@v3
with:
name: k8s-tests-garm-${{ matrix.vmm }}
path: artifacts-${{ matrix.vmm }}.tar.gz
path: /tmp/artifacts
retention-days: 1
if-no-files-found: error

View File

@ -195,6 +195,7 @@ function run_tests() {
pushd "${kubernetes_dir}"
bash setup.sh
export start_time=$(date '+%Y-%m-%d %H:%M:%S')
if [[ "${KATA_HYPERVISOR}" = "dragonball" ]] && [[ "${SNAPSHOTTER}" = "devmapper" ]] || [[ "${KATA_HYPERVISOR}" = "cloud-hypervisor" ]] && [[ "${SNAPSHOTTER}" = "devmapper" ]]; then
# cloud-hypervisor runtime-rs issue is https://github.com/kata-containers/kata-containers/issues/9034
echo "Skipping tests for $KATA_HYPERVISOR using devmapper"
@ -210,8 +211,10 @@ function collect_artifacts() {
rm -rf "${artifacts_dir}"
fi
mkdir -p "${artifacts_dir}"
info "Running teardown script to collect artifacts using ${KATA_HYPERVISOR} hypervisor"
bash "${kubernetes_dir}/../../../ci/teardown.sh" "${artifacts_dir}"
info "Collecting artifacts using ${KATA_HYPERVISOR} hypervisor"
local journalctl_log_filename="journalctl.log"
local journalctl_log_path="${artifacts_dir}/${journalctl_log_filename}"
sudo journalctl --since="$start_time" > "${journalctl_log_path}"
}
function cleanup_kata_deploy() {