Skip to content
Extraits de code Groupes Projets
Valider 1ff3cfec rédigé par Thomas Steur's avatar Thomas Steur
Parcourir les fichiers

Run UI tests in two different jobs

apply new naming
parent 96ae06bd
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -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
......
......@@ -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.");
......
Subproject commit f62fc4fe97a88aa11e495abda384f142b38fd580
Subproject commit b7a9cd1a1755b9f500ac111713ce07bb983c12e7
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter