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:
authorsgiehl <stefan@piwik.org>2016-08-14 13:10:10 +0300
committersgiehl <stefan@piwik.org>2016-08-31 20:00:30 +0300
commitd2ea159a189d0521954ef6600d586b92c421db8e (patch)
treeec4dfb1820b222d450c83cf262b31904bd1f5a09 /plugins/TestRunner
parent5ce8f91bf7cfed2f67229998b682f8c831caaa9e (diff)
update screenshot sync command to use correct directory
Diffstat (limited to 'plugins/TestRunner')
-rw-r--r--plugins/TestRunner/Commands/SyncScreenshots.php33
1 files changed, 16 insertions, 17 deletions
diff --git a/plugins/TestRunner/Commands/SyncScreenshots.php b/plugins/TestRunner/Commands/SyncScreenshots.php
index 618e52b38f..fe032c1fe7 100644
--- a/plugins/TestRunner/Commands/SyncScreenshots.php
+++ b/plugins/TestRunner/Commands/SyncScreenshots.php
@@ -147,15 +147,7 @@ git push";
if ($repository === 'piwik/piwik') {
$commands .= "
-cd ..
-git pull
-git add expected-screenshots/
-git status
-git commit -m 'UI tests: ...' # Copy paste the good commit message
-echo -e \"\n--> Check the commit above is correct... <---\n\"
-sleep 7
-git push
-cd ../../";
+cd ../../../";
} else {
$commands .= "
cd ../../../../../";
@@ -172,15 +164,22 @@ cd ../../../../../";
return PIWIK_DOCUMENT_ROOT . "/tests/UI/expected-screenshots/";
}
- $downloadTo = PIWIK_DOCUMENT_ROOT . "/plugins/$plugin/tests/UI/expected-screenshots/";
- if(is_dir($downloadTo)) {
- return $downloadTo;
- }
+ $possibleSubDirs = array(
+ 'expected-screenshots',
+ 'expected-ui-screenshots'
+ );
+
+ foreach ($possibleSubDirs as $subDir) {
+ $downloadTo = PIWIK_DOCUMENT_ROOT . "/plugins/$plugin/tests/UI/$subDir/";
+ if (is_dir($downloadTo)) {
+ return $downloadTo;
+ }
- // Maybe the plugin is using folder "Test/" instead of "tests/"
- $downloadTo = str_replace("tests/", "Test/", $downloadTo);
- if(is_dir($downloadTo)) {
- return $downloadTo;
+ // Maybe the plugin is using folder "Test/" instead of "tests/"
+ $downloadTo = str_replace("tests/", "Test/", $downloadTo);
+ if (is_dir($downloadTo)) {
+ return $downloadTo;
+ }
}
throw new \Exception("Download to path could not be found: $downloadTo");
}