@nsxbet/playwright-orchestrator 1.0.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/README.md +76 -133
  2. package/dist/commands/assign.d.ts +2 -0
  3. package/dist/commands/assign.d.ts.map +1 -1
  4. package/dist/commands/assign.js +44 -3
  5. package/dist/commands/assign.js.map +1 -1
  6. package/dist/commands/extract-timing.d.ts +0 -1
  7. package/dist/commands/extract-timing.d.ts.map +1 -1
  8. package/dist/commands/extract-timing.js +2 -32
  9. package/dist/commands/extract-timing.js.map +1 -1
  10. package/dist/core/ckk-algorithm.d.ts +1 -1
  11. package/dist/core/ckk-algorithm.d.ts.map +1 -1
  12. package/dist/core/ckk-algorithm.js +130 -36
  13. package/dist/core/ckk-algorithm.js.map +1 -1
  14. package/dist/core/estimate.d.ts +11 -0
  15. package/dist/core/estimate.d.ts.map +1 -1
  16. package/dist/core/estimate.js +43 -0
  17. package/dist/core/estimate.js.map +1 -1
  18. package/dist/core/test-discovery.d.ts +17 -3
  19. package/dist/core/test-discovery.d.ts.map +1 -1
  20. package/dist/core/test-discovery.js +39 -19
  21. package/dist/core/test-discovery.js.map +1 -1
  22. package/dist/core/test-id.d.ts +23 -67
  23. package/dist/core/test-id.d.ts.map +1 -1
  24. package/dist/core/test-id.js +29 -86
  25. package/dist/core/test-id.js.map +1 -1
  26. package/dist/core/types.d.ts +2 -0
  27. package/dist/core/types.d.ts.map +1 -1
  28. package/dist/core/types.js.map +1 -1
  29. package/package.json +1 -26
  30. package/dist/commands/filter-report.d.ts +0 -19
  31. package/dist/commands/filter-report.d.ts.map +0 -1
  32. package/dist/commands/filter-report.js +0 -103
  33. package/dist/commands/filter-report.js.map +0 -1
  34. package/dist/fixture.d.ts +0 -75
  35. package/dist/fixture.d.ts.map +0 -1
  36. package/dist/fixture.js +0 -148
  37. package/dist/fixture.js.map +0 -1
  38. package/dist/reporter.d.ts +0 -93
  39. package/dist/reporter.d.ts.map +0 -1
  40. package/dist/reporter.js +0 -343
  41. package/dist/reporter.js.map +0 -1
package/dist/fixture.js DELETED
@@ -1,148 +0,0 @@
1
- /**
2
- * Playwright Orchestrator Fixture
3
- *
4
- * A Playwright fixture that filters tests based on a JSON shard file.
5
- * This provides actual test skipping (unlike the reporter which only adds metadata).
6
- *
7
- * Usage in your test setup file (e.g., tests/setup.ts):
8
- * ```typescript
9
- * import { test as base } from '@playwright/test';
10
- * import { withOrchestratorFilter } from '@nsxbet/playwright-orchestrator/fixture';
11
- *
12
- * // Create extended test with orchestrator filtering
13
- * export const test = withOrchestratorFilter(base);
14
- * export { expect } from '@playwright/test';
15
- * ```
16
- *
17
- * Then in your test files:
18
- * ```typescript
19
- * import { test, expect } from './setup';
20
- *
21
- * test('my test', async ({ page }) => {
22
- * // ...
23
- * });
24
- * ```
25
- *
26
- * Environment variables:
27
- * - ORCHESTRATOR_SHARD_FILE: Path to JSON file with array of test IDs
28
- * - ORCHESTRATOR_DEBUG: Set to "1" to enable debug logging
29
- *
30
- * @module @nsxbet/playwright-orchestrator/fixture
31
- */
32
- import * as fs from 'node:fs';
33
- import { buildTestIdFromRuntime } from './core/test-id.js';
34
- // Module initialization debug - only in debug mode
35
- if (process.env.ORCHESTRATOR_DEBUG === '1') {
36
- process.stderr.write('[Fixture Module] Loading orchestrator fixture\n');
37
- }
38
- // Cache the shard file to avoid re-reading on every test
39
- let cachedAllowedTestIds = null;
40
- let cacheInitialized = false;
41
- function loadShardFile() {
42
- if (cacheInitialized)
43
- return cachedAllowedTestIds;
44
- cacheInitialized = true;
45
- const shardFile = process.env.ORCHESTRATOR_SHARD_FILE;
46
- if (!shardFile || !fs.existsSync(shardFile)) {
47
- if (process.env.ORCHESTRATOR_DEBUG === '1') {
48
- console.log('[Orchestrator] No shard file, running all tests');
49
- }
50
- return null;
51
- }
52
- try {
53
- const parsed = JSON.parse(fs.readFileSync(shardFile, 'utf-8'));
54
- // Validate shard file format
55
- if (!Array.isArray(parsed) ||
56
- !parsed.every((id) => typeof id === 'string')) {
57
- throw new Error('[Orchestrator] Shard file must be a JSON array of strings');
58
- }
59
- const testIds = parsed;
60
- cachedAllowedTestIds = new Set(testIds);
61
- if (process.env.ORCHESTRATOR_DEBUG === '1') {
62
- process.stderr.write(`[Orchestrator] Loaded ${testIds.length} tests for this shard\n`);
63
- process.stderr.write(`[Orchestrator] Sample IDs: ${testIds.slice(0, 3).join(' | ')}\n`);
64
- }
65
- return cachedAllowedTestIds;
66
- }
67
- catch (error) {
68
- console.error('[Orchestrator] Failed to load shard file:', error);
69
- throw error;
70
- }
71
- }
72
- /**
73
- * Creates an extended test with orchestrator filtering as an auto-fixture.
74
- * This ensures tests not in the current shard are skipped.
75
- *
76
- * IMPORTANT: Use this function to create your test object, then export it.
77
- * All test files should import the extended test, not the base test.
78
- *
79
- * @param test - The base test object from @playwright/test
80
- * @returns Extended test with orchestrator filtering
81
- *
82
- * @example
83
- * ```typescript
84
- * // In setup.ts
85
- * import { test as base } from '@playwright/test';
86
- * import { withOrchestratorFilter } from '@nsxbet/playwright-orchestrator/fixture';
87
- *
88
- * export const test = withOrchestratorFilter(base);
89
- *
90
- * // In your.spec.ts
91
- * import { test } from './setup';
92
- * test('example', async ({ page }) => { ... });
93
- * ```
94
- */
95
- export function withOrchestratorFilter(test) {
96
- return test.extend({
97
- // @ts-expect-error - Playwright's auto fixture typing is complex
98
- _orchestratorFilter: [
99
- async (
100
- // biome-ignore lint/correctness/noEmptyPattern: Playwright requires empty destructuring
101
- {}, use, testInfo) => {
102
- const allowedTestIds = loadShardFile();
103
- if (allowedTestIds) {
104
- // CRITICAL: Use project.testDir for consistent path resolution with test-discovery
105
- // No fallback to process.cwd() - this causes path mismatch bugs
106
- const testDir = testInfo.project.testDir;
107
- if (!testDir) {
108
- throw new Error('[Orchestrator Fixture] Could not determine project testDir. ' +
109
- 'Ensure your playwright.config.ts has projects configured with testDir.');
110
- }
111
- const testId = buildTestIdFromRuntime(testInfo.file, testInfo.titlePath, {
112
- projectName: testInfo.project.name,
113
- baseDir: testDir,
114
- });
115
- const isAllowed = allowedTestIds.has(testId);
116
- // Debug: Write to stderr for visibility in CI logs
117
- if (process.env.ORCHESTRATOR_DEBUG === '1') {
118
- process.stderr.write(`[Fixture] testDir=${testInfo.project.testDir} | testId=${testId} | allowed=${isAllowed}\n`);
119
- }
120
- if (!isAllowed) {
121
- test.skip(true, 'Not in shard');
122
- }
123
- }
124
- await use();
125
- },
126
- { auto: true },
127
- ],
128
- });
129
- }
130
- /**
131
- * Check if a test should run based on the shard file.
132
- * Can be called manually in individual tests.
133
- *
134
- * @param testInfo - The testInfo object from Playwright
135
- * @returns true if the test should run, false if it should be skipped
136
- * @throws Error if project testDir is not configured
137
- */
138
- export function shouldRunTest(testInfo) {
139
- const allowedTestIds = loadShardFile();
140
- if (!allowedTestIds)
141
- return true;
142
- const testId = buildTestIdFromRuntime(testInfo.file, testInfo.titlePath, {
143
- projectName: testInfo.project.name,
144
- baseDir: testInfo.project.testDir,
145
- });
146
- return allowedTestIds.has(testId);
147
- }
148
- //# sourceMappingURL=fixture.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fixture.js","sourceRoot":"","sources":["../src/fixture.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAE9B,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAE3D,mDAAmD;AACnD,IAAI,OAAO,CAAC,GAAG,CAAC,kBAAkB,KAAK,GAAG,EAAE,CAAC;IAC3C,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,iDAAiD,CAAC,CAAC;AAC1E,CAAC;AAED,yDAAyD;AACzD,IAAI,oBAAoB,GAAuB,IAAI,CAAC;AACpD,IAAI,gBAAgB,GAAG,KAAK,CAAC;AAE7B,SAAS,aAAa;IACpB,IAAI,gBAAgB;QAAE,OAAO,oBAAo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AAI,EAAE,IAAI,EAAE;SACf;KACF,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,aAAa,CAAC,QAI7B;IACC,MAAM,cAAc,GAAG,aAAa,EAAE,CAAC;IACvC,IAAI,CAAC,cAAc;QAAE,OAAO,IAAI,CAAC;IAEjC,MAAM,MAAM,GAAG,sBAAsB,CAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,SAAS,EAAE;QACvE,WAAW,EAAE,QAAQ,CAAC,OAAO,CAAC,IAAI;QAClC,OAAO,EAAE,QAAQ,CAAC,OAAO,CAAC,OAAO;KAClC,CAAC,CAAC;IAEH,OAAO,cAAc,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACpC,CAAC"}
@@ -1,93 +0,0 @@
1
- /**
2
- * Playwright Orchestrator Reporter
3
- *
4
- * A custom Playwright reporter that provides clean output for sharded tests.
5
- * Shows only tests assigned to the current shard, with proper counts and summaries.
6
- *
7
- * Features:
8
- * - Correct "Running X tests" count (only shard tests, not total)
9
- * - Clean output showing only shard tests (no skipped noise)
10
- * - Debug mode to see filtered tests
11
- * - Compatible with other reporters (json, html)
12
- *
13
- * Usage:
14
- * 1. Add to playwright.config.ts:
15
- * reporter: [['@nsxbet/playwright-orchestrator/reporter'], ['json', {...}]]
16
- * 2. Set ORCHESTRATOR_SHARD_FILE env var to path of JSON file with test IDs
17
- *
18
- * Environment variables:
19
- * - ORCHESTRATOR_SHARD_FILE: Path to JSON file with array of test IDs
20
- * - ORCHESTRATOR_DEBUG: Set to "1" to show filtered tests
21
- *
22
- * @module @nsxbet/playwright-orchestrator/reporter
23
- */
24
- import type { FullConfig, FullResult, Reporter, Suite, TestCase, TestResult } from '@playwright/test/reporter';
25
- interface OrchestratorReporterOptions {
26
- filterJson?: string;
27
- }
28
- export default class OrchestratorReporter implements Reporter {
29
- private allowedTestIds;
30
- private debug;
31
- private startTime;
32
- private rootDir;
33
- private testDir;
34
- private filterJsonPath;
35
- private passed;
36
- private failed;
37
- private skipped;
38
- private filtered;
39
- constructor(options?: OrchestratorReporterOptions);
40
- onBegin(config: FullConfig, suite: Suite): void;
41
- onTestEnd(test: TestCase, result: TestResult): void;
42
- onEnd(_result: FullResult): void;
43
- /**
44
- * Print a test result line
45
- */
46
- private printTestResult;
47
- /**
48
- * Print a filtered test (debug mode only)
49
- */
50
- private printFiltered;
51
- /**
52
- * Get display title for a test (file > describe > test)
53
- */
54
- private getDisplayTitle;
55
- /**
56
- * Filter titlePath to get only describe blocks and test title.
57
- * Uses shared filterRuntimeTitlePath function for consistency.
58
- */
59
- private getFilteredTitles;
60
- /**
61
- * Format duration in human readable format
62
- */
63
- private formatDuration;
64
- onExit(): Promise<void>;
65
- /**
66
- * Filter specs by checking test IDs against the allowedTestIds set.
67
- * Builds test IDs from the JSON report structure (file path + describe chain + spec title),
68
- * matching the same format used by discovery (buildTestId) and runtime (buildTestIdFromRuntime).
69
- *
70
- * This correctly handles ALL non-shard tests, including genuinely skipped tests
71
- * (test.skip, test.fixme, test.describe.skip) that never receive the "Not in shard" annotation
72
- * because the orchestrator fixture doesn't run for them.
73
- */
74
- private filterSuitesById;
75
- private resolveReportFilePath;
76
- /**
77
- * Recalculate the stats object to match the filtered suites.
78
- * Playwright JSON stats use: expected (passed), skipped, unexpected (failed), flaky.
79
- */
80
- private recalculateStats;
81
- private countTestStatuses;
82
- private countSpecs;
83
- /**
84
- * Build test ID from TestCase.
85
- * Uses shared buildTestIdFromRuntime function for consistency with fixture.
86
- *
87
- * CRITICAL: Must use project.testDir to match discovery-generated test IDs.
88
- * No fallback to rootDir or process.cwd() - these cause path mismatch bugs.
89
- */
90
- private buildTestId;
91
- }
92
- export {};
93
- //# sourceMappingURL=reporter.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"reporter.d.ts","sourceRoot":"","sources":["../src/reporter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAIH,OAAO,KAAK,EACV,UAAU,EACV,UAAU,EACV,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,UAAU,EACX,MAAM,2BAA2B,CAAC;AA0BnC,UAAU,2BAA2B;IACnC,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,CAAC,OAAO,OAAO,oBAAqB,YAAW,QAAQ;IAC3D,OAAO,CAAC,cAAc,CAA4B;IAClD,OAAO,CAAC,KAAK,CAA0C;IACvD,OAAO,CAAC,SAAS,CAAK;IACtB,OAAO,CAAC,OAAO,CAAM;IACrB,OAAO,CAAC,OAAO,CAAM;IACrB,OAAO,CAAC,cAAc,CAAqB;IAG3C,OAAO,CAAC,MAAM,CAAK;IACnB,OAAO,CAAC,MAAM,CAAK;IACnB,OAAO,CAAC,OAAO,CAAK;IACpB,OAAO,CAAC,QAAQ,CAAK;gBAET,OAAO,CAAC,EAAE,2BAA2B;IAIjD,OAAO,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK;IAuCxC,SAAS,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU;IAsB5C,KAAK,CAAC,OAAO,EAAE,UAAU;IA0BzB;;OAEG;IACH,OAAO,CAAC,eAAe;IAsCvB;;OAEG;IACH,OAAO,CAAC,aAAa;IAKrB;;OAEG;IACH,OAAO,CAAC,eAAe;IAMvB;;;OAGG;IACH,OAAO,CAAC,iBAAiB;IAQzB;;OAEG;IACH,OAAO,CAAC,cAAc;IAahB,MAAM;IAoDZ;;;;;;;;OAQG;IACH,OAAO,CAAC,gBAAgB;IAoDxB,OAAO,CAAC,qBAAqB;IAO7B;;;OAGG;IACH,OAAO,CAAC,gBAAgB;IASxB,OAAO,CAAC,iBAAiB;IA4BzB,OAAO,CAAC,UAAU;IAalB;;;;;;OAMG;IACH,OAAO,CAAC,WAAW;CAepB"}
package/dist/reporter.js DELETED
@@ -1,343 +0,0 @@
1
- /**
2
- * Playwright Orchestrator Reporter
3
- *
4
- * A custom Playwright reporter that provides clean output for sharded tests.
5
- * Shows only tests assigned to the current shard, with proper counts and summaries.
6
- *
7
- * Features:
8
- * - Correct "Running X tests" count (only shard tests, not total)
9
- * - Clean output showing only shard tests (no skipped noise)
10
- * - Debug mode to see filtered tests
11
- * - Compatible with other reporters (json, html)
12
- *
13
- * Usage:
14
- * 1. Add to playwright.config.ts:
15
- * reporter: [['@nsxbet/playwright-orchestrator/reporter'], ['json', {...}]]
16
- * 2. Set ORCHESTRATOR_SHARD_FILE env var to path of JSON file with test IDs
17
- *
18
- * Environment variables:
19
- * - ORCHESTRATOR_SHARD_FILE: Path to JSON file with array of test IDs
20
- * - ORCHESTRATOR_DEBUG: Set to "1" to show filtered tests
21
- *
22
- * @module @nsxbet/playwright-orchestrator/reporter
23
- */
24
- import * as fs from 'node:fs';
25
- import * as path from 'node:path';
26
- import { buildTestIdFromRuntime, filterRuntimeTitlePath, } from './core/test-id.js';
27
- // ANSI color codes
28
- const colors = {
29
- green: '\x1b[32m',
30
- red: '\x1b[31m',
31
- yellow: '\x1b[33m',
32
- gray: '\x1b[90m',
33
- reset: '\x1b[0m',
34
- bold: '\x1b[1m',
35
- };
36
- // Check if colors should be used
37
- const useColors = process.env.FORCE_COLOR !== '0' &&
38
- process.env.NO_COLOR === undefined &&
39
- process.stdout.isTTY;
40
- function color(code, text) {
41
- return useColors ? `${colors[code]}${text}${colors.reset}` : text;
42
- }
43
- export default class OrchestratorReporter {
44
- allowedTestIds = null;
45
- debug = process.env.ORCHESTRATOR_DEBUG === '1';
46
- startTime = 0;
47
- rootDir = '';
48
- testDir = '';
49
- filterJsonPath;
50
- // Counters for summary
51
- passed = 0;
52
- failed = 0;
53
- skipped = 0;
54
- filtered = 0;
55
- constructor(options) {
56
- this.filterJsonPath = options?.filterJson;
57
- }
58
- onBegin(config, suite) {
59
- this.startTime = Date.now();
60
- this.rootDir = config.rootDir;
61
- this.testDir = config.projects[0]?.testDir ?? config.rootDir;
62
- const shardFile = process.env.ORCHESTRATOR_SHARD_FILE;
63
- if (!shardFile || !fs.existsSync(shardFile)) {
64
- // No shard file - let other reporters handle output
65
- if (this.debug) {
66
- console.log(color('gray', '[Orchestrator] No shard file, running all tests'));
67
- }
68
- return;
69
- }
70
- try {
71
- const testIds = JSON.parse(fs.readFileSync(shardFile, 'utf-8'));
72
- this.allowedTestIds = new Set(testIds);
73
- // Count tests
74
- const allTests = suite.allTests();
75
- const shardTestCount = this.allowedTestIds.size;
76
- this.filtered = allTests.length - shardTestCount;
77
- // Print header
78
- const workers = config.workers;
79
- let header = `\nRunning ${color('bold', String(shardTestCount))} tests using ${workers} workers`;
80
- if (this.debug && this.filtered > 0) {
81
- header += color('gray', ` (${this.filtered} filtered by orchestrator)`);
82
- }
83
- console.log(header);
84
- console.log('');
85
- }
86
- catch (error) {
87
- console.error('[Orchestrator] Failed to load shard file:', error);
88
- throw error;
89
- }
90
- }
91
- onTestEnd(test, result) {
92
- const testId = this.buildTestId(test);
93
- const isInShard = !this.allowedTestIds || this.allowedTestIds.has(testId);
94
- if (isInShard) {
95
- // Track stats for shard tests
96
- if (result.status === 'passed') {
97
- this.passed++;
98
- }
99
- else if (result.status === 'failed' || result.status === 'timedOut') {
100
- this.failed++;
101
- }
102
- else if (result.status === 'skipped') {
103
- this.skipped++;
104
- }
105
- // Print test result
106
- this.printTestResult(test, result);
107
- }
108
- else if (this.debug) {
109
- // Show filtered tests only in debug mode
110
- this.printFiltered(test);
111
- }
112
- }
113
- onEnd(_result) {
114
- // Only print summary if we have a shard file
115
- if (!this.allowedTestIds)
116
- return;
117
- const duration = Date.now() - this.startTime;
118
- const durationStr = this.formatDuration(duration);
119
- console.log('');
120
- // Build summary parts
121
- const parts = [];
122
- if (this.passed > 0) {
123
- parts.push(color('green', `${this.passed} passed`));
124
- }
125
- if (this.failed > 0) {
126
- parts.push(color('red', `${this.failed} failed`));
127
- }
128
- if (this.skipped > 0) {
129
- parts.push(color('yellow', `${this.skipped} skipped`));
130
- }
131
- if (parts.length > 0) {
132
- console.log(` ${parts.join(', ')} ${color('gray', `(${durationStr})`)}`);
133
- }
134
- }
135
- /**
136
- * Print a test result line
137
- */
138
- printTestResult(test, result) {
139
- const duration = result.duration;
140
- const durationStr = duration > 0 ? color('gray', ` (${this.formatDuration(duration)})`) : '';
141
- const titlePath = this.getDisplayTitle(test);
142
- let status;
143
- switch (result.status) {
144
- case 'passed':
145
- status = color('green', '✓');
146
- break;
147
- case 'failed':
148
- case 'timedOut':
149
- status = color('red', '✗');
150
- break;
151
- case 'skipped':
152
- status = color('yellow', '-');
153
- break;
154
- default:
155
- status = '?';
156
- }
157
- console.log(` ${status} ${titlePath}${durationStr}`);
158
- // Print error for failed tests
159
- if (result.status === 'failed' || result.status === 'timedOut') {
160
- for (const error of result.errors) {
161
- if (error.message) {
162
- const lines = error.message.split('\n').slice(0, 3);
163
- for (const line of lines) {
164
- console.log(color('red', ` ${line}`));
165
- }
166
- }
167
- }
168
- }
169
- }
170
- /**
171
- * Print a filtered test (debug mode only)
172
- */
173
- printFiltered(test) {
174
- const titlePath = this.getDisplayTitle(test);
175
- console.log(` ${color('gray', '○')} ${color('gray', titlePath)}`);
176
- }
177
- /**
178
- * Get display title for a test (file > describe > test)
179
- */
180
- getDisplayTitle(test) {
181
- const file = path.basename(test.location.file);
182
- const filteredTitles = this.getFilteredTitles(test);
183
- return `${file} > ${filteredTitles.join(' > ')}`;
184
- }
185
- /**
186
- * Filter titlePath to get only describe blocks and test title.
187
- * Uses shared filterRuntimeTitlePath function for consistency.
188
- */
189
- getFilteredTitles(test) {
190
- const titlePath = test.titlePath();
191
- const projectName = test.parent?.project()?.name;
192
- const fileName = path.basename(test.location.file);
193
- return filterRuntimeTitlePath(titlePath, { projectName, fileName });
194
- }
195
- /**
196
- * Format duration in human readable format
197
- */
198
- formatDuration(ms) {
199
- if (ms < 1000) {
200
- return `${ms}ms`;
201
- }
202
- const seconds = ms / 1000;
203
- if (seconds < 60) {
204
- return `${seconds.toFixed(1)}s`;
205
- }
206
- const minutes = Math.floor(seconds / 60);
207
- const remainingSeconds = Math.round(seconds % 60);
208
- return `${minutes}m ${remainingSeconds}s`;
209
- }
210
- async onExit() {
211
- if (!this.filterJsonPath || !this.allowedTestIds)
212
- return;
213
- const reportPath = path.resolve(this.filterJsonPath);
214
- if (!fs.existsSync(reportPath)) {
215
- if (this.debug) {
216
- console.log(color('gray', `[Orchestrator] filterJson file not found: ${reportPath}`));
217
- }
218
- return;
219
- }
220
- try {
221
- const report = JSON.parse(fs.readFileSync(reportPath, 'utf-8'));
222
- if (!report.suites)
223
- return;
224
- const testDir = report.config?.projects?.[0]?.testDir || this.testDir || this.rootDir;
225
- const beforeCount = this.countSpecs(report.suites);
226
- this.filterSuitesById(report.suites, testDir, this.allowedTestIds, [], true);
227
- const afterCount = this.countSpecs(report.suites);
228
- if (report.stats) {
229
- report.stats = this.recalculateStats(report.suites, report.stats);
230
- }
231
- fs.writeFileSync(reportPath, JSON.stringify(report));
232
- if (this.debug) {
233
- console.log(color('gray', `[Orchestrator] Filtered JSON report: ${beforeCount} → ${afterCount} specs (removed ${beforeCount - afterCount})`));
234
- }
235
- }
236
- catch (error) {
237
- console.error('[Orchestrator] Failed to filter JSON report:', error);
238
- }
239
- }
240
- /**
241
- * Filter specs by checking test IDs against the allowedTestIds set.
242
- * Builds test IDs from the JSON report structure (file path + describe chain + spec title),
243
- * matching the same format used by discovery (buildTestId) and runtime (buildTestIdFromRuntime).
244
- *
245
- * This correctly handles ALL non-shard tests, including genuinely skipped tests
246
- * (test.skip, test.fixme, test.describe.skip) that never receive the "Not in shard" annotation
247
- * because the orchestrator fixture doesn't run for them.
248
- */
249
- filterSuitesById(suites, testDir, allowedIds, parentTitles, isRootLevel) {
250
- for (let i = suites.length - 1; i >= 0; i--) {
251
- const suite = suites[i];
252
- if (!suite)
253
- continue;
254
- const suiteTitle = suite.title;
255
- const suiteFile = suite.file;
256
- // Root-level suites are file-level (title = filename) → skip from describe chain
257
- // Nested suites are describe blocks → include title in chain
258
- const currentTitles = isRootLevel ? [] : [...parentTitles, suiteTitle];
259
- const filePath = suiteFile
260
- ? this.resolveReportFilePath(suiteFile, testDir)
261
- : '';
262
- if (Array.isArray(suite.specs)) {
263
- suite.specs = suite.specs.filter((spec) => {
264
- const specTitle = spec.title;
265
- const testId = [filePath, ...currentTitles, specTitle].join('::');
266
- return allowedIds.has(testId);
267
- });
268
- }
269
- if (Array.isArray(suite.suites)) {
270
- this.filterSuitesById(suite.suites, testDir, allowedIds, currentTitles, false);
271
- }
272
- const hasSpecs = Array.isArray(suite.specs) && suite.specs.length > 0;
273
- const hasSubSuites = Array.isArray(suite.suites) && suite.suites.length > 0;
274
- if (!hasSpecs && !hasSubSuites) {
275
- suites.splice(i, 1);
276
- }
277
- }
278
- }
279
- resolveReportFilePath(filePath, testDir) {
280
- if (path.isAbsolute(filePath)) {
281
- return path.relative(testDir, filePath).replace(/\\/g, '/');
282
- }
283
- return filePath.replace(/\\/g, '/');
284
- }
285
- /**
286
- * Recalculate the stats object to match the filtered suites.
287
- * Playwright JSON stats use: expected (passed), skipped, unexpected (failed), flaky.
288
- */
289
- recalculateStats(suites, originalStats) {
290
- const counts = { expected: 0, unexpected: 0, skipped: 0, flaky: 0 };
291
- this.countTestStatuses(suites, counts);
292
- return { ...originalStats, ...counts };
293
- }
294
- countTestStatuses(suites, counts) {
295
- for (const suite of suites) {
296
- if (Array.isArray(suite.specs)) {
297
- for (const spec of suite.specs) {
298
- const tests = spec.tests;
299
- if (!tests)
300
- continue;
301
- for (const test of tests) {
302
- const status = test.status;
303
- if (status in counts && counts[status] !== undefined) {
304
- counts[status] = counts[status] + 1;
305
- }
306
- }
307
- }
308
- }
309
- if (Array.isArray(suite.suites)) {
310
- this.countTestStatuses(suite.suites, counts);
311
- }
312
- }
313
- }
314
- countSpecs(suites) {
315
- let count = 0;
316
- for (const suite of suites) {
317
- if (Array.isArray(suite.specs))
318
- count += suite.specs.length;
319
- if (Array.isArray(suite.suites))
320
- count += this.countSpecs(suite.suites);
321
- }
322
- return count;
323
- }
324
- /**
325
- * Build test ID from TestCase.
326
- * Uses shared buildTestIdFromRuntime function for consistency with fixture.
327
- *
328
- * CRITICAL: Must use project.testDir to match discovery-generated test IDs.
329
- * No fallback to rootDir or process.cwd() - these cause path mismatch bugs.
330
- */
331
- buildTestId(test) {
332
- const testDir = test.parent?.project()?.testDir;
333
- if (!testDir) {
334
- throw new Error('[Orchestrator Reporter] Could not determine project testDir. ' +
335
- 'Ensure your playwright.config.ts has projects configured with testDir.');
336
- }
337
- return buildTestIdFromRuntime(test.location.file, test.titlePath(), {
338
- projectName: test.parent?.project()?.name,
339
- baseDir: testDir,
340
- });
341
- }
342
- }
343
- //# sourceMappingURL=reporter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"reporter.js","sourceRoot":"","sources":["../src/reporter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AASlC,OAAO,EACL,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,mBAAmB,CAAC;AAE3B,mBAAmB;AACnB,MAAM,MAAM,GAAG;IACb,KAAK,EAAE,UAAU;IACjB,GAAG,EAAE,UAAU;IACf,MAAM,EAAE,UAAU;IAClB,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,SAAS;IAChB,IAAI,EAAE,SAAS;CAChB,CAAC;AAEF,iCAAiC;AACjC,MAAM,SAAS,GACb,OAAO,CAAC,GAAG,CAAC,WAAW,KAAK,GAAG;IAC/B,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,SAAS;IAClC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC;AAEvB,SAAS,KAAK,CAAC,IAAyB,EAAE,IAAY;IACpD,OAAO,SAAS,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,GAAG,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CA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