Skip to content
Draft
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
65 changes: 65 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,68 @@ jobs:

---
<sub>🔄 Updated automatically on each push to this PR</sub>

# Coverage Matrix (non-blocking)
# Runs the full pipeline: analyze exports, collect V8 unit coverage,
# merge into final matrix, and build the Svelte dashboard.
# Zero manual path maintenance — discovers packages and exports automatically.
- name: Generate coverage matrix and build dashboard
continue-on-error: true
run: NX_CLOUD_DISTRIBUTED_EXECUTION=false pnpm nx run @forgerock/coverage-matrix:coverage-report

- name: Generate coverage matrix summary
continue-on-error: true
id: coverage-matrix-summary
run: |
node -e "
const fs = require('fs');
try {
const data = JSON.parse(fs.readFileSync('tools/coverage-matrix/data/coverage-matrix.json', 'utf-8'));
const rows = data.packages.map(p => {
const s = p.summary;
const uPct = s.totalExports > 0 ? Math.round(s.unitCovered / s.totalExports * 100) : 0;
const ePct = s.totalExports > 0 ? Math.round(s.e2eCovered / s.totalExports * 100) : 0;
const fPct = s.totalSourceFiles > 0 ? Math.round(s.unitTestedFiles / s.totalSourceFiles * 100) : 0;
return '| ' + p.name + ' | ' + s.totalExports + ' | ' + fPct + '% (' + s.unitTestedFiles + '/' + s.totalSourceFiles + ') | ' + uPct + '% | ' + ePct + '% | ' + s.uncovered + ' |';
});
const table = '| Package | Exports | Unit Files | Unit Exports | E2E | Uncovered |\n|---------|---------|------------|--------------|-----|-----------|' + '\n' + rows.join('\n');
fs.appendFileSync(process.env.GITHUB_OUTPUT, 'table<<EOF\n' + table + '\nEOF\n');
} catch (e) {
fs.appendFileSync(process.env.GITHUB_OUTPUT, 'table=Coverage matrix data not available.\n');
}
"

- name: Find coverage matrix comment
continue-on-error: true
if: github.event_name == 'pull_request'
id: find-coverage-comment
uses: peter-evans/find-comment@v4
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
body-includes: <!-- coverage-matrix -->

