You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add auto-fixture for Istanbul E2E coverage collection (#95)
* feat: add auto-fixture for Istanbul E2E coverage collection
- Adds _coverageCollector automatic fixture to test object
- Collects window.__coverage__ from browser after each test
- Writes per-test JSON files to <outputDir>/coverage/
- Enabled via E2E_COLLECT_COVERAGE=1
- Zero overhead when disabled (no page.evaluate or fs operations)
- Designed for use with instrumented dynamic plugin builds
This enables automatic E2E coverage collection for all workspaces
in rhdh-plugin-export-overlays without modifying any test files.
* feat: auto-swap to __coverage images for frontend plugins in PR mode
Implements automatic image tag swap from 'pr_XXX__version' to
'pr_XXX__version__coverage' when E2E_COLLECT_COVERAGE=1 is set
and the plugin is a frontend-plugin.
Changes:
1. Add 'role' field to PluginMetadata and PackageCRD types
2. Parse spec.backstage.role in parseMetadataFile()
3. Swap to __coverage tag in resolvePluginPackages() when:
- GIT_PR_NUMBER is set (PR mode)
- E2E_COLLECT_COVERAGE=1
- Plugin role is 'frontend-plugin'
The regex preserves OCI alias: plugin:tag!alias → plugin:tag__coverage!alias
Only affects PR checks. Nightly mode, {{inherit}}, and local dev
paths are unchanged. Backend plugins skip the swap (no browser coverage).
Implements: #95 (comment)
* fix: use "true" instead of "1" for E2E_COLLECT_COVERAGE env var
For consistency with other boolean env vars in the codebase (like
E2E_NIGHTLY_MODE, USE_NEW_FRONTEND_SYSTEM), change from checking
"1" to checking "true".
Updated in:
- src/playwright/fixtures/test.ts (_coverageCollector fixture)
- src/utils/plugin-metadata.ts (coverage image swap)
- docs/changelog.md (documentation)
Addresses: #95 (comment)
* chore: bump version to 1.1.46
Main branch was updated to 1.1.45, so this PR needs to bump to 1.1.46.
* Apply suggestions from code review
Co-authored-by: Subhash Khileri <subhashkhileri2@gmail.com>
---------
Co-authored-by: Subhash Khileri <subhashkhileri2@gmail.com>
Copy file name to clipboardExpand all lines: docs/changelog.md
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,11 @@
2
2
3
3
All notable changes to this project will be documented in this file.
4
4
5
-
## [1.1.45] - Current
5
+
## [2.1.0] - Current
6
+
7
+
### Added
8
+
9
+
-**E2E coverage collection auto-fixture**: New `_coverageCollector` automatic fixture collects Istanbul coverage (`window.__coverage__`) from the browser after each test and writes per-test JSON files to `<outputDir>/coverage/`. Enabled via `E2E_COLLECT_COVERAGE=true`. Zero overhead when disabled — no `page.evaluate` call or fs operations. Designed for use with instrumented dynamic plugin builds (nyc instrument).
0 commit comments