-
Notifications
You must be signed in to change notification settings - Fork 29
Add E2E code coverage #156
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
base: main
Are you sure you want to change the base?
Changes from all commits
5ee9f8e
dcc11c4
c3e5b1d
ee89f3f
00b5373
2eadcb9
2e7b48a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,7 +24,8 @@ | |
| "release": "turbo run build && pnpm changeset publish", | ||
| "storybook": "turbo watch storybook --filter=@storybook/mcp-internal-storybook", | ||
| "test": "vitest", | ||
| "test:ci": "vitest run --coverage --reporter=default --reporter=github-actions --reporter=junit --outputFile=test-report.junit.xml", | ||
| "test:ci": "NODE_V8_COVERAGE=./e2e-coverage vitest run --coverage --reporter=default --reporter=github-actions --reporter=junit --outputFile=test-report.junit.xml", | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| "test:ci:report-e2e-coverage": "c8 report --experimental-monocart --temp-directory ./e2e-coverage -r lcov -o ./e2e-coverage-report && node scripts/filter-lcov.js ./e2e-coverage-report/lcov.info '/src/.+\\.tsx?$'", | ||
| "test:run": "vitest run", | ||
| "turbo": "turbo", | ||
| "turbo:test": "turbo run test", | ||
|
|
@@ -41,6 +42,8 @@ | |
| "@storybook/mcp": "workspace:*", | ||
| "@types/node": "20.19.0", | ||
| "@vitest/coverage-v8": "4.0.6", | ||
| "c8": "^10.1.3", | ||
| "monocart-coverage-reports": "^2.12.9", | ||
| "oxfmt": "^0.27.0", | ||
| "oxlint": "^1.25.0", | ||
| "oxlint-tsgolint": "^0.4.0", | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| *.map |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| *.map |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NODE_V8_COVERAGE=./e2e-coverageis a relative path, but the E2E tests spawn Storybook withcwd: STORYBOOK_DIR(apps/internal-storybook). That means the Storybook process will write V8 coverage intoapps/internal-storybook/e2e-coverage, while the laterc8 report --temp-directory ./e2e-coveragestep reads from the repo root. This can result in missing/empty E2E coverage (or a failingc8 report). Consider using an absolute path forNODE_V8_COVERAGE(so it’s independent of child process CWD) or explicitly overridingNODE_V8_COVERAGEin the Storybook spawn env to point at the root coverage directory.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The relative path works because the Storybook process ends up running from the repo root (turbo resets CWD). Verified locally — all V8 coverage files land in
./e2e-coverage/at the repo root, none inapps/internal-storybook/e2e-coverage/.