summaryrefslogtreecommitdiff
path: root/karma.conf.js
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2020-06-23 13:56:33 +0200
committerPierre Ossman <ossman@cendio.se>2020-06-23 13:56:33 +0200
commit2835616b7584b2ed2f6e2477d028aa718fe86c9e (patch)
tree545c133e4cd9f961e16f6475779eee58696418db /karma.conf.js
parent643442feac2bf95f526738eab5b03a267d38fb85 (diff)
downloadnovnc-2835616b7584b2ed2f6e2477d028aa718fe86c9e.tar.gz
Use GitHub actions instead of Travis/Sauce Labs
The ability to use Sauce Labs for pull requests has now stopped working, as Travis warned about several years ago. Instead run our tests directly on GitHub on their various virtual machines.
Diffstat (limited to 'karma.conf.js')
-rw-r--r--karma.conf.js78
1 files changed, 20 insertions, 58 deletions
diff --git a/karma.conf.js b/karma.conf.js
index 0e316f1..c295b1f 100644
--- a/karma.conf.js
+++ b/karma.conf.js
@@ -1,48 +1,23 @@
// Karma configuration
+// The Safari launcher is broken, so construct our own
+function SafariBrowser(id, baseBrowserDecorator, args) {
+ baseBrowserDecorator(this);
+
+ this._start = function(url) {
+ this._execCommand('/usr/bin/open', ['-W', '-n', '-a', 'Safari', url]);
+ }
+}
+
+SafariBrowser.prototype = {
+ name: 'Safari'
+}
+
module.exports = (config) => {
- const customLaunchers = {};
let browsers = [];
- let useSauce = false;
-
- // use Sauce when running on Travis
- if (process.env.TRAVIS_JOB_NUMBER) {
- useSauce = true;
- }
-
- if (useSauce && process.env.TEST_BROWSER_NAME && process.env.TEST_BROWSER_NAME != 'PhantomJS') {
- const names = process.env.TEST_BROWSER_NAME.split(',');
- const platforms = process.env.TEST_BROWSER_OS.split(',');
- const versions = process.env.TEST_BROWSER_VERSION
- ? process.env.TEST_BROWSER_VERSION.split(',')
- : [null];
-
- for (let i = 0; i < names.length; i++) {
- for (let j = 0; j < platforms.length; j++) {
- for (let k = 0; k < versions.length; k++) {
- let launcher_name = 'sl_' + platforms[j].replace(/[^a-zA-Z0-9]/g, '') + '_' + names[i];
- if (versions[k]) {
- launcher_name += '_' + versions[k];
- }
-
- customLaunchers[launcher_name] = {
- base: 'SauceLabs',
- browserName: names[i],
- platform: platforms[j],
- };
-
- if (versions[i]) {
- customLaunchers[launcher_name].version = versions[k];
- }
- }
- }
- }
- browsers = Object.keys(customLaunchers);
- } else {
- useSauce = false;
- //browsers = ['PhantomJS'];
- browsers = [];
+ if (process.env.TEST_BROWSER_NAME) {
+ browsers = process.env.TEST_BROWSER_NAME.split(',');
}
const my_conf = {
@@ -80,7 +55,11 @@ module.exports = (config) => {
exclude: [
],
- customLaunchers: customLaunchers,
+ plugins: [
+ 'karma-*',
+ '@chiragrupani/karma-chromium-edge-launcher',
+ { 'launcher:Safari': [ 'type', SafariBrowser ] },
+ ],
// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
@@ -103,24 +82,7 @@ module.exports = (config) => {
// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: true,
-
- // Increase timeout in case connection is slow/we run more browsers than possible
- // (we currently get 3 for free, and we try to run 7, so it can take a while)
- captureTimeout: 240000,
-
- // similarly to above
- browserNoActivityTimeout: 100000,
};
- if (useSauce) {
- my_conf.reporters.push('saucelabs');
- my_conf.captureTimeout = 0; // use SL timeout
- my_conf.sauceLabs = {
- testName: 'noVNC Tests (all)',
- startConnect: false,
- tunnelIdentifier: process.env.TRAVIS_JOB_NUMBER
- };
- }
-
config.set(my_conf);
};