diff options
author | Stefan Giehl <stefan@matomo.org> | 2020-04-27 23:06:51 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-27 23:06:51 +0300 |
commit | 60b5c52d057abeced4d4f7cf4bdf90e7b7526866 (patch) | |
tree | 3d564c7f0c54e21f690a7f87f572e46a385384fa | |
parent | 8260e6ac807e008e83a1bf5a7888906092ceac9e (diff) |
Run UI tests of submodules with core build if possible (#15844)
* skip only ui tests with special needs in core build
* apply review feedback
-rw-r--r-- | tests/lib/screenshot-testing/support/app.js | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/tests/lib/screenshot-testing/support/app.js b/tests/lib/screenshot-testing/support/app.js index d5f24f1a7f..93139569e6 100644 --- a/tests/lib/screenshot-testing/support/app.js +++ b/tests/lib/screenshot-testing/support/app.js @@ -43,6 +43,12 @@ var isCorePlugin = function (pathToPlugin) { return !fs.existsSync(gitDir); }; +var hasSpecialNeeds = function (pathToPlugin) { + // skip plugins that have special needs in core build + var travisDir = path.join(pathToPlugin, 'tests/travis'); + return !!fs.existsSync(travisDir); +}; + var Application = function () { this.runner = null; @@ -123,12 +129,18 @@ Application.prototype.loadTestModules = function () { // load all UI tests we can find var modulePaths = walk(uiTestsDir, /_spec\.js$/); - if (options.core) { + if (options.core && !options['store-in-ui-tests-repo']) { plugins = plugins.filter(function (path) { return isCorePlugin(path); }); } + if (!options.plugin) { + plugins = plugins.filter(function (path) { + return !hasSpecialNeeds(path); + }); + } + plugins.forEach(function (pluginPath) { walk(path.join(pluginPath, 'Test'), /_spec\.js$/, modulePaths); walk(path.join(pluginPath, 'tests'), /_spec\.js$/, modulePaths); @@ -160,7 +172,7 @@ Application.prototype.loadTestModules = function () { // we apply this option only if not a specific plugin or test suite was requested. Only there for travis to // split tests into multiple jobs. var numTestsFirstHalf = Math.round(mocha.suite.suites.length / 2); - numTestsFirstHalf -= 3; + numTestsFirstHalf -= 4; mocha.suite.suites = mocha.suite.suites.filter(function (suite, index) { if (options['run-first-half-only'] && index < numTestsFirstHalf) { return true; |