File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,14 +5,9 @@ import { partitionFiles } from '@scripts/duration-shards'
55import { createLogger } from '@sim/logger'
66import { escapeRegExp } from '@sim/utils/string'
77
8- interface Suite {
9- specs ?: { file : string } [ ]
10- suites ?: Suite [ ]
11- }
12-
138interface DiscoveryReport {
149 config : { rootDir : string }
15- suites : Suite [ ]
10+ suites : { file : string } [ ]
1611 errors : unknown [ ]
1712}
1813
@@ -36,12 +31,8 @@ if (discovery.status !== 0) process.exit(discovery.status ?? 1)
3631const discoveryJson = readFileSync ( discoveryPath , 'utf8' )
3732const report = JSON . parse ( discoveryJson ) as DiscoveryReport
3833if ( report . errors . length > 0 ) throw new Error ( 'Playwright discovery reported errors' )
39- const files = new Set < string > ( )
40- function visit ( suite : Suite ) : void {
41- for ( const spec of suite . specs ?? [ ] ) files . add ( spec . file )
42- for ( const child of suite . suites ?? [ ] ) visit ( child )
43- }
44- for ( const suite of report . suites ) visit ( suite )
34+ // A test factory can declare tests in a helper; the outer suite owns the discoverable test file.
35+ const files = new Set ( report . suites . map ( ( suite ) => suite . file ) )
4536if ( count > files . size ) throw new Error ( 'More desktop shards than discovered test files' )
4637const durations = JSON . parse (
4738 readFileSync ( new URL ( '../apps/desktop/e2e-durations.json' , import . meta. url ) , 'utf8' )
You can’t perform that action at this time.
0 commit comments