From fc4698c7aadd5e8e0870a8baf72b79b39c35ca09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Myl=C3=A8ne?= <187286904+mleroy-pass@users.noreply.github.com> Date: Wed, 5 Feb 2025 21:40:17 +0100 Subject: [PATCH] (BSR)[PRO] fix: allure report --- .../dev_on_pull_request_workflow.yml | 80 ++++++++--------- .../workflows/dev_on_push_workflow_main.yml | 90 +++++++++---------- .../workflows/dev_on_workflow_tests_pro.yml | 57 +++++++++++- pro/vite.config.ts | 10 +-- 4 files changed, 141 insertions(+), 96 deletions(-) diff --git a/.github/workflows/dev_on_pull_request_workflow.yml b/.github/workflows/dev_on_pull_request_workflow.yml index 83c1228aafd..84fe0fbe988 100644 --- a/.github/workflows/dev_on_pull_request_workflow.yml +++ b/.github/workflows/dev_on_pull_request_workflow.yml @@ -243,52 +243,52 @@ jobs: GCP_EHP_WORKLOAD_IDENTITY_PROVIDER: ${{ secrets.GCP_EHP_WORKLOAD_IDENTITY_PROVIDER }} GCP_EHP_SERVICE_ACCOUNT: ${{ secrets.GCP_EHP_SERVICE_ACCOUNT }} - merge-allure-reports: - name: "Merge Allure Reports and Push to Allure Repository" - needs: [pcapi-init-job, test-pro] - runs-on: ubuntu-22.04 - if: | - always() && - !cancelled() && needs.test-pro.result != 'skipped' - steps: - - name: "Install Allure CLI via Yarn" - run: yarn global add allure-commandline + # merge-allure-reports: + # name: "Merge Allure Reports and Push to Allure Repository" + # needs: [pcapi-init-job, test-pro] + # runs-on: ubuntu-22.04 + # if: | + # always() && + # !cancelled() && needs.test-pro.result != 'skipped' + # steps: + # - name: "Install Allure CLI via Yarn" + # run: yarn global add allure-commandline - - name: "Download Allure results artifacts for pro" - uses: actions/download-artifact@v4 - with: - name: allure-results-pro-unit - path: allure-results/pro-unit + # - name: "Download Allure results artifacts for pro" + # uses: actions/download-artifact@v4 + # with: + # name: allure-results-pro-unit + # path: allure-results/pro-unit - # - name: "Download Allure results artifacts for pro E2E" - # uses: actions/download-artifact@v4 - # with: - # name: allure-results-pro-e2e - # path: allure-results/pro-e2e + # - name: "Download Allure results artifacts for pro E2E" + # uses: actions/download-artifact@v4 + # with: + # name: allure-results-pro-e2e + # path: allure-results/pro-e2e - - name: "Merge Allure Results" - run: | - mkdir -p allure-results - cp -r allure-results/pro-unit/* allure-results/ + # - name: "Merge Allure Results" + # run: | + # mkdir -p allure-results + # cp -r allure-results/pro-unit/* allure-results/ - - name: "Clone Allure Report Repository to Retrieve History" - env: - TOKEN: ${{ secrets.PAT_ALLURE_REPORTS_TEMP }} - run: | - git clone https://x-access-token:${TOKEN}@github.com/fseguin-pass/allure-reports-temp.git allure-report-temp - mkdir -p allure-results/history - if [ -d "allure-report-temp/history" ]; then - cp -r allure-report-temp/history/* allure-results/history/ - fi + # - name: "Clone Allure Report Repository to Retrieve History" + # env: + # TOKEN: ${{ secrets.PAT_ALLURE_REPORTS_TEMP }} + # run: | + # git clone https://x-access-token:${TOKEN}@github.com/fseguin-pass/allure-reports-temp.git allure-report-temp + # mkdir -p allure-results/history + # if [ -d "allure-report-temp/history" ]; then + # cp -r allure-report-temp/history/* allure-results/history/ + # fi - - name: "Generate Allure Report with History" - run: allure generate allure-results --single-file --clean -o allure-report + # - name: "Generate Allure Report with History" + # run: allure generate allure-results --single-file --clean -o allure-report - - name: "Upload Allure Report as artifact" - uses: actions/upload-artifact@v4 - with: - name: allure-report - path: allure-report/index.html + # - name: "Upload Allure Report as artifact" + # uses: actions/upload-artifact@v4 + # with: + # name: allure-report + # path: allure-report/index.html dependabot-auto-merge: name: "Dependabot" diff --git a/.github/workflows/dev_on_push_workflow_main.yml b/.github/workflows/dev_on_push_workflow_main.yml index fc160a21308..c8b9ea5b47c 100644 --- a/.github/workflows/dev_on_push_workflow_main.yml +++ b/.github/workflows/dev_on_push_workflow_main.yml @@ -241,57 +241,57 @@ jobs: GCP_EHP_WORKLOAD_IDENTITY_PROVIDER: ${{ secrets.GCP_EHP_WORKLOAD_IDENTITY_PROVIDER }} GCP_EHP_SERVICE_ACCOUNT: ${{ secrets.GCP_EHP_SERVICE_ACCOUNT }} - merge-allure-reports: - name: "Merge Allure Reports and Push to Allure Repository" - needs: [test-pro] - runs-on: ubuntu-22.04 - if: | - always() && - !cancelled() && needs.test-pro.result != 'skipped' - steps: - - name: "Install Allure CLI via Yarn" - run: yarn global add allure-commandline + # merge-allure-reports: + # name: "Merge Allure Reports and Push to Allure Repository" + # needs: [test-pro] + # runs-on: ubuntu-22.04 + # if: | + # always() && + # !cancelled() && needs.test-pro.result != 'skipped' + # steps: + # - name: "Install Allure CLI via Yarn" + # run: yarn global add allure-commandline - - name: "Download Allure results artifacts for pro" - uses: actions/download-artifact@v4 - with: - name: allure-results-pro-unit - path: allure-results/pro-unit + # - name: "Download Allure results artifacts for pro" + # uses: actions/download-artifact@v4 + # with: + # name: allure-results-pro-unit + # path: allure-results/pro-unit - # - name: "Download Allure results artifacts for pro E2E" - # uses: actions/download-artifact@v4 - # with: - # name: allure-results-pro-e2e - # path: allure-results/pro-e2e + # - name: "Download Allure results artifacts for pro E2E" + # uses: actions/download-artifact@v4 + # with: + # name: allure-results-pro-e2e + # path: allure-results/pro-e2e - - name: "Merge Allure Results" - run: | - mkdir -p allure-results - cp -r allure-results/pro-unit/* allure-results/ + # - name: "Merge Allure Results" + # run: | + # mkdir -p allure-results + # cp -r allure-results/pro-unit/* allure-results/ - - name: "Clone Allure Report Repository to Retrieve History" - env: - TOKEN: ${{ secrets.PAT_ALLURE_REPORTS_TEMP }} - run: | - git clone https://x-access-token:${TOKEN}@github.com/fseguin-pass/allure-reports-temp.git allure-report-temp - mkdir -p allure-results/history - if [ -d "allure-report-temp/history" ]; then - cp -r allure-report-temp/history/* allure-results/history/ - fi + # - name: "Clone Allure Report Repository to Retrieve History" + # env: + # TOKEN: ${{ secrets.PAT_ALLURE_REPORTS_TEMP }} + # run: | + # git clone https://x-access-token:${TOKEN}@github.com/fseguin-pass/allure-reports-temp.git allure-report-temp + # mkdir -p allure-results/history + # if [ -d "allure-report-temp/history" ]; then + # cp -r allure-report-temp/history/* allure-results/history/ + # fi - - name: "Generate Allure Report with Updated History" - run: allure generate allure-results --clean -o allure-report + # - name: "Generate Allure Report with Updated History" + # run: allure generate allure-results --clean -o allure-report - - name: "Push Updated Allure Report with History to Repository" - run: | - cd allure-report-temp - rm -rf * - cp -r ../allure-report/* . - git config user.name "github-actions[bot]" - git config user.email "github-actions[bot]@users.noreply.github.com" - git add . - git commit -m "Update Allure Report with history" - git push origin main + # - name: "Push Updated Allure Report with History to Repository" + # run: | + # cd allure-report-temp + # rm -rf * + # cp -r ../allure-report/* . + # git config user.name "github-actions[bot]" + # git config user.email "github-actions[bot]@users.noreply.github.com" + # git add . + # git commit -m "Update Allure Report with history" + # git push origin main deploy-storybook: name: "Deploy Storybook" diff --git a/.github/workflows/dev_on_workflow_tests_pro.yml b/.github/workflows/dev_on_workflow_tests_pro.yml index 4687db9cbe5..f266350aab0 100644 --- a/.github/workflows/dev_on_workflow_tests_pro.yml +++ b/.github/workflows/dev_on_workflow_tests_pro.yml @@ -78,7 +78,7 @@ jobs: v1-yarn-pro-dependency-cache-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} - run: yarn install --immutable - name: Run tests with coverage - run: yarn test:unit:ci --reporter=blob --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} + run: yarn test:unit:ci --reporter=blob --reporter=allure-vitest/reporter --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} - name: Upload blob report to GitHub Actions Artifacts if: ${{ !cancelled() }} @@ -92,9 +92,61 @@ jobs: - name: "Upload Allure results for pro tests" uses: actions/upload-artifact@v4 if: always() + with: + name: allure-results-pro-unit-${{ matrix.shardIndex }} + path: pro/allure-results + + merge-allure-reports: + if: ${{ !cancelled() }} && + '$CI_COMMIT_BRANCH == "master"' + needs: [run-tests] + runs-on: ubuntu-latest + steps: + - name: Download allure reports + uses: actions/download-artifact@v4 + with: + path: pro/allure-results + pattern: allure-results-pro-unit-* + + - name: "Upload Allure results for pro tests" + uses: actions/upload-artifact@v4 + if: always() + with: + name: allure-results-pro-unit + path: pro/allure-results + + - name: "Install Allure CLI via Yarn" + run: yarn global add allure-commandline + + - name: "Download Allure results artifacts for pro" + uses: actions/download-artifact@v4 with: name: allure-results-pro-unit - path: allure-results + path: allure-results/pro-unit + + - name: "Merge Allure Results" + run: | + mkdir -p allure-results + cp -r allure-results/pro-unit/* allure-results/ + + - name: "Clone Allure Report Repository to Retrieve History" + env: + TOKEN: ${{ secrets.PAT_ALLURE_REPORTS_TEMP }} + run: | + git clone https://x-access-token:${TOKEN}@github.com/fseguin-pass/allure-reports-temp.git allure-report-temp + mkdir -p allure-results/history + if [ -d "allure-report-temp/history" ]; then + cp -r allure-report-temp/history/* allure-results/history/ + fi + + - name: "Generate Allure Report with History" + run: allure generate allure-results --single-file --clean -o allure-report + + - name: "Upload Allure Report as artifact" + uses: actions/upload-artifact@v4 + with: + name: allure-report + path: allure-report/index.html merge-reports: if: ${{ !cancelled() }} @@ -118,6 +170,7 @@ jobs: key: v1-yarn-pro-dependency-cache-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} restore-keys: | v1-yarn-pro-dependency-cache-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} + - run: yarn install --immutable - name: Download blob reports from GitHub Actions Artifacts uses: actions/download-artifact@v4 diff --git a/pro/vite.config.ts b/pro/vite.config.ts index f7f8665c4bb..5ed65767752 100644 --- a/pro/vite.config.ts +++ b/pro/vite.config.ts @@ -39,15 +39,7 @@ export default defineConfig(({ mode }) => { globals: true, environment: 'jsdom', setupFiles: ['allure-vitest/setup', './vitest.setup.ts'], - reporters: [ - 'verbose', - [ - 'allure-vitest/reporter', - { - resultsDir: '../allure-results', - }, - ], - ], + reporters: ['verbose'], clearMocks: true, restoreMocks: true, cacheDir: '../.vitest_cache',