From b9987cceabaaee05fb89de191c5b089e1b9a5490 Mon Sep 17 00:00:00 2001 From: Erik Jan de Wit Date: Wed, 14 May 2025 09:39:27 +0200 Subject: [PATCH 1/2] added junit results xml so we can use existing flaky test detection fixes: #39700 Signed-off-by: Erik Jan de Wit --- .github/workflows/js-ci.yml | 8 ++++++++ js/apps/admin-ui/playwright.config.ts | 8 +++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/js-ci.yml b/.github/workflows/js-ci.yml index 2366ea3a69e9..61a5da96a8b4 100644 --- a/.github/workflows/js-ci.yml +++ b/.github/workflows/js-ci.yml @@ -267,6 +267,14 @@ jobs: path: js/apps/admin-ui/playwright-report retention-days: 30 + - name: Upload test reports + uses: actions/upload-artifact@v4 + if: always() + with: + name: admin-ui-test-report-${{ matrix.browser }} + path: js/apps/admin-ui/test-results + retention-days: 30 + - name: Upload server logs if: always() uses: actions/upload-artifact@v4 diff --git a/js/apps/admin-ui/playwright.config.ts b/js/apps/admin-ui/playwright.config.ts index 2eb54e96dcd8..60eb8a73fee9 100644 --- a/js/apps/admin-ui/playwright.config.ts +++ b/js/apps/admin-ui/playwright.config.ts @@ -11,7 +11,13 @@ export default defineConfig({ forbidOnly: !!process.env.CI, retries: retryCount, workers: 1, - reporter: process.env.CI ? [["github"], ["html"]] : "list", + reporter: process.env.CI + ? [ + ["github"], + ["html", { open: "never" }], + ["junit", { outputFile: "playwright-report/results.xml" }], + ] + : "list", use: { baseURL: "http://localhost:8080", From 777dce4e6ecd487fede7a4d38111208ea0a1c294 Mon Sep 17 00:00:00 2001 From: Erik Jan de Wit Date: Thu, 15 May 2025 07:52:41 +0200 Subject: [PATCH 2/2] always add the job-summary Signed-off-by: Erik Jan de Wit --- .github/actions/upload-flaky-tests/action.yml | 51 ++++++++----------- 1 file changed, 21 insertions(+), 30 deletions(-) diff --git a/.github/actions/upload-flaky-tests/action.yml b/.github/actions/upload-flaky-tests/action.yml index d76580b8e78b..eb7fb984a487 100644 --- a/.github/actions/upload-flaky-tests/action.yml +++ b/.github/actions/upload-flaky-tests/action.yml @@ -14,38 +14,29 @@ runs: shell: bash # language=bash run: | - FLAKES="" SEP="" - for dir in $(find -type d -name 'surefire-reports*'); do - for i in $(grep -l -E '> job-summary.properties - echo "job_url=$JOB_URL" >> job-summary.properties - if [ "$PR" != "" ]; then - echo "pr=$PR" >> job-summary.properties - echo "pr_url=https://github.com/${{ github.repository }}/pull/$PR" >> job-summary.properties - fi - - echo "flakes<> $GITHUB_OUTPUT - echo "job-summary.properties" >> $GITHUB_OUTPUT - echo "$FLAKES" >> $GITHUB_OUTPUT - echo "EOF" >> $GITHUB_OUTPUT + + PR="${{ github.event.number }}" + JOB_NAME="${{ inputs.job-name }}" + + MATRIX="${{ join(matrix.*, ' - ') }}" + if [ "$MATRIX" != "" ]; then + JOB_NAME="$JOB_NAME ($MATRIX)" + fi + + JOB_URL=$(gh api repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/jobs --paginate --jq ".jobs | map(select(.name == \"$JOB_NAME\")) | .[].html_url") + + echo "job_name=$JOB_NAME" >> job-summary.properties + echo "job_url=$JOB_URL" >> job-summary.properties + if [ "$PR" != "" ]; then + echo "pr=$PR" >> job-summary.properties + echo "pr_url=https://github.com/${{ github.repository }}/pull/$PR" >> job-summary.properties fi + + echo "flakes<> $GITHUB_OUTPUT + echo "job-summary.properties" >> $GITHUB_OUTPUT + echo "$FLAKES" >> $GITHUB_OUTPUT + echo "EOF" >> $GITHUB_OUTPUT - uses: actions/upload-artifact@v4 if: ${{ steps.flaky-tests.outputs.flakes }}