Sfoglia il codice sorgente

[wasm] Add browser test suite. (#13145)

* [wasm] Add browser test suite.

- Runs a series of tests against the HttpClientHandler and blob tests.

* Setup custom browser launcher to pass `--no-sandbox` to work on CI

* Remove auto client config that caused async errors on tests.
Kenneth Pouncey 6 anni fa
parent
commit
07287648b2

+ 1 - 0
scripts/ci/run-jenkins.sh

@@ -262,6 +262,7 @@ if [[ ${CI_TAGS} == *'webassembly'* ]] || [[ ${CI_TAGS} == *'wasm'* ]];
             ${TESTCMD} --label=sm-system-core --timeout=60m $gnumake -C sdks/wasm run-sm-system-core
             ${TESTCMD} --label=jsc-system-core --timeout=60m $gnumake -C sdks/wasm run-jsc-system-core
             ${TESTCMD} --label=debugger --timeout=60m $gnumake -C sdks/wasm test-debugger
+            ${TESTCMD} --label=browser --timeout=60m $gnumake -C sdks/wasm run-browser-tests
             ${TESTCMD} --label=v8-corlib --timeout=60m $gnumake -C sdks/wasm run-v8-corlib
             ${TESTCMD} --label=aot-mini --timeout=60m $gnumake -j ${CI_CPU_COUNT} -C sdks/wasm run-aot-mini
             ${TESTCMD} --label=build-aot-all --timeout=60m $gnumake -j ${CI_CPU_COUNT} -C sdks/wasm build-aot-all

+ 7 - 2
sdks/wasm/tests/browser/karma.conf.js

@@ -31,7 +31,13 @@ module.exports = function(config) {
         //load karma-jasmine-dom and karma-jasmine
         frameworks: ['jasmine-dom','jasmine','mocha', 'chai'],
         //load karma-chrome-launcher
-        browsers: ['ChromeHeadless'],
+        browsers: ['ChromeHeadless', 'NoSandBoxHeadless'],
+        customLaunchers: {
+            NoSandBoxHeadless: {
+                base: 'ChromeHeadless',
+                flags: ['--no-sandbox']
+            }
+        },
         logLevel: config.LOG_INFO,
         client: {
             //If false, Karma will not remove iframes upon the completion of running the tests
@@ -43,7 +49,6 @@ module.exports = function(config) {
                     //the 'index' tag will be used to get the access to the Document object of 'index.html'
                     {src:'./publish/http-spec.html', tag:'httpspec'}
                 ],
-                auto: true,
                 timeout: 10000,
                 abort: 60000,
                 width: "730px",

+ 1 - 1
sdks/wasm/tests/browser/package.json

@@ -4,7 +4,7 @@
   "description": "",
   "main": "karma.conf.js",
   "scripts": {
-    "test": "karma start --single-run --browsers ChromeHeadless karma.conf.js",
+    "test": "karma start --single-run --browsers NoSandBoxHeadless karma.conf.js",
     "test:keep-alive": "karma start --browsers ChromeHeadless karma.conf.js"
   },
   "author": "",