From 5d7c24f07a1f8af0a42842e83b10b0a2674407e0 Mon Sep 17 00:00:00 2001 From: Saturnino Abril <5334504+saturninoabril@users.noreply.github.com> Date: Wed, 4 Feb 2026 09:04:23 +0800 Subject: [PATCH] (fix): verified by label and playwright rerun on failed specs --- .github/workflows/e2e-tests-ci.yml | 2 +- .../workflows/e2e-tests-override-status.yml | 2 +- .../workflows/e2e-tests-verified-label.yml | 30 ++++++++----------- e2e-tests/.ci/server.run_specs.sh | 30 +++++++++++++++++-- 4 files changed, 41 insertions(+), 23 deletions(-) diff --git a/.github/workflows/e2e-tests-ci.yml b/.github/workflows/e2e-tests-ci.yml index 06aaa7160ac..75f74d9fe49 100644 --- a/.github/workflows/e2e-tests-ci.yml +++ b/.github/workflows/e2e-tests-ci.yml @@ -1,5 +1,5 @@ --- -name: E2E Tests +name: E2E Tests (smoke-then-full) on: # Argo Events Trigger (automated): # - Triggered by: Enterprise CI/docker-image status check (success) diff --git a/.github/workflows/e2e-tests-override-status.yml b/.github/workflows/e2e-tests-override-status.yml index dabc9efce1f..3fbe2ffa78b 100644 --- a/.github/workflows/e2e-tests-override-status.yml +++ b/.github/workflows/e2e-tests-override-status.yml @@ -37,7 +37,7 @@ jobs: COMMIT_SHA: ${{ steps.pr-info.outputs.head_sha }} run: | # Only full tests can be overridden (smoke tests must pass) - FULL_TEST_CONTEXTS=("E2E Tests/playwright-full" "E2E Tests/cypress-full") + FULL_TEST_CONTEXTS=("E2E Tests / playwright-full" "E2E Tests / cypress-full") for CONTEXT_NAME in "${FULL_TEST_CONTEXTS[@]}"; do echo "Checking: $CONTEXT_NAME" diff --git a/.github/workflows/e2e-tests-verified-label.yml b/.github/workflows/e2e-tests-verified-label.yml index 3edf13df643..aa0bdaa8dc9 100644 --- a/.github/workflows/e2e-tests-verified-label.yml +++ b/.github/workflows/e2e-tests-verified-label.yml @@ -19,13 +19,13 @@ jobs: GH_TOKEN: ${{ github.token }} LABEL_AUTHOR: ${{ github.event.sender.login }} run: | - # Check if user is a member of mattermost org - HTTP_STATUS=$(gh api orgs/mattermost/members/${LABEL_AUTHOR} --silent -i 2>/dev/null | head -1 | awk '{print $2}') - if [[ "$HTTP_STATUS" != "204" ]]; then - echo "User ${LABEL_AUTHOR} is not a member of mattermost org (status: ${HTTP_STATUS})" + # Check if user has write permission to the repository + PERMISSION=$(gh api repos/${{ github.repository }}/collaborators/${LABEL_AUTHOR}/permission --jq '.permission' 2>/dev/null || echo "none") + if [[ "$PERMISSION" != "admin" && "$PERMISSION" != "write" ]]; then + echo "User ${LABEL_AUTHOR} doesn't have write permission to the repository (permission: ${PERMISSION})" exit 1 fi - echo "User ${LABEL_AUTHOR} is a member of mattermost org" + echo "User ${LABEL_AUTHOR} has ${PERMISSION} permission to the repository" - name: ci/override-failed-statuses id: override @@ -34,7 +34,7 @@ jobs: COMMIT_SHA: ${{ github.event.pull_request.head.sha }} run: | # Only full tests can be overridden (smoke tests must pass) - FULL_TEST_CONTEXTS=("E2E Tests/playwright-full" "E2E Tests/cypress-full") + FULL_TEST_CONTEXTS=("E2E Tests / playwright-full" "E2E Tests / cypress-full") OVERRIDDEN="" WEBHOOK_DATA="[]" @@ -62,18 +62,12 @@ jobs: continue fi - # Parse and construct new message - if [[ "$CURRENT_DESC" =~ ^([0-9]+)\ failed,\ ([0-9]+)\ passed ]]; then - FAILED="${BASH_REMATCH[1]}" - PASSED="${BASH_REMATCH[2]}" - NEW_MSG="${FAILED} failed (verified), ${PASSED} passed" - elif [[ "$CURRENT_DESC" =~ ^([0-9]+)\ failed\ \([^)]+\),\ ([0-9]+)\ passed ]]; then - FAILED="${BASH_REMATCH[1]}" - PASSED="${BASH_REMATCH[2]}" - NEW_MSG="${FAILED} failed (verified), ${PASSED} passed" - else - NEW_MSG="${CURRENT_DESC} (verified)" - fi + # Prefix existing description + if [ -n "$CURRENT_DESC" ]; then + NEW_MSG="(verified) ${CURRENT_DESC}" + else + NEW_MSG="(verified)" + fi echo " New: $NEW_MSG" diff --git a/e2e-tests/.ci/server.run_specs.sh b/e2e-tests/.ci/server.run_specs.sh index 920f1812e61..8c6d7ed23b4 100755 --- a/e2e-tests/.ci/server.run_specs.sh +++ b/e2e-tests/.ci/server.run_specs.sh @@ -55,13 +55,37 @@ playwright) # Convert comma-separated to space-separated for playwright SPEC_ARGS=$(echo "$SPEC_FILES" | tr ',' ' ') + # Initialize playwright report and logs directory + ${MME2E_DC_SERVER} exec -T -u "$MME2E_UID" -- playwright bash <../playwright/results/summary.json <