@mnapoli opened this issue on December 30th 2014

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.

@mnapoli commented on December 30th 2014

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 nowIf 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 /index.php?module=TestRunner&action=check ?

@mattab commented on December 30th 2014

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

@mnapoli commented on December 30th 2014

@mattab thanks, done.

@mnapoli commented on December 30th 2014

Actually it seems it doesn't work, I get the following error on Travis:

SQLSTATE[42S02]: Base table or view not found: 1146 Table piwik_tests.option doesn't exist

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 commented on January 5th 2015

@mnapoli maybe you need some help to troubleshoot this?

@mnapoli commented on January 5th 2015

@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).

@mnapoli commented on January 5th 2015

OK to be merged!

This issue was closed on January 5th 2015
Powered by GitHub Issue Mirror