From a1cb280fdd4bde8c4a32b31292e1198b066af364 Mon Sep 17 00:00:00 2001 From: Nithya Subramanian <98416062+nithyatsu@users.noreply.github.com> Date: Thu, 16 May 2024 10:11:08 -0700 Subject: [PATCH] add functional test results to artifacts (#7583) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Description Add functional test results as an artifact so we can download it. Currently, rerun erases a functional test run's result and there is no easy way to download/process the results. Sample artifact that is produced after adding these changes is in the summary of [Functional tests ยท radius-project/radius@65bed3d (github.com)](https://github.com/radius-project/radius/actions/runs/9023474283) Name of the artifact is functional_test_results ## Type of change - This pull request adds or changes features of Radius and has an approved issue (issue link required). Fixes: #6727 --------- Signed-off-by: nithyatsu --- .github/actions/process-test-results/action.yaml | 1 + .github/workflows/functional-test.yaml | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/.github/actions/process-test-results/action.yaml b/.github/actions/process-test-results/action.yaml index 22eceee76c..4ed388cd6a 100644 --- a/.github/actions/process-test-results/action.yaml +++ b/.github/actions/process-test-results/action.yaml @@ -56,6 +56,7 @@ runs: uses: EnricoMi/publish-unit-test-result-action@v2 if: always() with: + check_name: ${{ inputs.test_group_name }} files: | ${{ inputs.result_directory }}/processed/*.xml - name: 'Upload ${{ inputs.test_group_name }} Results' diff --git a/.github/workflows/functional-test.yaml b/.github/workflows/functional-test.yaml index ef64ea65e7..25a89476a6 100644 --- a/.github/workflows/functional-test.yaml +++ b/.github/workflows/functional-test.yaml @@ -546,6 +546,8 @@ jobs: run: | # Ensure rad cli is in path before running tests. export PATH=$GITHUB_WORKSPACE/bin:$PATH + # Make directory to capture functional test results + mkdir -p ./dist/functional_test cd $GITHUB_WORKSPACE which rad || { echo "cannot find rad"; exit 1; } @@ -575,6 +577,15 @@ jobs: BICEP_RECIPE_REGISTRY: ${{ env.BICEP_RECIPE_REGISTRY }} BICEP_RECIPE_TAG_VERSION: ${{ env.BICEP_RECIPE_TAG_VERSION }} GH_TOKEN: ${{ steps.get_installation_token.outputs.token }} + GOTESTSUM_OPTS: '--junitfile ./dist/functional_test/results.xml' + - name: Process Functional Test Results + uses: ./.github/actions/process-test-results + # In case of failure, upload functional_test_results to artifacts so that they are not erased by subsequent runs. + if: failure() && github.repository == 'radius-project/radius' + with: + test_group_name: 'Functional Tests - ${{ matrix.name }}' + artifact_name: 'functional_test_results_${{ matrix.name }}' + result_directory: 'dist/functional_test/' - uses: azure/setup-kubectl@v4 if: always() with: