Skip to content

Commit

Permalink
Updating OmniFixture to fix a randomly failing screenshot tests (tran…
Browse files Browse the repository at this point in the history
…sitions) refs matomo-org#6693
  • Loading branch information
mattab committed Mar 2, 2015
1 parent 0fb7dbd commit c21d59e
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
6 changes: 5 additions & 1 deletion plugins/TestRunner/Commands/TestsSetupFixture.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ protected function execute(InputInterface $input, OutputInterface $output)
$_SERVER = json_decode($serverGlobal, true);
}

if(Config::getInstance()->database_tests['tables_prefix'] !== '') {
throw new \Exception("To generate OmniFixture for the UI tests, you must set an empty tables_prefix in [database_tests]");
}
$this->requireFixtureFiles($input);
$this->setIncludePathAsInTestBootstrap();

Expand Down Expand Up @@ -176,7 +179,8 @@ private function setupDatabaseOverrides(InputInterface $input, Fixture $fixture)
'dbname' => $fixture->getDbName(),
'host' => $input->getOption('db-host'),
'username' => $input->getOption('db-user'),
'password' => $input->getOption('db-pass')
'password' => $input->getOption('db-pass'),
'tables_prefix' => '',
);
foreach ($optionsToOverride as $configOption => $value) {
if ($value) {
Expand Down
6 changes: 2 additions & 4 deletions tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,10 @@ We also have an OmniFixture that includes all other Fixtures. OmniFixture is use

#### Keep OmniFixture up to date

Remember to update the [Omnifixture SQL dump](https://github.com/piwik/piwik/blob/master/tests/resources/OmniFixture-dump.sql.gz) whenever you make any change to any fixture.
For instance use:
Remember to update the [Omnifixture SQL dump](https://github.com/piwik/piwik/blob/master/tests/resources/OmniFixture-dump.sql.gz) whenever you make any change to any fixture. You can use:

./console tests:setup-fixture OmniFixture --sqldump=OmniFixture-dump.sql
and then gzip.
cat OmniFixture-dump.sql | gzip > tests/resources/OmniFixture-dump.sql.gz

Keeping the OmniFixture up to date makes it easier to see which tests fail after each small fixture change.

Expand Down
2 changes: 1 addition & 1 deletion tests/UI/expected-ui-screenshots
Binary file modified tests/resources/OmniFixture-dump.sql.gz
Binary file not shown.
6 changes: 3 additions & 3 deletions tests/resources/access-logs/fake_logs_custom.log
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
175.41.192.40 - - [30/Sep/2012:10:11:30 +0200] 200 "GET /faq/ HTTP/1.1" 234002
175.41.192.40 - - [30/Sep/2012:10:11:56 +0200] 200 "GET /blog/category/community/ HTTP/1.1" 1324002
175.41.192.40 - - [30/Sep/2012:10:12:03 +0200] 200 "GET /docs/manage-websites/ HTTP/1.1" 543002
175.41.192.40 - - [30/Sep/2012:10:10:38 +0200] 200 "GET /blog/category/meta/ HTTP/1.1" 120002
175.41.192.40 - - [30/Sep/2012:10:10:40 +0200] 200 "GET /blog/category/meta/ HTTP/1.1" 120002
175.41.192.40 - - [30/Sep/2012:10:11:30 +0200] 200 "GET /faq/ HTTP/1.1" 294002
175.41.192.40 - - [30/Sep/2012:10:11:56 +0200] 200 "GET /blog/category/community/ HTTP/1.1" 624002
175.41.192.40 - - [30/Sep/2012:10:12:03 +0200] 200 "GET /docs/manage-websites/ HTTP/1.1" 343002
175.41.192.40 - - [30/Sep/2012:10:10:38 +0200] 200 "GET /blog/category/meta/ HTTP/1.1" 23002
175.41.192.40 - - [30/Sep/2012:10:12:04 +0200] 200 "GET /docs/manage-websites/ HTTP/1.1" 343002
175.41.192.40 - - [30/Sep/2012:10:10:41 +0200] 200 "GET /blog/category/meta/ HTTP/1.1" 23002
175.41.192.40 - - [30/Sep/2012:10:11:30 +0200] 200 "GET /faq/ HTTP/1.1" 237002

0 comments on commit c21d59e

Please sign in to comment.