@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.
- package/README.md +76 -133
- package/dist/commands/assign.d.ts +2 -0
- package/dist/commands/assign.d.ts.map +1 -1
- package/dist/commands/assign.js +44 -3
- package/dist/commands/assign.js.map +1 -1
- package/dist/commands/extract-timing.d.ts +0 -1
- package/dist/commands/extract-timing.d.ts.map +1 -1
- package/dist/commands/extract-timing.js +2 -32
- package/dist/commands/extract-timing.js.map +1 -1
- package/dist/core/ckk-algorithm.d.ts +1 -1
- package/dist/core/ckk-algorithm.d.ts.map +1 -1
- package/dist/core/ckk-algorithm.js +130 -36
- package/dist/core/ckk-algorithm.js.map +1 -1
- package/dist/core/estimate.d.ts +11 -0
- package/dist/core/estimate.d.ts.map +1 -1
- package/dist/core/estimate.js +43 -0
- package/dist/core/estimate.js.map +1 -1
- package/dist/core/test-discovery.d.ts +17 -3
- package/dist/core/test-discovery.d.ts.map +1 -1
- package/dist/core/test-discovery.js +39 -19
- package/dist/core/test-discovery.js.map +1 -1
- package/dist/core/test-id.d.ts +23 -67
- package/dist/core/test-id.d.ts.map +1 -1
- package/dist/core/test-id.js +29 -86
- package/dist/core/test-id.js.map +1 -1
- package/dist/core/types.d.ts +2 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/types.js.map +1 -1
- package/package.json +1 -26
- package/dist/commands/filter-report.d.ts +0 -19
- package/dist/commands/filter-report.d.ts.map +0 -1
- package/dist/commands/filter-report.js +0 -103
- package/dist/commands/filter-report.js.map +0 -1
- package/dist/fixture.d.ts +0 -75
- package/dist/fixture.d.ts.map +0 -1
- package/dist/fixture.js +0 -148
- package/dist/fixture.js.map +0 -1
- package/dist/reporter.d.ts +0 -93
- package/dist/reporter.d.ts.map +0 -1
- package/dist/reporter.js +0 -343
- package/dist/reporter.js.map +0 -1
package/dist/core/test-id.d.ts
CHANGED
|
@@ -1,86 +1,42 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Test ID Generation Module
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* CRITICAL: All components MUST use these shared functions to ensure
|
|
8
|
-
* test IDs match between shard assignment and runtime filtering.
|
|
9
|
-
*
|
|
10
|
-
* There are two contexts for test ID generation:
|
|
11
|
-
* 1. Discovery context: Uses buildTestId from types.ts (data from Playwright JSON)
|
|
12
|
-
* 2. Runtime context: Uses buildTestIdFromRuntime (data from testInfo.titlePath)
|
|
4
|
+
* Provides shared functions for generating consistent test IDs
|
|
5
|
+
* and converting them to Playwright's --test-list format.
|
|
13
6
|
*
|
|
14
7
|
* @module @nsxbet/playwright-orchestrator/core/test-id
|
|
15
8
|
*/
|
|
16
9
|
/**
|
|
17
|
-
*
|
|
10
|
+
* Minimal test entry for test-list format conversion.
|
|
11
|
+
* Uses the structured data from Playwright's --list JSON directly,
|
|
12
|
+
* avoiding the lossy parseTestId round-trip (test names may contain `::`)
|
|
18
13
|
*/
|
|
19
|
-
export interface
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
/** File name (basename) to exclude from titlePath */
|
|
23
|
-
fileName?: string;
|
|
14
|
+
export interface TestListEntry {
|
|
15
|
+
file: string;
|
|
16
|
+
titlePath: string[];
|
|
24
17
|
}
|
|
25
18
|
/**
|
|
26
|
-
*
|
|
27
|
-
* describe blocks and test title.
|
|
19
|
+
* Convert a test entry to Playwright's --test-list format.
|
|
28
20
|
*
|
|
29
|
-
*
|
|
30
|
-
* - Project name (e.g., "chromium")
|
|
31
|
-
* - File path or filename
|
|
32
|
-
* - Describe block titles
|
|
33
|
-
* - Test title
|
|
21
|
+
* Test-list format: `file › describe › test`
|
|
34
22
|
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
23
|
+
* When testDirPrefix is provided (monorepo case where testDir != rootDir),
|
|
24
|
+
* the prefix is prepended to the file path so paths are relative to rootDir.
|
|
37
25
|
*
|
|
38
|
-
* @param
|
|
39
|
-
* @param
|
|
40
|
-
* @returns
|
|
41
|
-
*/
|
|
42
|
-
export declare function filterRuntimeTitlePath(titlePath: string[], options?: FilterTitlePathOptions): string[];
|
|
43
|
-
/**
|
|
44
|
-
* Options for building a test ID from runtime data
|
|
26
|
+
* @param entry - Test entry with file and titlePath from Playwright discovery
|
|
27
|
+
* @param testDirPrefix - Relative path from rootDir to testDir (e.g. `src/test/e2e`)
|
|
28
|
+
* @returns Test-list formatted string (e.g. `src/test/e2e/login.spec.ts › Login › should login`)
|
|
45
29
|
*/
|
|
46
|
-
export
|
|
47
|
-
/** Playwright project name to exclude from titlePath */
|
|
48
|
-
projectName?: string;
|
|
49
|
-
/**
|
|
50
|
-
* Base directory for relative path resolution.
|
|
51
|
-
* REQUIRED: Must be testInfo.project.testDir from Playwright.
|
|
52
|
-
* No fallback to process.cwd() - this caused the rootDir vs testDir bug.
|
|
53
|
-
*/
|
|
54
|
-
baseDir: string;
|
|
55
|
-
}
|
|
30
|
+
export declare function toTestListFormat(entry: TestListEntry, testDirPrefix?: string): string;
|
|
56
31
|
/**
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
* CRITICAL: The baseDir MUST be the project's testDir (testInfo.project.testDir).
|
|
60
|
-
* This ensures test IDs match between discovery and runtime filtering.
|
|
61
|
-
*
|
|
62
|
-
* This function:
|
|
63
|
-
* 1. Converts the absolute file path to relative (using baseDir)
|
|
64
|
-
* 2. Filters the titlePath to remove project name, filename, and file paths
|
|
65
|
-
* 3. Joins file and filtered titles with "::"
|
|
66
|
-
*
|
|
67
|
-
* The resulting test ID format: {relative-file}::{describe1}::{describe2}::{testTitle}
|
|
32
|
+
* Convert an array of test entries to a complete test-list file content.
|
|
68
33
|
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
* @param options - Options for path resolution and filtering (baseDir is REQUIRED)
|
|
72
|
-
* @returns Test ID string
|
|
73
|
-
* @throws Error if baseDir is not provided
|
|
34
|
+
* Each line is one test in Playwright's --test-list format, with a trailing newline.
|
|
35
|
+
* Returns empty string for an empty array.
|
|
74
36
|
*
|
|
75
|
-
* @
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
* '/project/src/test/e2e/login.spec.ts',
|
|
79
|
-
* ['chromium', 'login.spec.ts', 'Login', 'should work'],
|
|
80
|
-
* { projectName: 'chromium', baseDir: '/project/src/test/e2e' }
|
|
81
|
-
* );
|
|
82
|
-
* // Result: 'login.spec.ts::Login::should work'
|
|
83
|
-
* ```
|
|
37
|
+
* @param entries - Array of test entries from Playwright discovery
|
|
38
|
+
* @param testDirPrefix - Relative path from rootDir to testDir
|
|
39
|
+
* @returns Ready-to-write test-list file content
|
|
84
40
|
*/
|
|
85
|
-
export declare function
|
|
41
|
+
export declare function toTestListFile(entries: TestListEntry[], testDirPrefix?: string): string;
|
|
86
42
|
//# sourceMappingURL=test-id.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-id.d.ts","sourceRoot":"","sources":["../../src/core/test-id.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"test-id.d.ts","sourceRoot":"","sources":["../../src/core/test-id.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,aAAa,EACpB,aAAa,CAAC,EAAE,MAAM,GACrB,MAAM,CAUR;AAED;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,aAAa,EAAE,EACxB,aAAa,CAAC,EAAE,MAAM,GACrB,MAAM,CAGR"}
|
package/dist/core/test-id.js
CHANGED
|
@@ -1,104 +1,47 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Test ID Generation Module
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* CRITICAL: All components MUST use these shared functions to ensure
|
|
8
|
-
* test IDs match between shard assignment and runtime filtering.
|
|
9
|
-
*
|
|
10
|
-
* There are two contexts for test ID generation:
|
|
11
|
-
* 1. Discovery context: Uses buildTestId from types.ts (data from Playwright JSON)
|
|
12
|
-
* 2. Runtime context: Uses buildTestIdFromRuntime (data from testInfo.titlePath)
|
|
4
|
+
* Provides shared functions for generating consistent test IDs
|
|
5
|
+
* and converting them to Playwright's --test-list format.
|
|
13
6
|
*
|
|
14
7
|
* @module @nsxbet/playwright-orchestrator/core/test-id
|
|
15
8
|
*/
|
|
16
|
-
|
|
9
|
+
const TEST_LIST_SEPARATOR = ' › ';
|
|
17
10
|
/**
|
|
18
|
-
*
|
|
19
|
-
* describe blocks and test title.
|
|
11
|
+
* Convert a test entry to Playwright's --test-list format.
|
|
20
12
|
*
|
|
21
|
-
*
|
|
22
|
-
* - Project name (e.g., "chromium")
|
|
23
|
-
* - File path or filename
|
|
24
|
-
* - Describe block titles
|
|
25
|
-
* - Test title
|
|
13
|
+
* Test-list format: `file › describe › test`
|
|
26
14
|
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
15
|
+
* When testDirPrefix is provided (monorepo case where testDir != rootDir),
|
|
16
|
+
* the prefix is prepended to the file path so paths are relative to rootDir.
|
|
29
17
|
*
|
|
30
|
-
* @param
|
|
31
|
-
* @param
|
|
32
|
-
* @returns
|
|
18
|
+
* @param entry - Test entry with file and titlePath from Playwright discovery
|
|
19
|
+
* @param testDirPrefix - Relative path from rootDir to testDir (e.g. `src/test/e2e`)
|
|
20
|
+
* @returns Test-list formatted string (e.g. `src/test/e2e/login.spec.ts › Login › should login`)
|
|
33
21
|
*/
|
|
34
|
-
export function
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
// Filter filename
|
|
44
|
-
if (fileName && title === fileName)
|
|
45
|
-
return false;
|
|
46
|
-
// Filter out file paths (contain / or \)
|
|
47
|
-
if (title.includes('/') || title.includes('\\'))
|
|
48
|
-
return false;
|
|
49
|
-
// Filter out spec/test file extensions
|
|
50
|
-
if (title.endsWith('.spec.ts') || title.endsWith('.test.ts'))
|
|
51
|
-
return false;
|
|
52
|
-
if (title.endsWith('.spec.js') || title.endsWith('.test.js'))
|
|
53
|
-
return false;
|
|
54
|
-
return true;
|
|
55
|
-
});
|
|
22
|
+
export function toTestListFormat(entry, testDirPrefix) {
|
|
23
|
+
const cleanPrefix = (testDirPrefix ?? '')
|
|
24
|
+
.replace(/\\/g, '/')
|
|
25
|
+
.replace(/\/+$/, '');
|
|
26
|
+
const normalizedFile = entry.file.replace(/\\/g, '/');
|
|
27
|
+
const fullPath = cleanPrefix
|
|
28
|
+
? `${cleanPrefix}/${normalizedFile}`
|
|
29
|
+
: normalizedFile;
|
|
30
|
+
return [fullPath, ...entry.titlePath].join(TEST_LIST_SEPARATOR);
|
|
56
31
|
}
|
|
57
32
|
/**
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
* CRITICAL: The baseDir MUST be the project's testDir (testInfo.project.testDir).
|
|
61
|
-
* This ensures test IDs match between discovery and runtime filtering.
|
|
62
|
-
*
|
|
63
|
-
* This function:
|
|
64
|
-
* 1. Converts the absolute file path to relative (using baseDir)
|
|
65
|
-
* 2. Filters the titlePath to remove project name, filename, and file paths
|
|
66
|
-
* 3. Joins file and filtered titles with "::"
|
|
67
|
-
*
|
|
68
|
-
* The resulting test ID format: {relative-file}::{describe1}::{describe2}::{testTitle}
|
|
33
|
+
* Convert an array of test entries to a complete test-list file content.
|
|
69
34
|
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
* @param options - Options for path resolution and filtering (baseDir is REQUIRED)
|
|
73
|
-
* @returns Test ID string
|
|
74
|
-
* @throws Error if baseDir is not provided
|
|
35
|
+
* Each line is one test in Playwright's --test-list format, with a trailing newline.
|
|
36
|
+
* Returns empty string for an empty array.
|
|
75
37
|
*
|
|
76
|
-
* @
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
* '/project/src/test/e2e/login.spec.ts',
|
|
80
|
-
* ['chromium', 'login.spec.ts', 'Login', 'should work'],
|
|
81
|
-
* { projectName: 'chromium', baseDir: '/project/src/test/e2e' }
|
|
82
|
-
* );
|
|
83
|
-
* // Result: 'login.spec.ts::Login::should work'
|
|
84
|
-
* ```
|
|
38
|
+
* @param entries - Array of test entries from Playwright discovery
|
|
39
|
+
* @param testDirPrefix - Relative path from rootDir to testDir
|
|
40
|
+
* @returns Ready-to-write test-list file content
|
|
85
41
|
*/
|
|
86
|
-
export function
|
|
87
|
-
if (
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
'Do NOT use process.cwd() as it causes path mismatch bugs.');
|
|
91
|
-
}
|
|
92
|
-
const { projectName, baseDir } = options;
|
|
93
|
-
// Convert absolute path to relative
|
|
94
|
-
const file = path.relative(baseDir, filePath).replace(/\\/g, '/');
|
|
95
|
-
// Get filename for filtering
|
|
96
|
-
const fileName = path.basename(filePath);
|
|
97
|
-
// Filter titlePath
|
|
98
|
-
const filteredTitles = filterRuntimeTitlePath(titlePath, {
|
|
99
|
-
projectName,
|
|
100
|
-
fileName,
|
|
101
|
-
});
|
|
102
|
-
return [file, ...filteredTitles].join('::');
|
|
42
|
+
export function toTestListFile(entries, testDirPrefix) {
|
|
43
|
+
if (entries.length === 0)
|
|
44
|
+
return '';
|
|
45
|
+
return `${entries.map((e) => toTestListFormat(e, testDirPrefix)).join('\n')}\n`;
|
|
103
46
|
}
|
|
104
47
|
//# sourceMappingURL=test-id.js.map
|
package/dist/core/test-id.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-id.js","sourceRoot":"","sources":["../../src/core/test-id.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"test-id.js","sourceRoot":"","sources":["../../src/core/test-id.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,mBAAmB,GAAG,KAAK,CAAC;AAYlC;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,gBAAgB,CAC9B,KAAoB,EACpB,aAAsB;IAEtB,MAAM,WAAW,GAAG,CAAC,aAAa,IAAI,EAAE,CAAC;SACtC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC;SACnB,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IACvB,MAAM,cAAc,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IACtD,MAAM,QAAQ,GAAG,WAAW;QAC1B,CAAC,CAAC,GAAG,WAAW,IAAI,cAAc,EAAE;QACpC,CAAC,CAAC,cAAc,CAAC;IAEnB,OAAO,CAAC,QAAQ,EAAE,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;AAClE,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,cAAc,CAC5B,OAAwB,EACxB,aAAsB;IAEtB,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IACpC,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,gBAAgB,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;AAClF,CAAC"}
|
package/dist/core/types.d.ts
CHANGED
|
@@ -95,6 +95,8 @@ export interface TestAssignResult {
|
|
|
95
95
|
estimatedTests: string[];
|
|
96
96
|
/** Whether CKK found optimal solution (false = fell back to LPT) */
|
|
97
97
|
isOptimal: boolean;
|
|
98
|
+
/** Map of shard index to Playwright --test-list file content (rootDir-relative paths) */
|
|
99
|
+
testListFiles: Record<number, string>;
|
|
98
100
|
}
|
|
99
101
|
/**
|
|
100
102
|
* Per-shard timing artifact uploaded after test run (test-level)
|
package/dist/core/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,uCAAuC;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,+BAA+B;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,kDAAkD;IAClD,IAAI,EAAE,MAAM,CAAC;IACb,wCAAwC;IACxC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,qBAAqB;IACrB,OAAO,EAAE,CAAC,CAAC;IACX,mCAAmC;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,2CAA2C;IAC3C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;CACvC;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,6CAA6C;IAC7C,IAAI,EAAE,MAAM,CAAC;IACb,+BAA+B;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,8DAA8D;IAC9D,SAAS,EAAE,OAAO,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,mDAAmD;IACnD,MAAM,EAAE,MAAM,CAAC;IACf,kBAAkB;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,+BAA+B;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,8DAA8D;IAC9D,SAAS,EAAE,OAAO,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,4BAA4B;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,gDAAgD;IAChD,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,8CAA8C;IAC9C,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,4BAA4B;IAC5B,UAAU,EAAE,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/core/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":"AAyMA,6CAA6C;AAC7C,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC;AAErC;;GAEG;AACH,MAAM,UAAU,qBAAqB;IACnC,OAAO;QACL,OAAO,EAAE,mBAAmB;QAC5B,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;QACnC,KAAK,EAAE,EAAE;KACV,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,IAAY,EAAE,SAAmB;IAC3D,OAAO,CAAC,IAAI,EAAE,GAAG,SAAS,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACzC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,MAAc;IAIxC,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACjC,OAAO;QACL,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE;QACpB,SAAS,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;KAC1B,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,18 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nsxbet/playwright-orchestrator",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Intelligent Playwright test distribution across CI shards using historical timing data",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
8
|
"typesVersions": {
|
|
9
9
|
"*": {
|
|
10
|
-
"reporter": [
|
|
11
|
-
"./dist/reporter.d.ts"
|
|
12
|
-
],
|
|
13
|
-
"fixture": [
|
|
14
|
-
"./dist/fixture.d.ts"
|
|
15
|
-
],
|
|
16
10
|
"core": [
|
|
17
11
|
"./dist/core/index.d.ts"
|
|
18
12
|
]
|
|
@@ -24,16 +18,6 @@
|
|
|
24
18
|
"import": "./dist/index.js",
|
|
25
19
|
"require": "./dist/index.js"
|
|
26
20
|
},
|
|
27
|
-
"./reporter": {
|
|
28
|
-
"types": "./dist/reporter.d.ts",
|
|
29
|
-
"import": "./dist/reporter.js",
|
|
30
|
-
"require": "./dist/reporter.js"
|
|
31
|
-
},
|
|
32
|
-
"./fixture": {
|
|
33
|
-
"types": "./dist/fixture.d.ts",
|
|
34
|
-
"import": "./dist/fixture.js",
|
|
35
|
-
"require": "./dist/fixture.js"
|
|
36
|
-
},
|
|
37
21
|
"./core": {
|
|
38
22
|
"types": "./dist/core/index.d.ts",
|
|
39
23
|
"import": "./dist/core/index.js",
|
|
@@ -99,16 +83,7 @@
|
|
|
99
83
|
"@biomejs/biome": "2.3.11",
|
|
100
84
|
"@changesets/changelog-github": "^0.5.2",
|
|
101
85
|
"@changesets/cli": "^2.29.8",
|
|
102
|
-
"@playwright/test": "^1.40.0",
|
|
103
86
|
"@types/node": "22.15.29",
|
|
104
87
|
"typescript": "5.9.3"
|
|
105
|
-
},
|
|
106
|
-
"peerDependencies": {
|
|
107
|
-
"@playwright/test": ">=1.20.0"
|
|
108
|
-
},
|
|
109
|
-
"peerDependenciesMeta": {
|
|
110
|
-
"@playwright/test": {
|
|
111
|
-
"optional": true
|
|
112
|
-
}
|
|
113
88
|
}
|
|
114
89
|
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Command } from '@oclif/core';
|
|
2
|
-
export default class FilterReport extends Command {
|
|
3
|
-
static description: string;
|
|
4
|
-
static examples: string[];
|
|
5
|
-
static flags: {
|
|
6
|
-
'report-file': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
|
-
'output-file': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
-
verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
9
|
-
};
|
|
10
|
-
run(): Promise<void>;
|
|
11
|
-
/**
|
|
12
|
-
* Remove specs where ALL tests are orchestrator-skipped
|
|
13
|
-
* (status "skipped" with annotation "Not in shard").
|
|
14
|
-
* Prune empty suites after removal.
|
|
15
|
-
*/
|
|
16
|
-
private filterSuites;
|
|
17
|
-
private countSpecs;
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=filter-report.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"filter-report.d.ts","sourceRoot":"","sources":["../../src/commands/filter-report.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAS,MAAM,aAAa,CAAC;AAE7C,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,OAAO;IAC/C,OAAgB,WAAW,SACyC;IAEpE,OAAgB,QAAQ,WAGtB;IAEF,OAAgB,KAAK;;;;MAgBnB;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;IAwC1B;;;;OAIG;IACH,OAAO,CAAC,YAAY;IA2CpB,OAAO,CAAC,UAAU;CAYnB"}
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import * as fs from 'node:fs';
|
|
2
|
-
import * as path from 'node:path';
|
|
3
|
-
import { Command, Flags } from '@oclif/core';
|
|
4
|
-
export default class FilterReport extends Command {
|
|
5
|
-
static description = 'Remove orchestrator-skipped tests from a Playwright JSON report';
|
|
6
|
-
static examples = [
|
|
7
|
-
'<%= config.bin %> filter-report --report-file ./results.json',
|
|
8
|
-
'<%= config.bin %> filter-report --report-file ./merged.json --output-file ./filtered.json',
|
|
9
|
-
];
|
|
10
|
-
static flags = {
|
|
11
|
-
'report-file': Flags.string({
|
|
12
|
-
char: 'r',
|
|
13
|
-
description: 'Path to Playwright JSON report file',
|
|
14
|
-
required: true,
|
|
15
|
-
}),
|
|
16
|
-
'output-file': Flags.string({
|
|
17
|
-
char: 'o',
|
|
18
|
-
description: 'Path to write filtered report (defaults to overwriting input)',
|
|
19
|
-
}),
|
|
20
|
-
verbose: Flags.boolean({
|
|
21
|
-
char: 'v',
|
|
22
|
-
description: 'Show verbose output',
|
|
23
|
-
default: false,
|
|
24
|
-
}),
|
|
25
|
-
};
|
|
26
|
-
async run() {
|
|
27
|
-
const { flags } = await this.parse(FilterReport);
|
|
28
|
-
const reportPath = path.resolve(flags['report-file']);
|
|
29
|
-
if (!fs.existsSync(reportPath)) {
|
|
30
|
-
this.warn(`Report file not found: ${reportPath}`);
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
let report;
|
|
34
|
-
try {
|
|
35
|
-
report = JSON.parse(fs.readFileSync(reportPath, 'utf-8'));
|
|
36
|
-
}
|
|
37
|
-
catch {
|
|
38
|
-
this.error(`Failed to parse report: ${reportPath}`);
|
|
39
|
-
}
|
|
40
|
-
if (!report.suites) {
|
|
41
|
-
this.warn('Report has no suites, nothing to filter');
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
const suites = report.suites;
|
|
45
|
-
const beforeCount = this.countSpecs(suites);
|
|
46
|
-
this.filterSuites(suites);
|
|
47
|
-
const afterCount = this.countSpecs(suites);
|
|
48
|
-
const removed = beforeCount - afterCount;
|
|
49
|
-
const outputPath = flags['output-file']
|
|
50
|
-
? path.resolve(flags['output-file'])
|
|
51
|
-
: reportPath;
|
|
52
|
-
fs.writeFileSync(outputPath, JSON.stringify(report));
|
|
53
|
-
if (flags.verbose || removed > 0) {
|
|
54
|
-
this.log(`Filtered report: ${beforeCount} → ${afterCount} specs (removed ${removed} orchestrator-skipped)`);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Remove specs where ALL tests are orchestrator-skipped
|
|
59
|
-
* (status "skipped" with annotation "Not in shard").
|
|
60
|
-
* Prune empty suites after removal.
|
|
61
|
-
*/
|
|
62
|
-
filterSuites(suites) {
|
|
63
|
-
for (let i = suites.length - 1; i >= 0; i--) {
|
|
64
|
-
const suite = suites[i];
|
|
65
|
-
if (!suite)
|
|
66
|
-
continue;
|
|
67
|
-
if (Array.isArray(suite.specs)) {
|
|
68
|
-
suite.specs = suite.specs.filter((spec) => {
|
|
69
|
-
const tests = spec.tests;
|
|
70
|
-
if (!tests || tests.length === 0)
|
|
71
|
-
return true;
|
|
72
|
-
const allOrchestratorSkipped = tests.every((test) => {
|
|
73
|
-
const status = test.status;
|
|
74
|
-
if (status !== 'skipped')
|
|
75
|
-
return false;
|
|
76
|
-
const annotations = test.annotations;
|
|
77
|
-
return annotations?.some((a) => a.type === 'skip' && a.description === 'Not in shard');
|
|
78
|
-
});
|
|
79
|
-
return !allOrchestratorSkipped;
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
if (Array.isArray(suite.suites)) {
|
|
83
|
-
this.filterSuites(suite.suites);
|
|
84
|
-
}
|
|
85
|
-
const hasSpecs = Array.isArray(suite.specs) && suite.specs.length > 0;
|
|
86
|
-
const hasSubSuites = Array.isArray(suite.suites) && suite.suites.length > 0;
|
|
87
|
-
if (!hasSpecs && !hasSubSuites) {
|
|
88
|
-
suites.splice(i, 1);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
countSpecs(suites) {
|
|
93
|
-
let count = 0;
|
|
94
|
-
for (const suite of suites) {
|
|
95
|
-
if (Array.isArray(suite.specs))
|
|
96
|
-
count += suite.specs.length;
|
|
97
|
-
if (Array.isArray(suite.suites))
|
|
98
|
-
count += this.countSpecs(suite.suites);
|
|
99
|
-
}
|
|
100
|
-
return count;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
//# sourceMappingURL=filter-report.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"filter-report.js","sourceRoot":"","sources":["../../src/commands/filter-report.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MA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AAsC;QACvD,IAAI,KAAK,GAAG,CAAC,CAAC;QACd,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;YAC3B,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC;gBAC5B,KAAK,IAAK,KAAK,CAAC,KAAmB,CAAC,MAAM,CAAC;YAC7C,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC;gBAC7B,KAAK,IAAI,IAAI,CAAC,UAAU,CACtB,KAAK,CAAC,MAAwC,CAC/C,CAAC;QACN,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC"}
|
package/dist/fixture.d.ts
DELETED
|
@@ -1,75 +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 type { TestType } from '@playwright/test';
|
|
33
|
-
/**
|
|
34
|
-
* Creates an extended test with orchestrator filtering as an auto-fixture.
|
|
35
|
-
* This ensures tests not in the current shard are skipped.
|
|
36
|
-
*
|
|
37
|
-
* IMPORTANT: Use this function to create your test object, then export it.
|
|
38
|
-
* All test files should import the extended test, not the base test.
|
|
39
|
-
*
|
|
40
|
-
* @param test - The base test object from @playwright/test
|
|
41
|
-
* @returns Extended test with orchestrator filtering
|
|
42
|
-
*
|
|
43
|
-
* @example
|
|
44
|
-
* ```typescript
|
|
45
|
-
* // In setup.ts
|
|
46
|
-
* import { test as base } from '@playwright/test';
|
|
47
|
-
* import { withOrchestratorFilter } from '@nsxbet/playwright-orchestrator/fixture';
|
|
48
|
-
*
|
|
49
|
-
* export const test = withOrchestratorFilter(base);
|
|
50
|
-
*
|
|
51
|
-
* // In your.spec.ts
|
|
52
|
-
* import { test } from './setup';
|
|
53
|
-
* test('example', async ({ page }) => { ... });
|
|
54
|
-
* ```
|
|
55
|
-
*/
|
|
56
|
-
export declare function withOrchestratorFilter<T extends object, W extends object>(test: TestType<T, W>): TestType<T & {
|
|
57
|
-
_orchestratorFilter: undefined;
|
|
58
|
-
}, W>;
|
|
59
|
-
/**
|
|
60
|
-
* Check if a test should run based on the shard file.
|
|
61
|
-
* Can be called manually in individual tests.
|
|
62
|
-
*
|
|
63
|
-
* @param testInfo - The testInfo object from Playwright
|
|
64
|
-
* @returns true if the test should run, false if it should be skipped
|
|
65
|
-
* @throws Error if project testDir is not configured
|
|
66
|
-
*/
|
|
67
|
-
export declare function shouldRunTest(testInfo: {
|
|
68
|
-
file: string;
|
|
69
|
-
titlePath: string[];
|
|
70
|
-
project: {
|
|
71
|
-
name: string;
|
|
72
|
-
testDir: string;
|
|
73
|
-
};
|
|
74
|
-
}): boolean;
|
|
75
|
-
//# sourceMappingURL=fixture.d.ts.map
|
package/dist/fixture.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fixture.d.ts","sourceRoot":"","sources":["../src/fixture.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAGH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAuDjD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,MAAM,EACvE,IAAI,EAAE,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,GACnB,QAAQ,CAAC,CAAC,GAAG;IAAE,mBAAmB,EAAE,SAAS,CAAA;CAAE,EAAE,CAAC,CAAC,CAwDrD;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;CAC5C,GAAG,OAAO,CAUV"}
|