Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Steur <tsteur@users.noreply.github.com>2015-09-02 11:28:11 +0300
committerThomas Steur <tsteur@users.noreply.github.com>2015-09-02 11:28:11 +0300
commit8ceb29919f489fa47f1d407f4a61010462152f93 (patch)
tree449397000df1f9fb739678ff38cf9238060c439c
parentcb2deb55b55f0ccd8638f06626d3e162e84c2a6c (diff)
parent1ff3cfec20b1124b3732240d323c76456d332c94 (diff)
Merge pull request #8684 from piwik/8222
Run UI tests in two different jobs
-rw-r--r--.travis.yml7
-rw-r--r--tests/lib/screenshot-testing/support/app.js22
m---------tests/travis0
3 files changed, 27 insertions, 2 deletions
diff --git a/.travis.yml b/.travis.yml
index 37a01b1547..eef27e1d5e 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -30,7 +30,8 @@ env:
# All tests after another
- TEST_SUITE=AllTests MYSQL_ADAPTER=PDO_MYSQL
- TEST_SUITE=AllTests MYSQL_ADAPTER=MYSQLI
- - TEST_SUITE=UITests MYSQL_ADAPTER=PDO_MYSQL
+ - TEST_SUITE=UITests MYSQL_ADAPTER=PDO_MYSQL UITEST_EXTRA_OPTIONS="--run-first-half-only"
+ - TEST_SUITE=UITests MYSQL_ADAPTER=PDO_MYSQL UITEST_EXTRA_OPTIONS="--run-second-half-only"
global:
- PIWIK_ROOT_DIR=$TRAVIS_BUILD_DIR
- SKIP_INSTALL_MYSQL_56=1
@@ -60,7 +61,9 @@ matrix:
env: TEST_SUITE=UnitTests MYSQL_ADAPTER=PDO_MYSQL
# run UI tests on PHP 5.3.3 only
- php: 5.6
- env: TEST_SUITE=UITests MYSQL_ADAPTER=PDO_MYSQL
+ env: TEST_SUITE=UITests MYSQL_ADAPTER=PDO_MYSQL UITEST_EXTRA_OPTIONS="--run-first-half-only"
+ - php: 5.6
+ env: TEST_SUITE=UITests MYSQL_ADAPTER=PDO_MYSQL UITEST_EXTRA_OPTIONS="--run-second-half-only"
# run all tests not on PHP 5.6 and run MySQLI tests only on 5.6
- php: 5.6
env: TEST_SUITE=AllTests MYSQL_ADAPTER=PDO_MYSQL
diff --git a/tests/lib/screenshot-testing/support/app.js b/tests/lib/screenshot-testing/support/app.js
index 92256cae6c..6f120f18d8 100644
--- a/tests/lib/screenshot-testing/support/app.js
+++ b/tests/lib/screenshot-testing/support/app.js
@@ -66,6 +66,10 @@ Application.prototype.printHelpAndExit = function () {
console.log(" --screenshot-repo: Specifies the github repository that contains the expected screenshots");
console.log(" to link to in the diffviewer. For use with travis build.");
console.log(" --core: Only execute UI tests that are for Piwik core or Piwik core plugins.");
+ console.log(" --first-half: Only execute first half of all the test suites. Will be only applied if no")
+ console.log(" specific plugin or test-files requested");
+ console.log(" --second-half: Only execute second half of all the test suites. Will be only applied if no")
+ console.log(" specific plugin or test-files requested");
phantom.exit(0);
};
@@ -131,6 +135,24 @@ Application.prototype.loadTestModules = function () {
});
}
+ var specificTestsRequested = options.plugin || options.tests.length;
+
+ if ((options['run-first-half-only'] || options['run-second-half-only']) && !specificTestsRequested) {
+ // run only first 50% of the test suites or only run last 50% of the test suites.
+ // 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 += 5; // run a few more test suits in first half as UiIntegrationTests contain many tests
+ mocha.suite.suites = mocha.suite.suites.filter(function (suite, index) {
+ if (options['run-first-half-only'] && index < numTestsFirstHalf) {
+ return true;
+ } else if (options['run-second-half-only'] && index >= numTestsFirstHalf) {
+ return true;
+ }
+ return false;
+ });
+ }
+
if (!mocha.suite.suites.length) {
console.log("No tests are executing... are you running tests for a plugin? Make sure to use the"
+ " --plugin=MyPlugin option.");
diff --git a/tests/travis b/tests/travis
-Subproject f62fc4fe97a88aa11e495abda384f142b38fd58
+Subproject b7a9cd1a1755b9f500ac111713ce07bb983c12e