瀏覽代碼

Update puppeteer.js

Mr.doob 3 年之前
父節點
當前提交
90723adaf7
共有 1 個文件被更改,包括 13 次插入3 次删除
  1. 13 3
      test/e2e/puppeteer.js

+ 13 - 3
test/e2e/puppeteer.js

@@ -142,9 +142,19 @@ const pup = puppeteer.launch( {
 
 	let pageSize, file, attemptProgress;
 	const failedScreenshots = [];
-	const isParallel = 'CI' in process.env;
-	const beginId = isParallel ? Math.floor( parseInt( process.env.CI.slice( 0, 1 ) ) * files.length / 8 ) : 0;
-	const endId = isParallel ? Math.floor( ( parseInt( process.env.CI.slice( - 1 ) ) + 1 ) * files.length / 8 ) : files.length;
+	const parallel
+
+	let beginId = 0;
+	let endId = files.length;
+
+	if ( 'CI' in process.env ) {
+		
+		const jobs = 8;
+		
+		beginId = Math.floor( parseInt( process.env.CI.slice( 0, 1 ) ) * files.length / jobs );
+		endId = Math.floor( ( parseInt( process.env.CI.slice( - 1 ) ) + 1 ) * files.length / jobs );
+		
+	}
 
 	for ( let id = beginId; id < endId; ++ id ) {