Skip to content

Commit

Permalink
(BSR)[PRO] fix: allure report
Browse files Browse the repository at this point in the history
  • Loading branch information
mleroy-pass committed Feb 6, 2025
1 parent 0798abc commit fc4698c
Show file tree
Hide file tree
Showing 4 changed files with 141 additions and 96 deletions.
80 changes: 40 additions & 40 deletions .github/workflows/dev_on_pull_request_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
90 changes: 45 additions & 45 deletions .github/workflows/dev_on_push_workflow_main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
57 changes: 55 additions & 2 deletions .github/workflows/dev_on_workflow_tests_pro.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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() }}
Expand All @@ -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() }}
Expand All @@ -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
Expand Down
10 changes: 1 addition & 9 deletions pro/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit fc4698c

Please sign in to comment.