@@ -36,6 +36,8 @@ async function runConsoleTests(runJs, defaultReporter, runInParallel, watchMode,
3636 const testConfigFile = "test.config" ;
3737 const failed = cmdLineOptions . failed ;
3838 const keepFailed = cmdLineOptions . keepFailed ;
39+ const shards = + cmdLineOptions . shards || undefined ;
40+ const shardId = + cmdLineOptions . shardId || undefined ;
3941 if ( ! cmdLineOptions . dirty ) {
4042 await cleanTestDirs ( ) ;
4143 cancelToken . throwIfCancellationRequested ( ) ;
@@ -63,8 +65,8 @@ async function runConsoleTests(runJs, defaultReporter, runInParallel, watchMode,
6365 testTimeout = 400000 ;
6466 }
6567
66- if ( tests || runners || light || testTimeout || taskConfigsFolder || keepFailed || skipPercent !== undefined ) {
67- writeTestConfigFile ( tests , runners , light , skipPercent , taskConfigsFolder , workerCount , stackTraceLimit , testTimeout , keepFailed ) ;
68+ if ( tests || runners || light || testTimeout || taskConfigsFolder || keepFailed || skipPercent !== undefined || shards || shardId ) {
69+ writeTestConfigFile ( tests , runners , light , skipPercent , taskConfigsFolder , workerCount , stackTraceLimit , testTimeout , keepFailed , shards , shardId ) ;
6870 }
6971
7072 const colors = cmdLineOptions . colors ;
@@ -165,8 +167,10 @@ exports.cleanTestDirs = cleanTestDirs;
165167 * @param {string } [stackTraceLimit]
166168 * @param {string | number } [timeout]
167169 * @param {boolean } [keepFailed]
170+ * @param {number | undefined } [shards]
171+ * @param {number | undefined } [shardId]
168172 */
169- function writeTestConfigFile ( tests , runners , light , skipPercent , taskConfigsFolder , workerCount , stackTraceLimit , timeout , keepFailed ) {
173+ function writeTestConfigFile ( tests , runners , light , skipPercent , taskConfigsFolder , workerCount , stackTraceLimit , timeout , keepFailed , shards , shardId ) {
170174 const testConfigContents = JSON . stringify ( {
171175 test : tests ? [ tests ] : undefined ,
172176 runners : runners ? runners . split ( "," ) : undefined ,
@@ -177,7 +181,9 @@ function writeTestConfigFile(tests, runners, light, skipPercent, taskConfigsFold
177181 taskConfigsFolder,
178182 noColor : ! cmdLineOptions . colors ,
179183 timeout,
180- keepFailed
184+ keepFailed,
185+ shards,
186+ shardId
181187 } ) ;
182188 log . info ( "Running tests with config: " + testConfigContents ) ;
183189 fs . writeFileSync ( "test.config" , testConfigContents ) ;
0 commit comments