@nsxbet/playwright-orchestrator 1.1.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 +65 -136
- package/dist/commands/assign.d.ts.map +1 -1
- package/dist/commands/assign.js +26 -2
- 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/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 -24
- package/dist/commands/filter-report.d.ts.map +0 -1
- package/dist/commands/filter-report.js +0 -123
- 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
|
@@ -11,8 +11,19 @@ import { buildTestId } from './types.js';
|
|
|
11
11
|
* @returns List of discovered tests
|
|
12
12
|
*/
|
|
13
13
|
export function loadTestListFromFile(filePath, projectName) {
|
|
14
|
+
return loadTestListWithConfig(filePath, projectName).tests;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Load tests from a pre-generated Playwright --list JSON file, also
|
|
18
|
+
* returning rootDir and testDir from the Playwright config.
|
|
19
|
+
*
|
|
20
|
+
* @param filePath - Path to JSON file (from `npx playwright test --list --reporter=json`)
|
|
21
|
+
* @param projectName - Optional project name to find the correct testDir
|
|
22
|
+
* @returns Tests and config paths (rootDir, testDir)
|
|
23
|
+
*/
|
|
24
|
+
export function loadTestListWithConfig(filePath, projectName) {
|
|
14
25
|
const content = fs.readFileSync(filePath, 'utf-8');
|
|
15
|
-
return
|
|
26
|
+
return parsePlaywrightListOutputWithConfig(content, projectName);
|
|
16
27
|
}
|
|
17
28
|
/**
|
|
18
29
|
* Discover tests by running Playwright with --list flag
|
|
@@ -48,22 +59,34 @@ export function discoverTests(testDir, project, configDir) {
|
|
|
48
59
|
/**
|
|
49
60
|
* Parse Playwright --list JSON output
|
|
50
61
|
*
|
|
51
|
-
* CRITICAL: Uses project.testDir for path resolution to match fixture behavior.
|
|
52
|
-
* The fixture uses testInfo.project.testDir, so discovery must use the same base.
|
|
53
|
-
*
|
|
54
62
|
* @param jsonOutput - Raw JSON output from Playwright --list
|
|
55
63
|
* @param projectName - Optional project name to find the correct testDir
|
|
56
64
|
* @returns List of discovered tests
|
|
57
65
|
*/
|
|
58
66
|
export function parsePlaywrightListOutput(jsonOutput, projectName) {
|
|
67
|
+
return parsePlaywrightListOutputWithConfig(jsonOutput, projectName).tests;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Parse Playwright --list JSON output, returning both tests and config paths.
|
|
71
|
+
*
|
|
72
|
+
* @param jsonOutput - Raw JSON output from Playwright --list
|
|
73
|
+
* @param projectName - Optional project name to find the correct testDir
|
|
74
|
+
* @returns Tests and config paths (rootDir, testDir)
|
|
75
|
+
*/
|
|
76
|
+
function parsePlaywrightListOutputWithConfig(jsonOutput, projectName) {
|
|
59
77
|
const tests = [];
|
|
78
|
+
let rootDir = '';
|
|
79
|
+
let testDir = '';
|
|
80
|
+
let parsed = false;
|
|
60
81
|
const parseAndExtract = (data) => {
|
|
61
|
-
// CRITICAL: Use project.testDir instead of config.rootDir
|
|
62
|
-
// This ensures test IDs match between discovery and fixture
|
|
63
82
|
const baseDir = getProjectTestDir(data, projectName);
|
|
83
|
+
if (!data.config?.rootDir) {
|
|
84
|
+
throw new Error('[Orchestrator] Missing config.rootDir in Playwright --list JSON output.');
|
|
85
|
+
}
|
|
86
|
+
rootDir = data.config.rootDir;
|
|
87
|
+
testDir = baseDir;
|
|
88
|
+
parsed = true;
|
|
64
89
|
for (const suite of data.suites) {
|
|
65
|
-
// Root suites represent files - their title is the filename
|
|
66
|
-
// We skip this title from titlePath since it's redundant with file
|
|
67
90
|
extractTestsFromSuite(suite, [], tests, baseDir, true);
|
|
68
91
|
}
|
|
69
92
|
};
|
|
@@ -71,21 +94,24 @@ export function parsePlaywrightListOutput(jsonOutput, projectName) {
|
|
|
71
94
|
const data = JSON.parse(jsonOutput);
|
|
72
95
|
parseAndExtract(data);
|
|
73
96
|
}
|
|
74
|
-
catch {
|
|
75
|
-
// Try parsing line by line if JSON is malformed (older Playwright versions)
|
|
76
|
-
// or if output contains additional text
|
|
97
|
+
catch (error) {
|
|
77
98
|
const jsonMatch = jsonOutput.match(/\{[\s\S]*\}/);
|
|
78
99
|
if (jsonMatch) {
|
|
79
100
|
const data = JSON.parse(jsonMatch[0]);
|
|
80
101
|
parseAndExtract(data);
|
|
81
102
|
}
|
|
103
|
+
else {
|
|
104
|
+
throw new Error(`[Orchestrator] Failed to parse Playwright --list JSON output: ${error instanceof Error ? error.message : String(error)}`);
|
|
105
|
+
}
|
|
82
106
|
}
|
|
83
|
-
|
|
107
|
+
if (!parsed) {
|
|
108
|
+
throw new Error('[Orchestrator] Failed to parse Playwright --list JSON output.');
|
|
109
|
+
}
|
|
110
|
+
return { tests, rootDir, testDir };
|
|
84
111
|
}
|
|
85
112
|
/**
|
|
86
113
|
* Get the testDir for a project from Playwright config.
|
|
87
114
|
*
|
|
88
|
-
* CRITICAL: This must match what the fixture uses (testInfo.project.testDir).
|
|
89
115
|
* No fallbacks to process.cwd() - if testDir is not found, fail with clear error.
|
|
90
116
|
*
|
|
91
117
|
* @param data - Parsed Playwright JSON output
|
|
@@ -160,11 +186,6 @@ function extractTestsFromSuite(suite, parentTitles, tests, rootDir, isRootSuite
|
|
|
160
186
|
* - Full absolute path: "/Users/.../src/test/e2e/account.spec.ts"
|
|
161
187
|
*
|
|
162
188
|
* We return paths relative to rootDir for consistency.
|
|
163
|
-
* This ensures test IDs match between:
|
|
164
|
-
* - Orchestrator (running from repo root, reading test-list.json)
|
|
165
|
-
* - Fixture (running from subdirectory where tests live)
|
|
166
|
-
*
|
|
167
|
-
* Both will generate paths like "src/test/e2e/login.spec.ts" regardless of CWD.
|
|
168
189
|
*/
|
|
169
190
|
function resolveFilePath(filePath, rootDir) {
|
|
170
191
|
// If it's already an absolute path, make it relative to rootDir
|
|
@@ -189,7 +210,6 @@ export function discoverTestsFromFiles(testDir, globPattern = '**/*.spec.ts') {
|
|
|
189
210
|
const files = glob.sync(globPattern, { cwd: testDir, absolute: true });
|
|
190
211
|
for (const filePath of files) {
|
|
191
212
|
const content = fs.readFileSync(filePath, 'utf-8');
|
|
192
|
-
// Use relative path from CWD for consistency with reporter
|
|
193
213
|
const relativeFile = path
|
|
194
214
|
.relative(process.cwd(), filePath)
|
|
195
215
|
.replace(/\\/g, '/');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-discovery.js","sourceRoot":"","sources":["../../src/core/test-discovery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAM5B,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"test-discovery.js","sourceRoot":"","sources":["../../src/core/test-discovery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAo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MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;QAC9C,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACpB,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IACnC,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
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,8DA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GAEG;AACH,wBAAgB,qBAAqB,IAAI,UAAU,CAMlD;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,MAAM,CAErE;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG;IAC3C,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB,CAMA"}
|
package/dist/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,24 +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
|
-
* Check if a test has an orchestrator-skip annotation ("Not in shard").
|
|
13
|
-
*/
|
|
14
|
-
private isOrchestratorSkipped;
|
|
15
|
-
/**
|
|
16
|
-
* Remove orchestrator-skipped entries at three levels:
|
|
17
|
-
* 1. Results: strip skipped results from tests with "Not in shard" annotation
|
|
18
|
-
* 2. Tests: remove tests with no remaining results
|
|
19
|
-
* 3. Specs/Suites: remove empty specs and prune empty suites
|
|
20
|
-
*/
|
|
21
|
-
private filterSuites;
|
|
22
|
-
private countSpecs;
|
|
23
|
-
}
|
|
24
|
-
//# 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;;OAEG;IACH,OAAO,CAAC,qBAAqB;IAW7B;;;;;OAKG;IACH,OAAO,CAAC,YAAY;IA2DpB,OAAO,CAAC,UAAU;CAYnB"}
|