From adc5d4fe2d85493c87d63c8a2a4f5e64165db363 Mon Sep 17 00:00:00 2001 From: Daniel Silhavy Date: Mon, 15 Apr 2024 11:13:59 +0200 Subject: [PATCH] Test optimizations (#4454) --- .../functional/config/karma.webstorm.conf.cjs | 84 ------------------- .../test-configurations/browserstack.json | 2 +- .../config/test-configurations/local.json | 3 +- .../test-configurations/streams/smoke.json | 8 +- .../test/advanced/no-reload-after-seek.js | 9 +- test/unit/config/karma.unit.conf.cjs | 10 +-- 6 files changed, 13 insertions(+), 103 deletions(-) delete mode 100644 test/functional/config/karma.webstorm.conf.cjs diff --git a/test/functional/config/karma.webstorm.conf.cjs b/test/functional/config/karma.webstorm.conf.cjs deleted file mode 100644 index 91f240a135..0000000000 --- a/test/functional/config/karma.webstorm.conf.cjs +++ /dev/null @@ -1,84 +0,0 @@ -// Karma configuration -// Generated on Fri Jul 28 2023 10:18:59 GMT+0200 (Central European Summer Time) - -module.exports = function (config) { - config.set({ - - // base path that will be used to resolve all patterns (eg. files, exclude) - basePath: '', - - - // frameworks to use - // available frameworks: https://www.npmjs.com/search?q=keywords:karma-adapter - frameworks: ['mocha', 'webpack'], - - plugins: [ - 'karma-webpack', - 'karma-mocha', - 'karma-chrome-launcher', - ], - - - // list of files / patterns to load in the browser - files: [ - { pattern: 'test/unit/*.js', watched: false }, - { pattern: 'src/**/*.js', watched: false, included: false, nocache: true }, - ], - - // preprocess matching files before serving them to the browser - // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor - preprocessors: { - // add webpack as preprocessor - 'test/unit/*.js': ['webpack'], - }, - - webpack: { - cache: false, - resolve: { - fallback: { - stream: require.resolve('stream-browserify'), - }, - }, - }, - - - // list of files / patterns to exclude - exclude: [], - - // test results reporter to use - // possible values: 'dots', 'progress' - // available reporters: https://www.npmjs.com/search?q=keywords:karma-reporter - reporters: ['progress'], - - - // web server port - port: 9876, - - - // enable / disable colors in the output (reporters and logs) - colors: true, - - - // level of logging - // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG - logLevel: config.LOG_INFO, - - - // enable / disable watching file and executing tests whenever any file changes - autoWatch: false, - - - // start these browsers - // available browser launchers: https://www.npmjs.com/search?q=keywords:karma-launcher - browsers: ['ChromeHeadless'], - - - // Continuous Integration mode - // if true, Karma captures browsers, runs the tests and exits - singleRun: false, - - // Concurrency level - // how many browser instances should be started simultaneously - concurrency: Infinity - }) -} diff --git a/test/functional/config/test-configurations/browserstack.json b/test/functional/config/test-configurations/browserstack.json index b3c405e243..922d9745af 100644 --- a/test/functional/config/test-configurations/browserstack.json +++ b/test/functional/config/test-configurations/browserstack.json @@ -5,6 +5,6 @@ "reporters": [ "mocha", "junit", - "BrowserStack" + "coverage" ] } diff --git a/test/functional/config/test-configurations/local.json b/test/functional/config/test-configurations/local.json index f9821f7380..2665180a74 100644 --- a/test/functional/config/test-configurations/local.json +++ b/test/functional/config/test-configurations/local.json @@ -1,7 +1,6 @@ { "browsers": [ - "chrome_custom", - "firefox_custom" + "chrome_custom" ], "reporters": [ "mocha", diff --git a/test/functional/config/test-configurations/streams/smoke.json b/test/functional/config/test-configurations/streams/smoke.json index e66d650bb0..bbd94da482 100644 --- a/test/functional/config/test-configurations/streams/smoke.json +++ b/test/functional/config/test-configurations/streams/smoke.json @@ -29,9 +29,7 @@ } }, "includedTestfiles": [ - "playback/play", - "playback/pause", - "playback/seek", + "playback/*", "audio/*", "text/*" ] @@ -152,9 +150,7 @@ "type": "vod", "url": "https://dash.akamaized.net/dash264/TestCases/1a/sony/SNE_DASH_SD_CASE1A_REVISED.mpd", "includedTestfiles": [ - "playback/play", - "playback/pause", - "playback/seek" + "playback/*" ] } ] diff --git a/test/functional/test/advanced/no-reload-after-seek.js b/test/functional/test/advanced/no-reload-after-seek.js index 4ec3b52bac..a55212f257 100644 --- a/test/functional/test/advanced/no-reload-after-seek.js +++ b/test/functional/test/advanced/no-reload-after-seek.js @@ -1,4 +1,3 @@ -import DashJsAdapter from '../../adapter/DashJsAdapter.js'; import Constants from '../../src/Constants.js'; import Utils from '../../src/Utils.js'; import {expect} from 'chai' @@ -19,7 +18,13 @@ Utils.getTestvectorsForTestcase(TESTCASE).forEach((item) => { let playerAdapter; before(() => { - playerAdapter = initializeDashJsAdapter(item, mpd); + playerAdapter = initializeDashJsAdapter(item, mpd, { + streaming: { + buffer: { + fastSwitchEnabled: false + } + } + }); }) after(() => { diff --git a/test/unit/config/karma.unit.conf.cjs b/test/unit/config/karma.unit.conf.cjs index e4ff7ba9c6..919b6159fd 100644 --- a/test/unit/config/karma.unit.conf.cjs +++ b/test/unit/config/karma.unit.conf.cjs @@ -10,14 +10,8 @@ module.exports = function (config) { frameworks: ['mocha', 'chai', 'webpack'], plugins: [ - 'karma-webpack', - 'karma-mocha', - 'karma-chai', - 'karma-coverage', - 'karma-mocha-reporter', - 'karma-chrome-launcher', - 'karma-junit-reporter', - 'karma-firefox-launcher' + 'karma-*', // default plugins + '@*/karma-*', // default scoped plugins ], middleware: [],