diff --git a/.github/workflows/ci-test-e2e.yml b/.github/workflows/ci-test-e2e.yml index 84ebeca360068..473905595170d 100644 --- a/.github/workflows/ci-test-e2e.yml +++ b/.github/workflows/ci-test-e2e.yml @@ -285,6 +285,21 @@ jobs: yarn prepare yarn test:e2e --shard=${{ matrix.shard }}/${{ inputs.total-shard }} + - name: Generate Allure Report + if: always() + run: | + cd apps/meteor + mkdir -p allure-report + # Check if allure-results exists and has content + if [ -d "allure-result-${{ inputs.release }}-${{ matrix.mongodb-version }}-${{ matrix.shard }}" ] && [ "$(find allure-result-${{ inputs.release }}-${{ matrix.mongodb-version }}-${{ matrix.shard }} -name "*.json" | wc -l)" -gt 0 ]; then + echo "📊 Generating Allure report from allure-results directory" + allure generate allure-result --clean -o allure-report + else + echo "⚠️ No Allure results found, creating empty report" + echo '{"uuid":"empty","name":"No tests executed","status":"skipped","start":'$(date +%s000)',"stop":'$(date +%s000)',"steps":[]}' > allure-result-${{ inputs.release }}-${{ matrix.mongodb-version }}-${{ matrix.shard }}/empty-result.json + allure generate allure-result --clean -o allure-report + fi + - name: Store playwright test trace if: inputs.type == 'ui' && always() uses: actions/upload-artifact@v4 @@ -293,6 +308,54 @@ jobs: path: ./apps/meteor/tests/e2e/.playwright* include-hidden-files: true + - name: Store allure result + if: inputs.type == 'ui' && always() + uses: actions/upload-artifact@v4 + with: + name: allure-result-${{ inputs.release }}-${{ matrix.mongodb-version }}-${{ matrix.shard }} + path: ./apps/meteor/allure-result-${{ inputs.release }}-${{ matrix.mongodb-version }}-${{ matrix.shard }}.json + if-no-files-found: ignore + + - name: Store API allure result + if: inputs.type == 'api' && always() + uses: actions/upload-artifact@v4 + with: + name: allure-result-api-${{ inputs.release }}-${{ matrix.mongodb-version }}-${{ matrix.shard }} + path: ./apps/meteor/allure-result-api-${{ inputs.release }}-${{ matrix.mongodb-version }}-${{ matrix.shard }}.json + if-no-files-found: ignore + + - name: Store allure report + if: inputs.type == 'ui' && always() + uses: actions/upload-artifact@v4 + with: + name: allure-report-${{ inputs.release }}-${{ matrix.mongodb-version }}-${{ matrix.shard }} + path: ./apps/meteor/allure-report-${{ inputs.release }}-${{ matrix.mongodb-version }}-${{ matrix.shard }}.json + if-no-files-found: ignore + + - name: Store API allure report + if: inputs.type == 'api' && always() + uses: actions/upload-artifact@v4 + with: + name: allure-report-api-${{ inputs.release }}-${{ matrix.mongodb-version }}-${{ matrix.shard }} + path: ./apps/meteor/allure-report-api-${{ inputs.release }}-${{ matrix.mongodb-version }}-${{ matrix.shard }}.json + if-no-files-found: ignore + + - name: Upload JUnit report as artifacts + if: inputs.type == 'ui' && always() + uses: actions/upload-artifact@v4 + with: + name: junit-report-${{ inputs.release }}-${{ matrix.mongodb-version }}-${{ matrix.shard }} + path: ./apps/meteor/junit-report-${{ inputs.release }}-${{ matrix.mongodb-version }}-${{ matrix.shard }}/.xml + if-no-files-found: ignore + + - name: Upload JUnit report as artifacts + if: inputs.type == 'api' && always() + uses: actions/upload-artifact@v4 + with: + name: junit-report-api-${{ inputs.release }}-${{ matrix.mongodb-version }}-${{ matrix.shard }} + path: ./apps/meteor/junit-report-api-${{ inputs.release }}-${{ matrix.mongodb-version }}-${{ matrix.shard }}/.xml + if-no-files-found: ignore + - name: Show server logs if E2E test failed if: failure() && inputs.release == 'ee' run: docker compose -f docker-compose-ci.yml logs @@ -338,3 +401,53 @@ jobs: name: e2e-ee-coverage-${{ matrix.mongodb-version }}-${{ matrix.shard }} path: ./apps/meteor/coverage* include-hidden-files: true + + - name: Publish Allure Report to GitHub Pages + if: github.event_name == 'pull_request' || github.ref == 'refs/heads/main' + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./apps/meteor/allure-report + destination_dir: allure-report/e2e-${{ inputs.release }}-${{ matrix.mongodb-version }}-${{ matrix.shard }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Comment PR with Allure Report Link + if: github.event_name == 'pull_request' && always() + uses: actions/github-script@v7 + with: + script: | + const { data: comments } = await github.rest.issues.listComments({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number, + }); + const botComment = comments.find(comment => + comment.user.type === 'Bot' && + comment.body.includes('Allure Report') + ); + const reportUrl = `https://${context.repo.owner}.github.io/${context.repo.repo}/allure-report/e2e-${{ inputs.release }}-${{ matrix.mongodb-version }}-${{ matrix.shard }}/`; + const commentBody = `## 📊 E2E Test Results + **Allure Report**: [View Report](${reportUrl}) + **Test Run**: #${{ github.run_number }} + 📥 **Download Reports**: + - [Allure Results](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts) + - [Allure Report](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts) + - [JUnit Report](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts) + --- + *Reports are generated automatically for this PR*`; + if (botComment) { + await github.rest.issues.updateComment({ + owner: context.repo.owner, + repo: context.repo.repo, + comment_id: botComment.id, + body: commentBody, + }); + } else { + await github.rest.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number, + body: commentBody, + }); + } diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7d94af3025df4..247e243135dec 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -247,54 +247,9 @@ jobs: deno-version: ${{ needs.release-versions.outputs.deno-version }} coverage: false - # TODO: this should go away once upstream builds are fixed - build-matrix-rust-bindings-for-alpine: - name: Builds matrix rust bindings against alpine - runs-on: ubuntu-24.04 - steps: - - name: check cache for matrix-rust-sdk-crypto-nodejs - id: matrix-rust-sdk-crypto-nodejs - uses: actions/cache@v4 - with: - path: /tmp/build/matrix-sdk-crypto.linux-x64-musl.node - key: matrix-rust-sdk-crypto-nodejs-v0.2.0-beta.1 - - - uses: actions/checkout@v4 - with: - repository: matrix-org/matrix-rust-sdk-crypto-nodejs - ref: v0.2.0-beta.1 # https://github.com/element-hq/matrix-bot-sdk/blob/e72a4c498e00c6c339a791630c45d00a351f56a8/package.json#L58 - - - if: steps.matrix-rust-sdk-crypto-nodejs.outputs.cache-hit != 'true' - run: sudo apt-get install -y musl-tools libunwind-dev && find /usr/include -name stdarg.h 2>/dev/null || true - - - if: steps.matrix-rust-sdk-crypto-nodejs.outputs.cache-hit != 'true' - uses: actions/setup-node@v4.4.0 - with: - node-version: 22.16.0 - - - if: steps.matrix-rust-sdk-crypto-nodejs.outputs.cache-hit != 'true' - uses: actions-rust-lang/setup-rust-toolchain@v1 - with: - toolchain: '1.76' - target: x86_64-unknown-linux-musl - - - if: steps.matrix-rust-sdk-crypto-nodejs.outputs.cache-hit != 'true' - name: Install ziglang - uses: mlugg/setup-zig@v1 - with: - version: 0.13.0 - - - if: steps.matrix-rust-sdk-crypto-nodejs.outputs.cache-hit != 'true' - name: Build - run: | - npm install --ignore-scripts - npx napi build --release --target x86_64-unknown-linux-musl --platform --zig - mkdir -p /tmp/build - mv matrix-sdk-crypto.linux-x64-musl.node /tmp/build/matrix-sdk-crypto.linux-x64-musl.node - build-gh-docker-coverage: name: 🚢 Build Docker Images for Testing - needs: [build, release-versions, build-matrix-rust-bindings-for-alpine] + needs: [build, release-versions] runs-on: ubuntu-24.04 env: @@ -323,11 +278,6 @@ jobs: build-containers: ${{ matrix.platform == needs.release-versions.outputs.official-platform && 'authorization-service account-service ddp-streamer-service presence-service stream-hub-service queue-worker-service omnichannel-transcript-service' || '' }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - - name: Make sure matrix bindings load - if: (github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'release' || github.ref == 'refs/heads/develop') && matrix.platform == 'alpine' && github.actor != 'dependabot[bot]' - run: | - docker run --rm -w /app/bundle/programs/server/npm/node_modules/matrix-appservice-bridge ghcr.io/rocketchat/rocket.chat:$RC_DOCKER_TAG -e 'require(".")' - - name: Rename official Docker tag to GitHub Container Registry if: matrix.platform == needs.release-versions.outputs.official-platform && (github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'release' || github.ref == 'refs/heads/develop') && github.actor != 'dependabot[bot]' run: | @@ -536,10 +486,40 @@ jobs: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} REPORTER_JIRA_ROCKETCHAT_API_KEY: ${{ secrets.REPORTER_JIRA_ROCKETCHAT_API_KEY }} + allure-report: + name: 📊 Generate Allure Report + runs-on: ubuntu-24.04 + needs: [test-api, test-api-ee, test-ui, test-ui-ee, test-ui-ee-watcher] + if: always() && (needs.test-api.result != 'skipped' || needs.test-api-ee.result != 'skipped' || needs.test-ui.result != 'skipped' || needs.test-ui-ee.result != 'skipped' || needs.test-ui-ee-watcher.result != 'skipped') + steps: + - uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '18' + + - name: Download all test results + uses: actions/download-artifact@v4 + with: + pattern: allure-result-* + merge-multiple: true + path: ./downloaded-artifacts + + - name: Publish Allure Report to GitHub Pages + if: github.event_name == 'pull_request' || github.ref == 'refs/heads/main' + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./apps/meteor/allure-report + destination_dir: allure-report/e2e-${{ inputs.release }}-${{ matrix.mongodb-version }}-${{ matrix.shard }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + tests-done: name: ✅ Tests Done runs-on: ubuntu-24.04 - needs: [checks, test-unit, test-api, test-ui, test-api-ee, test-ui-ee, test-ui-ee-watcher] + needs: [checks, test-unit, test-api, test-ui, test-api-ee, test-ui-ee, test-ui-ee-watcher, allure-report] if: always() steps: - name: Test finish aggregation diff --git a/apps/meteor/package.json b/apps/meteor/package.json index 926fa5487530f..59ca38f12ebf2 100644 --- a/apps/meteor/package.json +++ b/apps/meteor/package.json @@ -34,6 +34,8 @@ "typecheck": "meteor lint && cross-env NODE_OPTIONS=\"--max-old-space-size=8192\" tsc --noEmit --skipLibCheck", "coverage": "TS_NODE_COMPILER_OPTIONS='{\"module\": \"commonjs\"}' nyc -r html mocha --config ./.mocharc.js", "test:e2e": "playwright test", + "allure:generate": "allure generate allure-results --clean -o allure-report", + "allure:open": "allure open allure-report", "test:e2e:federation": "playwright test --config=playwright-federation.config.ts", "test:e2e:nyc": "nyc report --reporter=lcov", "testapi": "TS_NODE_COMPILER_OPTIONS='{\"module\": \"commonjs\"}' mocha --config ./.mocharc.api.js", @@ -158,6 +160,7 @@ "@types/xml-encryption": "~1.2.4", "@typescript-eslint/eslint-plugin": "~5.60.1", "@typescript-eslint/parser": "~5.60.1", + "allure-playwright": "3.1.0", "autoprefixer": "^9.8.8", "babel-loader": "~10.0.0", "babel-plugin-array-includes": "^2.0.3", @@ -189,6 +192,7 @@ "nyc": "^17.1.0", "outdent": "~0.8.0", "pino-pretty": "^7.6.1", + "playwright": "1.52.0", "playwright-core": "~1.52.0", "playwright-qase-reporter": "~2.1.6", "postcss": "~8.4.49", diff --git a/apps/meteor/playwright.config.ts b/apps/meteor/playwright.config.ts index 1b27badd2e2d3..e0069c58e55b7 100644 --- a/apps/meteor/playwright.config.ts +++ b/apps/meteor/playwright.config.ts @@ -22,6 +22,7 @@ export default { outputDir: 'tests/e2e/.playwright', reporter: [ ['list'], + ['allure-playwright'], process.env.REPORTER_ROCKETCHAT_REPORT === 'true' && [ './reporters/rocketchat.ts', {