Skip to content
Extraits de code Groupes Projets
Valider 0f1b8cfd rédigé par Stefan Giehl's avatar Stefan Giehl Validation de GitHub
Parcourir les fichiers

Merge pull request #10461 from piwik/3.0-m07

Merge master to 3.x-dev
parents 2d57ea30 18b5f4d1
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Affichage de
avec 48 ajouts et 35 suppressions
tests/UI/expected-screenshots/*.png filter=lfs diff=lfs merge=lfs
plugins/*/tests/UI/expected-screenshots/*.png filter=lfs diff=lfs merge=lfs
# auto detect text files and perform LF normalization # auto detect text files and perform LF normalization
* text eol=lf * text eol=lf
...@@ -40,4 +43,4 @@ ...@@ -40,4 +43,4 @@
*.WOFF2 binary *.WOFF2 binary
# Custom for Visual Studio # Custom for Visual Studio
*.cs diff=csharp *.cs diff=csharp
\ No newline at end of file
...@@ -26,10 +26,6 @@ ...@@ -26,10 +26,6 @@
path = plugins/QueuedTracking path = plugins/QueuedTracking
url = https://github.com/piwik/plugin-QueuedTracking.git url = https://github.com/piwik/plugin-QueuedTracking.git
branch = master branch = master
[submodule "tests/UI/expected-ui-screenshots"]
path = tests/UI/expected-ui-screenshots
url = https://github.com/piwik/piwik-ui-tests.git
branch = master
[submodule "tests/travis"] [submodule "tests/travis"]
path = tests/travis path = tests/travis
url = https://github.com/piwik/travis-scripts url = https://github.com/piwik/travis-scripts
...@@ -58,5 +54,4 @@ ...@@ -58,5 +54,4 @@
url = https://github.com/piwik/piwik-log-analytics.git url = https://github.com/piwik/piwik-log-analytics.git
branch = master branch = master
# Note: do not add new plugin submodules here, but a few lines above # Note: do not add new plugin submodules here, but a few lines above
\ No newline at end of file
...@@ -88,6 +88,9 @@ cache: ...@@ -88,6 +88,9 @@ cache:
directories: directories:
- "travis_phantomjs" - "travis_phantomjs"
before_install:
- ./tests/travis/install_git_lfs.sh
install: install:
- git fetch -q - git fetch -q
......
...@@ -156,8 +156,8 @@ class GenerateTest extends GeneratePluginBase ...@@ -156,8 +156,8 @@ class GenerateTest extends GeneratePluginBase
'/tests', '/tests',
'/tests/UI', '/tests/UI',
'/tests/UI/.gitignore', '/tests/UI/.gitignore',
'/tests/UI/expected-ui-screenshots', '/tests/UI/expected-screenshots',
'/tests/UI/expected-ui-screenshots/.gitkeep', '/tests/UI/expected-screenshots/.gitkeep',
'/tests/UI/SimpleUITest_spec.js', '/tests/UI/SimpleUITest_spec.js',
); );
} }
......
Le fichier a été supprimé par une entrée .gitattributes, ou son encodage n'est pas pris en charge.
Le fichier a été supprimé par une entrée .gitattributes, ou son encodage n'est pas pris en charge.
Le fichier a été supprimé par une entrée .gitattributes, ou son encodage n'est pas pris en charge.
Le fichier a été supprimé par une entrée .gitattributes, ou son encodage n'est pas pris en charge.
Le fichier a été supprimé par une entrée .gitattributes, ou son encodage n'est pas pris en charge.
Le fichier a été supprimé par une entrée .gitattributes, ou son encodage n'est pas pris en charge.
Le fichier a été supprimé par une entrée .gitattributes, ou son encodage n'est pas pris en charge.
Le fichier a été supprimé par une entrée .gitattributes, ou son encodage n'est pas pris en charge.
...@@ -49,8 +49,10 @@ class DoNotTrackHeaderChecker ...@@ -49,8 +49,10 @@ class DoNotTrackHeaderChecker
// this is an optional supplement to the site's tracking status resource at: // this is an optional supplement to the site's tracking status resource at:
// /.well-known/dnt // /.well-known/dnt
// per Tracking Preference Expression (draft) // per Tracking Preference Expression
Common::sendHeader('Tk: 1');
//Tracking Perference Expression has been updated to require Tk: N rather than Tk: 1
Common::sendHeader('Tk: N');
} }
} }
......
...@@ -47,7 +47,7 @@ class SyncScreenshots extends ConsoleCommand ...@@ -47,7 +47,7 @@ class SyncScreenshots extends ConsoleCommand
$this->setName('tests:sync-ui-screenshots'); $this->setName('tests:sync-ui-screenshots');
$this->setAliases(array('development:sync-ui-test-screenshots')); $this->setAliases(array('development:sync-ui-test-screenshots'));
$this->setDescription('For Piwik core devs. Copies 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('buildnumber', InputArgument::REQUIRED, 'Travis build number you want to sync.');
$this->addArgument('screenshotsRegex', InputArgument::OPTIONAL, $this->addArgument('screenshotsRegex', InputArgument::OPTIONAL,
'A regex to use when selecting screenshots to copy. If not supplied all screenshots are copied.', '.*'); 'A regex to use when selecting screenshots to copy. If not supplied all screenshots are copied.', '.*');
...@@ -147,15 +147,7 @@ git push"; ...@@ -147,15 +147,7 @@ git push";
if ($repository === 'piwik/piwik') { if ($repository === 'piwik/piwik') {
$commands .= " $commands .= "
cd .. cd ../../../";
git pull
git add expected-ui-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 ../../";
} else { } else {
$commands .= " $commands .= "
cd ../../../../../"; cd ../../../../../";
...@@ -169,18 +161,25 @@ cd ../../../../../"; ...@@ -169,18 +161,25 @@ cd ../../../../../";
$plugin = $this->getPluginName($repository); $plugin = $this->getPluginName($repository);
if (empty($plugin)) { 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/"; $possibleSubDirs = array(
if(is_dir($downloadTo)) { 'expected-screenshots',
return $downloadTo; '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/" // Maybe the plugin is using folder "Test/" instead of "tests/"
$downloadTo = str_replace("tests/", "Test/", $downloadTo); $downloadTo = str_replace("tests/", "Test/", $downloadTo);
if(is_dir($downloadTo)) { if (is_dir($downloadTo)) {
return $downloadTo; return $downloadTo;
}
} }
throw new \Exception("Download to path could not be found: $downloadTo"); throw new \Exception("Download to path could not be found: $downloadTo");
} }
......
...@@ -50,7 +50,16 @@ class Controller extends \Piwik\Plugin\Controller ...@@ -50,7 +50,16 @@ class Controller extends \Piwik\Plugin\Controller
$period = Common::getRequestVar('period'); $period = Common::getRequestVar('period');
$date = Common::getRequestVar('date'); $date = Common::getRequestVar('date');
$segment = $segmentOverride ? : Request::getRawSegmentFromRequest() ? : '';
if (!empty($segmentOverride)) {
$segment = $segmentOverride;
} else {
$segment = Request::getRawSegmentFromRequest();
if (empty($segment)) {
$segment = '';
}
}
$token_auth = Piwik::getCurrentUserTokenAuth(); $token_auth = Piwik::getCurrentUserTokenAuth();
$view = new View('@UserCountryMap/visitorMap'); $view = new View('@UserCountryMap/visitorMap');
......
...@@ -64,6 +64,8 @@ class ReleaseCheckListTest extends \PHPUnit_Framework_TestCase ...@@ -64,6 +64,8 @@ class ReleaseCheckListTest extends \PHPUnit_Framework_TestCase
public function test_pngFilesIconsShouldBeInPngFormat() public function test_pngFilesIconsShouldBeInPngFormat()
{ {
$files = Filesystem::globr(PIWIK_INCLUDE_PATH . '/plugins', '*.png'); $files = Filesystem::globr(PIWIK_INCLUDE_PATH . '/plugins', '*.png');
// filter expected screenshots as they might not be checked out and downloaded when stored in git-lfs
$files = array_filter($files, function($value) { return !preg_match('/expected-screenshots/', $value); });
$this->checkFilesAreInPngFormat($files); $this->checkFilesAreInPngFormat($files);
$files = Filesystem::globr(PIWIK_INCLUDE_PATH . '/core', '*.png'); $files = Filesystem::globr(PIWIK_INCLUDE_PATH . '/core', '*.png');
$this->checkFilesAreInPngFormat($files); $this->checkFilesAreInPngFormat($files);
......
...@@ -33,12 +33,12 @@ To fix a broken build, follow these steps: ...@@ -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 not wanted, revert or fix your commit.
* If a change is correct, then you can set the new screenshot as the expected screenshot. * 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. 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 (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._ _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! * 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._ _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._
......
...@@ -45,7 +45,7 @@ exports.reporter = "spec"; ...@@ -45,7 +45,7 @@ exports.reporter = "spec";
/** /**
* The directory that stores expected screenshots. Relative to the UI repo's root directoriy. * The directory that stores expected screenshots. Relative to the UI repo's root directoriy.
*/ */
exports.expectedScreenshotsDir = "./expected-ui-screenshots"; exports.expectedScreenshotsDir = ["./expected-screenshots", "./expected-ui-screenshots"];
/** /**
* The directory that stores processed screenshots. Relative to the UI repo's root directory. * The directory that stores processed screenshots. Relative to the UI repo's root directory.
......
Le fichier a été supprimé par une entrée .gitattributes, ou son encodage n'est pas pris en charge.
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter