When running PHPUnit tests other than unit tests, the bootstrap checks that Piwik server is running correctly.
Instead of hitting the home page (
/ 302 that redirect to
/index.php? CoreHome…) which takes a couple seconds for the HTTP response, this uses a simpler and faster controller action.
The TestsRunner plugin is disabled in production right? So that new controller shouldn't be a problem.
Tests are failing on Travis with this:
Piwik should be running at http://localhost/ but this URL returned an unexpected response: 'The Piwik configuration file couldn't be found and you are trying to access a Piwik page.'
» You can install Piwik now
If you installed Piwik before and have some tables in your DB, don't worry, you can reuse the same tables and keep your existing data!
Should I use this URL
/tests/PHPUnit/proxy/index.php?module=TestRunner&action=check instead of
Should I use this URL /tests/PHPUnit/proxy/index.php?module=TestRunner&action=check instead of /index.php?module=TestRunner&action=check ?
yes indeed, this URL will use the test DB credentials so it will use the right database
Actually it seems it doesn't work, I get the following error on Travis:
SQLSTATE[42S02]: Base table or view not found: 1146 Table
Which makes sense.
The version on master hits the home page (
/, not the tests index.php), I just wonder why the tests were failing…
@mattab I'm trying something.
For the record with a very simple test case I'm down from 2.4 s to 1.4s, which is actually very appreciable when running tests very often (refactoring).
OK to be merged!