- name: Post coverage matrix PR comment
continue-on-error: true
if: github.event_name == 'pull_request'
uses: peter-evans/create-or-update-comment@v4
with:
comment-id: ${{ steps.find-coverage-comment.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
edit-mode: replace
body: |
<!-- coverage-matrix -->
## Coverage Matrix

${{ steps.coverage-matrix-summary.outputs.table }}

[Full dashboard](https://forgerock.github.io/ping-javascript-sdk/coverage-matrix/) · [PR preview](https://ForgeRock.github.io/ping-javascript-sdk/pr-${{ github.event.number }}/${{ github.sha }}/coverage-matrix/)

- name: Preview coverage dashboard
continue-on-error: true
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./tools/coverage-matrix/dist
destination_dir: pr-${{ github.event.number }}/${{ github.sha }}/coverage-matrix
keep_files: true
14 changes: 14 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,20 @@ jobs:
if: steps.changesets.outputs.published == 'false'
uses: ./.github/actions/publish-beta

# Coverage Matrix: build dashboard and deploy to GitHub Pages
- name: Generate coverage matrix and build dashboard
continue-on-error: true
run: NX_CLOUD_DISTRIBUTED_EXECUTION=false pnpm nx run @forgerock/coverage-matrix:coverage-report

- name: Deploy coverage dashboard to GitHub Pages
continue-on-error: true
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./tools/coverage-matrix/dist
destination_dir: coverage-matrix
keep_files: true

- name: Calculate baseline bundle sizes
run: |
chmod +x ./scripts/bundle-sizes.sh
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,4 @@ test-output
# Gemini local knowledge base files
GEMINI.md
**/GEMINI.md
.e2e-coverage/
1 change: 1 addition & 0 deletions .nxignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tools/coverage-matrix/scripts/__tests__/fixtures
3 changes: 3 additions & 0 deletions e2e/davinci-suites/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,8 @@
"main": "src/index.js",
"nx": {
"implicitDependencies": ["@forgerock/davinci-app", "@forgerock/mock-api-v2"]
},
"dependencies": {
"@forgerock/e2e-shared": "workspace:*"
}
}
2 changes: 1 addition & 1 deletion e2e/davinci-suites/src/basic.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/
import { expect, test } from '@playwright/test';
import { expect, test } from '@forgerock/e2e-shared/coverage-fixture';
import { asyncEvents } from './utils/async-events.js';
import { password, username } from './utils/demo-user.js';

Expand Down
2 changes: 1 addition & 1 deletion e2e/davinci-suites/src/fido.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { test, expect, CDPSession } from '@playwright/test';
import { test, expect, CDPSession } from '@forgerock/e2e-shared/coverage-fixture';
import { asyncEvents } from './utils/async-events.js';

const username = 'JSFidoUser@user.com';
Expand Down
2 changes: 1 addition & 1 deletion e2e/davinci-suites/src/form-fields.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/
import { expect, test } from '@playwright/test';
import { expect, test } from '@forgerock/e2e-shared/coverage-fixture';

import { asyncEvents } from './utils/async-events.js';

Expand Down
2 changes: 1 addition & 1 deletion e2e/davinci-suites/src/logging.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/
import { expect, test } from '@playwright/test';
import { expect, test } from '@forgerock/e2e-shared/coverage-fixture';
import { asyncEvents } from './utils/async-events.js';
import { password, username } from './utils/demo-user.js';

Expand Down
2 changes: 1 addition & 1 deletion e2e/davinci-suites/src/mfa.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/
import { expect, test } from '@playwright/test';
import { expect, test } from '@forgerock/e2e-shared/coverage-fixture';
import { asyncEvents } from './utils/async-events.js';
import { password } from './utils/demo-user.js';

Expand Down
2 changes: 1 addition & 1 deletion e2e/davinci-suites/src/middleware.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/
import { expect, test } from '@playwright/test';
import { expect, test } from '@forgerock/e2e-shared/coverage-fixture';
import { asyncEvents } from './utils/async-events.js';
import { password, username } from './utils/demo-user.js';

Expand Down
2 changes: 1 addition & 1 deletion e2e/davinci-suites/src/phone-number-field.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/
import { expect, test } from '@playwright/test';
import { expect, test } from '@forgerock/e2e-shared/coverage-fixture';
import { password } from './utils/demo-user.js';

test.describe('Device registration tests', () => {
Expand Down
2 changes: 1 addition & 1 deletion e2e/davinci-suites/src/protect.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/
import { expect, test } from '@playwright/test';
import { expect, test } from '@forgerock/e2e-shared/coverage-fixture';
import { asyncEvents } from './utils/async-events.js';
import { username, password } from './utils/demo-user.js';

Expand Down
2 changes: 1 addition & 1 deletion e2e/davinci-suites/src/register.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/
import { expect, test } from '@playwright/test';
import { expect, test } from '@forgerock/e2e-shared/coverage-fixture';
import { asyncEvents } from './utils/async-events.js';
import { password } from './utils/demo-user.js';

Expand Down
3 changes: 3 additions & 0 deletions e2e/davinci-suites/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"files": [],
"include": [],
"references": [
{
"path": "../shared"
},
{
"path": "./tsconfig.e2e.json"
}
Expand Down
5 changes: 2 additions & 3 deletions e2e/device-client-app/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as path from 'path';

const pages = ['oath', 'push', 'webauthn', 'device-binding', 'device-profile'];

export default defineConfig(() => ({
export default defineConfig({
root: __dirname + '/src',
cacheDir: '../../node_modules/.vite/e2e/device-client-app',
publicDir: __dirname + '/public',
Expand All @@ -25,7 +25,6 @@ export default defineConfig(() => ({
'Access-Control-Allow-Origin': 'http://localhost:8443',
},
},
plugins: [],
// Uncomment this if you are using workers.
// worker: {
// plugins: [ nxViteTsPaths() ],
Expand Down Expand Up @@ -53,4 +52,4 @@ export default defineConfig(() => ({
},
},
},
}));
});
3 changes: 3 additions & 0 deletions e2e/journey-suites/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,8 @@
"main": "src/index.js",
"nx": {
"implicitDependencies": ["@forgerock/journey-app", "@forgerock/mock-api-v2"]
},
"dependencies": {
"@forgerock/e2e-shared": "workspace:*"
}
}
2 changes: 1 addition & 1 deletion e2e/journey-suites/src/choice-confirm-poll.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* of the MIT license. See the LICENSE file for details.
*/

import { expect, test } from '@playwright/test';
import { expect, test } from '@forgerock/e2e-shared/coverage-fixture';
import { asyncEvents } from './utils/async-events.js';
import { username, password } from './utils/demo-user.js';

Expand Down
2 changes: 1 addition & 1 deletion e2e/journey-suites/src/custom-paths.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* of the MIT license. See the LICENSE file for details.
*/

import { expect, test } from '@playwright/test';
import { expect, test } from '@forgerock/e2e-shared/coverage-fixture';
import { asyncEvents } from './utils/async-events.js';
import { username, password } from './utils/demo-user.js';

Expand Down
2 changes: 1 addition & 1 deletion e2e/journey-suites/src/device-profile.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* of the MIT license. See the LICENSE file for details.
*/

import { expect, test } from '@playwright/test';
import { expect, test } from '@forgerock/e2e-shared/coverage-fixture';
import { asyncEvents } from './utils/async-events.js';
import { username, password } from './utils/demo-user.js';

Expand Down
2 changes: 1 addition & 1 deletion e2e/journey-suites/src/email-suspend.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* of the MIT license. See the LICENSE file for details.
*/

import { expect, test } from '@playwright/test';
import { expect, test } from '@forgerock/e2e-shared/coverage-fixture';
import { asyncEvents } from './utils/async-events.js';
import { username, password } from './utils/demo-user.js';

Expand Down
2 changes: 1 addition & 1 deletion e2e/journey-suites/src/login.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* of the MIT license. See the LICENSE file for details.
*/

import { expect, test } from '@playwright/test';
import { expect, test } from '@forgerock/e2e-shared/coverage-fixture';
import { asyncEvents } from './utils/async-events.js';
import { password, username } from './utils/demo-user.js';

Expand Down
2 changes: 1 addition & 1 deletion e2e/journey-suites/src/no-session.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* of the MIT license. See the LICENSE file for details.
*/

import { expect, test } from '@playwright/test';
import { expect, test } from '@forgerock/e2e-shared/coverage-fixture';
import { asyncEvents } from './utils/async-events.js';
import { username, password } from './utils/demo-user.js';

Expand Down
2 changes: 1 addition & 1 deletion e2e/journey-suites/src/otp-register.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* of the MIT license. See the LICENSE file for details.
*/

import { expect, test } from '@playwright/test';
import { expect, test } from '@forgerock/e2e-shared/coverage-fixture';
import { asyncEvents } from './utils/async-events.js';
import { username, password } from './utils/demo-user.js';

Expand Down
2 changes: 1 addition & 1 deletion e2e/journey-suites/src/protect.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* of the MIT license. See the LICENSE file for details.
*/

import { expect, test } from '@playwright/test';
import { expect, test } from '@forgerock/e2e-shared/coverage-fixture';
import { asyncEvents } from './utils/async-events.js';
import { username, password } from './utils/demo-user.js';

Expand Down
2 changes: 1 addition & 1 deletion e2e/journey-suites/src/qr-code.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* of the MIT license. See the LICENSE file for details.
*/

import { expect, test } from '@playwright/test';
import { expect, test } from '@forgerock/e2e-shared/coverage-fixture';
import { asyncEvents } from './utils/async-events.js';
import { username, password } from './utils/demo-user.js';

Expand Down
2 changes: 1 addition & 1 deletion e2e/journey-suites/src/recovery-codes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* of the MIT license. See the LICENSE file for details.
*/

import { expect, test } from '@playwright/test';
import { expect, test } from '@forgerock/e2e-shared/coverage-fixture';
import { asyncEvents } from './utils/async-events.js';

test.describe('Recovery Codes Journey', () => {
Expand Down
2 changes: 1 addition & 1 deletion e2e/journey-suites/src/registration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* of the MIT license. See the LICENSE file for details.
*/

import { expect, test } from '@playwright/test';
import { expect, test } from '@forgerock/e2e-shared/coverage-fixture';
import { asyncEvents } from './utils/async-events.js';
import { password } from './utils/demo-user.js';

Expand Down
2 changes: 1 addition & 1 deletion e2e/journey-suites/src/request-middleware.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* of the MIT license. See the LICENSE file for details.
*/

import { expect, test } from '@playwright/test';
import { expect, test } from '@forgerock/e2e-shared/coverage-fixture';
import { asyncEvents } from './utils/async-events.js';
import { username, password } from './utils/demo-user.js';

Expand Down
3 changes: 3 additions & 0 deletions e2e/journey-suites/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"files": [],
"include": [],
"references": [
{
"path": "../shared"
},
{
"path": "./tsconfig.e2e.json"
}
Expand Down
6 changes: 3 additions & 3 deletions e2e/oidc-app/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import { fileURLToPath } from 'url';

const __dirname = dirname(fileURLToPath(import.meta.url));
const pages = ['ping-am', 'ping-one'];
export default defineConfig(() => ({

export default defineConfig({
root: __dirname + '/src',
cacheDir: '../../node_modules/.vite/e2e/oidc-app',
publicDir: __dirname + '/public',
Expand All @@ -17,7 +18,6 @@ export default defineConfig(() => ({
port: 8443,
host: 'localhost',
},
plugins: [],
// Uncomment this if you are using workers.
// worker: {
// plugins: [ nxViteTsPaths() ],
Expand All @@ -42,4 +42,4 @@ export default defineConfig(() => ({
},
},
},
}));
});
4 changes: 4 additions & 0 deletions e2e/oidc-suites/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
"name": "@forgerock/oidc-suites",
"version": "0.0.1",
"private": true,
"type": "module",
"nx": {
"implicitDependencies": ["oidc-suites"]
},
"dependencies": {
"@forgerock/e2e-shared": "workspace:*"
}
}
2 changes: 1 addition & 1 deletion e2e/oidc-suites/src/login.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* of the MIT license. See the LICENSE file for details.
*
*/
import { test, expect } from '@playwright/test';
import { test, expect } from '@forgerock/e2e-shared/coverage-fixture';
import {
pingAmUsername,
pingAmPassword,
Expand Down
2 changes: 1 addition & 1 deletion e2e/oidc-suites/src/logout.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* of the MIT license. See the LICENSE file for details.
*
*/
import { test, expect } from '@playwright/test';
import { test, expect } from '@forgerock/e2e-shared/coverage-fixture';
import {
pingAmUsername,
pingAmPassword,
Expand Down
Loading
Loading