diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index 229aba540..c0ccc8e87 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -173,6 +173,8 @@ jobs: runs-on: ubuntu-latest needs: [integration-tests] if: always() && github.repository == 'linode/linode_api4-python' # Run even if integration tests fail and only on main repository + outputs: + summary: ${{ steps.set-test-summary.outputs.summary }} steps: - name: Checkout code @@ -197,7 +199,6 @@ jobs: - name: Set release version env run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV - - name: Add variables and upload test results if: always() run: | @@ -213,12 +214,24 @@ jobs: LINODE_CLI_OBJ_ACCESS_KEY: ${{ secrets.LINODE_CLI_OBJ_ACCESS_KEY }} LINODE_CLI_OBJ_SECRET_KEY: ${{ secrets.LINODE_CLI_OBJ_SECRET_KEY }} + - name: Generate test summary and save to output + id: set-test-summary + run: | + filename=$(ls | grep -E '^[0-9]{12}_sdk_test_report\.xml$') + test_output=$(python3 e2e_scripts/tod_scripts/generate_test_summary.py "${filename}") + { + echo 'summary<> "$GITHUB_OUTPUT" + notify-slack: runs-on: ubuntu-latest - needs: [integration-tests] + needs: [integration-tests, process-upload-report] if: ${{ (success() || failure()) }} # Run even if integration tests fail and only on main repository steps: - name: Notify Slack + id: main_message uses: slackapi/slack-github-action@v2.0.0 with: method: chat.postMessage @@ -229,7 +242,7 @@ jobs: - type: section text: type: mrkdwn - text: ":rocket: *${{ github.workflow }} Completed in: ${{ github.repository }}* :white_check_mark:" + text: ":rocket: *${{ github.workflow }} Completed in: ${{ github.repository }}* ${{ needs.integration-tests.result == 'success' && ':white_check_mark:' || ':failed:' }}" - type: divider - type: section fields: @@ -247,4 +260,15 @@ jobs: - type: context elements: - type: mrkdwn - text: "Triggered by: :bust_in_silhouette: `${{ github.actor }}`" \ No newline at end of file + text: "Triggered by: :bust_in_silhouette: `${{ github.actor }}`" + + - name: Test summary thread + if: success() + uses: slackapi/slack-github-action@v2.0.0 + with: + method: chat.postMessage + token: ${{ secrets.SLACK_BOT_TOKEN }} + payload: | + channel: ${{ secrets.SLACK_CHANNEL_ID }} + thread_ts: "${{ steps.main_message.outputs.ts }}" + text: "${{ needs.process-upload-report.outputs.summary }}" diff --git a/e2e_scripts b/e2e_scripts index 0f2ff0169..5d0054351 160000 --- a/e2e_scripts +++ b/e2e_scripts @@ -1 +1 @@ -Subproject commit 0f2ff016956090c6fff046f4479e7efe8d0086e5 +Subproject commit 5d0054351277faa68a224172674210795cb36646