Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
69834ef
Add dependencies and commands
priethor Nov 14, 2025
916ed20
Sync package-lock
priethor Nov 14, 2025
88f8645
Update webpack to include the istanbul plugin if we enabled coverage
priethor Nov 14, 2025
02ef071
Switch from C8 reporter to NYC directly
priethor Nov 14, 2025
3bdca0d
Add nyc settings
priethor Nov 14, 2025
b2d424d
Empty the nyc output folder before generating the coverage results
priethor Nov 14, 2025
cd542e8
Add the .nyc temporary folder and coverage folder with the results to…
priethor Nov 14, 2025
b5b3a54
Update Codecov settings to carry forward the results for e2e
priethor Nov 14, 2025
5165c95
Add coverage collection to e2e tests by extending the wp e2e test utils
priethor Nov 14, 2025
9e5474e
Lint package.json
priethor Nov 14, 2025
67b3826
Update e2e workflow to generate coverage data, generate the LCOV repo…
priethor Nov 14, 2025
713aa59
Enable coverage instrumentation when running the build for testing
priethor Nov 14, 2025
4068df8
Add token and slug to workflow
priethor Nov 14, 2025
b2bcb9f
Update the codecov action to v5
priethor Nov 14, 2025
2d9b69c
Add appropriate flag and carryforward setting to phpunit tests
priethor Nov 18, 2025
574ba53
Merge trunk: resolve package.json conflict
priethor Nov 18, 2025
88f5587
Try skipping GPG signature
priethor Nov 18, 2025
e3b79e4
Revert "Try skipping GPG signature"
priethor Nov 18, 2025
f3fdf35
Enable verbose mode to debug - is it because of the issues with cloud…
priethor Nov 18, 2025
defde96
Revert "Enable verbose mode to debug - is it because of the issues wi…
priethor Nov 18, 2025
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
10 changes: 10 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
# Codecov Configuration
# Reference: https://docs.codecov.com/docs/codecovyml-reference

flags:
e2e:
carryforward: true # Preserve coverage data across uploads to avoid losing history
paths:
- 'assets/src/'
phpunit:
carryforward: true # Preserve coverage data across uploads to avoid losing history
paths:
- 'includes/'

coverage:
status:
project:
Expand Down
90 changes: 53 additions & 37 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,58 @@
name: E2E Tests

on:
pull_request:
branches: [trunk]
pull_request:
branches: [trunk]

jobs:
test:
name: Playwright e2e Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: "npm"

- name: Install dependencies
run: |
npm ci
composer install --prefer-dist --no-progress

- name: Npm build
run: npm run build

- name: Install wp-env
run: npm install -g @wordpress/env

- name: Start wp-env
run: wp-env start

- name: Install Playwright browsers
run: npx playwright install --with-deps

- name: Run e2e tests
run: npm run test:e2e

- name: Stop wp-env
if: always()
run: wp-env stop
test:
name: Playwright e2e Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'

- name: Install dependencies
run: |
npm ci
composer install --prefer-dist --no-progress

- name: Npm build with coverage instrumentation
env:
COVERAGE_ENABLED: true
run: npm run build

- name: Install wp-env
run: npm install -g @wordpress/env

- name: Start wp-env
run: wp-env start

- name: Install Playwright browsers
run: npx playwright install --with-deps

- name: Run e2e tests with coverage
run: npm run test:e2e:coverage

- name: Generate LCOV report from Istanbul coverage
if: always()
run: npm run test:e2e:coverage:report

- name: Upload E2E Coverage to Codecov
if: always()
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage/lcov.info
flags: e2e
slug: WordPress/secure-custom-fields
name: e2e-coverage

- name: Stop wp-env
if: always()
run: wp-env stop
2 changes: 2 additions & 0 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,5 @@ jobs:
token: ${{ secrets.CODECOV_TOKEN }}
slug: WordPress/secure-custom-fields
files: ./coverage.xml
flags: phpunit
name: phpunit-php-${{ matrix.php }}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ assets/build/**/*.php
/playwright/.cache/
/artifacts/

# Code Coverage
/coverage/
/.nyc_output/

# Claude settings
**/.claude/settings.local.json

Expand Down
13 changes: 13 additions & 0 deletions .nycrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"tempDir": ".nyc_output",
"reportDir": "./coverage",
"reporter": [ "html", "lcov", "text" ],
"include": [ "assets/src/**/*.js", "assets/src/**/*.jsx" ],
"exclude": [
"assets/src/**/*.test.js",
"assets/src/**/*.spec.js",
"assets/build/**",
"node_modules/**",
"tests/**"
]
}
Loading
Loading