From efd416b71f0925108ff7cb0e83e99beabe7c05cd Mon Sep 17 00:00:00 2001 From: Yulong Wang <7679871+fs-eire@users.noreply.github.com> Date: Fri, 15 Sep 2023 14:40:22 -0700 Subject: [PATCH] [js/web] update test to explicitly fail for webnn without proxy (#17554) ### Description Update test to explicitly fail for webnn without proxy. I am doing this change because if I test webnn with other backend together, it silently enables proxy. I want to make test runner behave with less implicit flag reset. If proxy is not enabled, webnn test should fail. @Honry please let me know if other places (eg. CI scripts) should change also. --- js/web/script/test-runner-cli-args.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/js/web/script/test-runner-cli-args.ts b/js/web/script/test-runner-cli-args.ts index 7b41850948..f90f568879 100644 --- a/js/web/script/test-runner-cli-args.ts +++ b/js/web/script/test-runner-cli-args.ts @@ -382,8 +382,7 @@ export function parseTestRunnerCliArgs(cmdlineArgs: string[]): TestRunnerCliArgs const globalEnvFlags = parseGlobalEnvFlags(args); if (backend.includes('webnn') && !globalEnvFlags.wasm!.proxy) { - // Backend webnn is restricted in the dedicated worker. - globalEnvFlags.wasm!.proxy = true; + throw new Error('Backend webnn requires flag "wasm-enable-proxy" to be set to true.'); } // Options: