diff options
author | Matthieu Napoli <matthieu@mnapoli.fr> | 2015-05-22 11:48:51 +0300 |
---|---|---|
committer | sgiehl <stefan@piwik.org> | 2016-08-31 19:49:43 +0300 |
commit | 395c40bd50ef19ae782c42952a07ec19d4c9b892 (patch) | |
tree | a197a496bec74a7b43030cd29ca8a99ed37ee1bc | |
parent | 025de644df80ec257c7cdea57b2442e78aa1a78a (diff) |
ref #7726 Enable git-lfs for UI screenshots
-rw-r--r-- | .gitattributes | 4 | ||||
-rw-r--r-- | plugins/CoreConsole/Commands/GenerateTest.php | 4 | ||||
-rw-r--r-- | plugins/TestRunner/Commands/SyncScreenshots.php | 8 | ||||
-rw-r--r-- | tests/README.screenshots.md | 6 | ||||
-rw-r--r-- | tests/UI/config.dist.js | 2 |
5 files changed, 13 insertions, 11 deletions
diff --git a/.gitattributes b/.gitattributes index 2e93f8d46f..4ada93025c 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1,5 @@ +tests/UI/expected-screenshots/*.png filter=lfs diff=lfs merge=lfs -crlf + # auto detect text files and perform LF normalization * text eol=lf @@ -40,4 +42,4 @@ *.WOFF2 binary # Custom for Visual Studio -*.cs diff=csharp +*.cs diff=csharp
\ No newline at end of file diff --git a/plugins/CoreConsole/Commands/GenerateTest.php b/plugins/CoreConsole/Commands/GenerateTest.php index c2b31b6fe5..95dac4cfbd 100644 --- a/plugins/CoreConsole/Commands/GenerateTest.php +++ b/plugins/CoreConsole/Commands/GenerateTest.php @@ -156,8 +156,8 @@ class GenerateTest extends GeneratePluginBase '/tests', '/tests/UI', '/tests/UI/.gitignore', - '/tests/UI/expected-ui-screenshots', - '/tests/UI/expected-ui-screenshots/.gitkeep', + '/tests/UI/expected-screenshots', + '/tests/UI/expected-screenshots/.gitkeep', '/tests/UI/SimpleUITest_spec.js', ); } diff --git a/plugins/TestRunner/Commands/SyncScreenshots.php b/plugins/TestRunner/Commands/SyncScreenshots.php index a2930edbcf..618e52b38f 100644 --- a/plugins/TestRunner/Commands/SyncScreenshots.php +++ b/plugins/TestRunner/Commands/SyncScreenshots.php @@ -47,7 +47,7 @@ class SyncScreenshots extends ConsoleCommand $this->setName('tests:sync-ui-screenshots'); $this->setAliases(array('development:sync-ui-test-screenshots')); $this->setDescription('For Piwik core devs. Copies screenshots ' - . 'from travis artifacts to the tests/UI/expected-ui-screenshots/ folder'); + . 'from travis artifacts to the tests/UI/expected-screenshots/ folder'); $this->addArgument('buildnumber', InputArgument::REQUIRED, 'Travis build number you want to sync.'); $this->addArgument('screenshotsRegex', InputArgument::OPTIONAL, 'A regex to use when selecting screenshots to copy. If not supplied all screenshots are copied.', '.*'); @@ -149,7 +149,7 @@ git push"; $commands .= " cd .. git pull -git add expected-ui-screenshots/ +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\" @@ -169,10 +169,10 @@ cd ../../../../../"; $plugin = $this->getPluginName($repository); if (empty($plugin)) { - return PIWIK_DOCUMENT_ROOT . '/tests/UI/expected-ui-screenshots/'; + return PIWIK_DOCUMENT_ROOT . "/tests/UI/expected-screenshots/"; } - $downloadTo = PIWIK_DOCUMENT_ROOT . "/plugins/$plugin/tests/UI/expected-ui-screenshots/"; + $downloadTo = PIWIK_DOCUMENT_ROOT . "/plugins/$plugin/tests/UI/expected-screenshots/"; if(is_dir($downloadTo)) { return $downloadTo; } diff --git a/tests/README.screenshots.md b/tests/README.screenshots.md index 68e8b22c6a..13c0fff01c 100644 --- a/tests/README.screenshots.md +++ b/tests/README.screenshots.md @@ -33,12 +33,12 @@ To fix a broken build, follow these steps: * If a change is not wanted, revert or fix your commit. * If a change is correct, then you can set the new screenshot as the expected screenshot. To do so, in the diffviewer.html page click on the "Processed" link for this screenshot. - Then "Save this file as" and save it in the piwik/tests/UI/expected-ui-screenshots/ directory. + Then "Save this file as" and save it in the piwik/tests/UI/expected-screenshots/ directory. (If the screenshot test is for a plugin and not Piwik Core, the expected screenshot should be added to the - plugin's expected screenshot directory. For example: piwik/plugins/DBStats/tests/UI/expected-ui-screenshots.) + plugin's expected screenshot directory. For example: piwik/plugins/DBStats/tests/UI/expected-screenshots.) _Note: When determining whether a screenshot is correct, the data displayed is not important. Report data correctness is verified through System and other PHP tests. The UI tests should only test UI behavior._ - * Push the changes (to your code and/or to the expected-ui-screenshots directory. + * Push the changes (to your code and/or to the expected-screenshots directory). * Wait for next Test build [on travis](https://travis-ci.org/piwik/piwik). Hopefully, the build should be green! _Note: the `tests:sync-ui-screenshots` console command can be used to speed up the process. Run `./console tests:sync-ui-screenshots -h` to learn more._ diff --git a/tests/UI/config.dist.js b/tests/UI/config.dist.js index c9faa5e425..2430791958 100644 --- a/tests/UI/config.dist.js +++ b/tests/UI/config.dist.js @@ -45,7 +45,7 @@ exports.reporter = "spec"; /** * The directory that stores expected screenshots. Relative to the UI repo's root directoriy. */ -exports.expectedScreenshotsDir = "./expected-ui-screenshots"; +exports.expectedScreenshotsDir = "./expected-screenshots"; /** * The directory that stores processed screenshots. Relative to the UI repo's root directory. |