Prechádzať zdrojové kódy

E2E: add `test-e2e-webgpu` (#29133)

sunag 1 rok pred
rodič
commit
9187311390
2 zmenil súbory, kde vykonal 22 pridanie a 2 odobranie
  1. 1 0
      package.json
  2. 21 2
      test/e2e/puppeteer.js

+ 1 - 0
package.json

@@ -62,6 +62,7 @@
     "test-unit-addons": "qunit -r failonlyreporter -f !-webonly test/unit/three.addons.unit.js",
     "test-e2e": "node test/e2e/puppeteer.js",
     "test-e2e-cov": "node test/e2e/check-coverage.js",
+    "test-e2e-webgpu": "node test/e2e/puppeteer.js --webgpu",
     "test-treeshake": "rollup -c test/rollup.treeshake.config.js",
     "test-circular-deps": "dpdm --no-warning --no-tree --exit-code circular:1 src/nodes/Nodes.js",
     "make-screenshot": "node test/e2e/puppeteer.js --make"

+ 21 - 2
test/e2e/puppeteer.js

@@ -201,9 +201,26 @@ async function main() {
 
 	/* Find files */
 
-	const isMakeScreenshot = process.argv[ 2 ] === '--make';
+	let isMakeScreenshot = false;
+	let isWebGPU = false;
 
-	const exactList = process.argv.slice( isMakeScreenshot ? 3 : 2 )
+	let argvIndex = 2;
+
+	if ( process.argv[ argvIndex ] === '--webgpu' ) {
+
+		isWebGPU = true;
+		argvIndex ++;
+
+	}
+
+	if ( process.argv[ argvIndex ] === '--make' ) {
+
+		isMakeScreenshot = true;
+		argvIndex ++;
+
+	}
+
+	const exactList = process.argv.slice( argvIndex )
 		.map( f => f.replace( '.html', '' ) );
 
 	const isExactList = exactList.length !== 0;
@@ -227,6 +244,8 @@ async function main() {
 
 	}
 
+	if ( isWebGPU ) files = files.filter( f => f.includes( 'webgpu_' ) );
+
 	/* CI parallelism */
 
 	if ( 'CI' in process.env ) {

粤ICP备19079148号