Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(BSR)[PRO] fix: fix coverage reports #16296

Merged
merged 1 commit into from
Feb 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 21 additions & 9 deletions .github/workflows/dev_on_workflow_tests_pro.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,17 @@ jobs:
- run: yarn install --immutable

- name: Run tests with coverage
run: yarn test:unit:ci --reporter=blob --reporter=allure-vitest/reporter --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
run: yarn test:unit:ci --reporter=verbose --reporter=allure-vitest/reporter --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}

- name: Upload blob report to GitHub Actions Artifacts
- name: Rename coverage
run: mv coverage/coverage-final.json coverage/coverage-${{matrix.shardIndex}}.json

- name: Upload coverage report to GitHub Actions Artifacts
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: blob-report-${{ matrix.shardIndex }}
path: pro/src/.vitest-reports/
name: coverage-report-${{ matrix.shardIndex }}
path: pro/coverage/*.json
include-hidden-files: true
retention-days: 1

Expand Down Expand Up @@ -142,6 +145,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.2.2
with:
fetch-depth: 0
- run: |
git config --global --add safe.directory /__w/pass-culture-main/pass-culture-main
git fetch --no-tags origin +refs/heads/master:refs/remotes/origin/master
git update-ref refs/heads/master refs/remotes/origin/master

Comment on lines +150 to +154
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Par curiosité, à quoi sert ce bout de code ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ce code était là avant, je l'ai enlevé, pour une partie, il sert à fech sans les tags mais je ne suis pas sûre pour le reste, dans le doute je le laisse pour l'instant

- uses: actions/setup-node@v4
with:
node-version-file: "pro/.nvmrc"
Expand All @@ -159,15 +169,17 @@ jobs:
v1-yarn-pro-dependency-cache-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}

- run: yarn install --immutable
- name: Download blob reports from GitHub Actions Artifacts
- name: Download coverage reports from GitHub Actions Artifacts
uses: actions/download-artifact@v4
with:
path: pro/.vitest-reports
pattern: blob-report-*
path: pro/coverage
pattern: coverage-report-*
merge-multiple: true

- name: Merge reports
run: npx vitest --merge-reports
- name: Merge coverage reports
run: |
npx nyc merge coverage coverage/coverage-merged.json
npx nyc report -t coverage --report-dir coverage --reporter lcov

- name: "OpenID Connect Authentication"
uses: "google-github-actions/auth@v2"
Expand Down
2 changes: 1 addition & 1 deletion pro/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export default defineConfig(({ mode }) => {
coverage: {
provider: 'istanbul',
reportsDirectory: '../coverage',
reporter: ['text', 'html', 'lcov'],
reporter: ['text', 'json'],
exclude: ['**/*.stories.tsx', 'apiClient/adage/*','apiClient/adresse/*','apiClient/v1/*','apiClient/v2/*',...coverageConfigDefaults.exclude],
},
minThreads: 4,
Expand Down
Loading