From a647ec800e1e5ff6c944c354d08e4a85ae9eaeba Mon Sep 17 00:00:00 2001 From: Andrea Panattoni Date: Mon, 30 Oct 2023 17:14:08 +0100 Subject: [PATCH] e2e: Add cluster-info as job artifact Use `kubectl cluster-info dump` to retrieve useful debug information at the end of the end-to-end test run. Signed-off-by: Andrea Panattoni --- .github/workflows/test.yml | 13 ++++++++----- hack/run-e2e-conformance-virtual-cluster.sh | 11 ++++++++++- hack/run-e2e-conformance-virtual-ocp.sh | 11 ++++++++++- 3 files changed, 28 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1b41ae30a9..75696ffde6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -101,6 +101,8 @@ jobs: golangci, ] runs-on: [ sriov ] + env: + TEST_REPORT_PATH: k8s-artifacts steps: - name: Check out code into the Go module directory uses: actions/checkout@v2 @@ -116,8 +118,8 @@ jobs: - uses: actions/upload-artifact@v3 if: always() with: - name: k8s-artifact - path: ./k8s-artifacts + name: ${{ env.TEST_REPORT_PATH }} + path: ./${{ env.TEST_REPORT_PATH }} - name: remove virtual cluster if: always() @@ -132,8 +134,9 @@ jobs: test, golangci, ] - runs-on: [ ocp ] + env: + TEST_REPORT_PATH: ocp-artifacts steps: - name: Check out code into the Go module directory uses: actions/checkout@v2 @@ -149,8 +152,8 @@ jobs: - uses: actions/upload-artifact@v3 if: always() with: - name: ocp-artifact - path: ./ocp-artifacts + name: ${{ env.TEST_REPORT_PATH }} + path: ./${{ env.TEST_REPORT_PATH }} - name: remove virtual cluster if: always() diff --git a/hack/run-e2e-conformance-virtual-cluster.sh b/hack/run-e2e-conformance-virtual-cluster.sh index 8bba27e2f1..4a721c6c7d 100755 --- a/hack/run-e2e-conformance-virtual-cluster.sh +++ b/hack/run-e2e-conformance-virtual-cluster.sh @@ -364,5 +364,14 @@ hack/deploy-wait.sh if [ -z $SKIP_TEST ]; then echo "## run sriov e2e conformance tests" - SUITE=./test/conformance JUNIT_OUTPUT=`pwd`/k8s-artifacts hack/run-e2e-conformance.sh + + if [[ -v TEST_REPORT_PATH ]]; then + JUNIT_OUTPUT="${root}/${TEST_REPORT_PATH}/conformance-test-report" + fi + + SUITE=./test/conformance hack/run-e2e-conformance.sh + + if [[ -v TEST_REPORT_PATH ]]; then + kubectl cluster-info dump --namespaces ${NAMESPACE} --output-directory "${root}/${TEST_REPORT_PATH}/cluster-info" + fi fi diff --git a/hack/run-e2e-conformance-virtual-ocp.sh b/hack/run-e2e-conformance-virtual-ocp.sh index 4509af2259..3a4b2ed3e1 100755 --- a/hack/run-e2e-conformance-virtual-ocp.sh +++ b/hack/run-e2e-conformance-virtual-ocp.sh @@ -239,5 +239,14 @@ hack/deploy-wait.sh if [ -z $SKIP_TEST ]; then echo "## run sriov e2e conformance tests" - SUITE=./test/conformance JUNIT_OUTPUT=`pwd`/ocp-artifacts hack/run-e2e-conformance.sh + + if [[ -v TEST_REPORT_PATH ]]; then + JUNIT_OUTPUT="${root}/${TEST_REPORT_PATH}/conformance-test-report" + fi + + SUITE=./test/conformance hack/run-e2e-conformance.sh + + if [[ -v TEST_REPORT_PATH ]]; then + kubectl cluster-info dump --namespaces ${NAMESPACE} --output-directory "${root}/${TEST_REPORT_PATH}/cluster-info" + fi fi