@mattab opened this Issue on December 28th 2014 Owner

Running the test locally this morning results in error message:

./console tests:run ArchiveCronTest
Did you know? You can run tests faster by disabling xdebug
Executing command: cd /home/matt/dev/piwik-master/tests/PHPUnit && ../../vendor/phpunit/phpunit/phpunit  --group ArchiveCronTest 
PHPUnit 4.4.0 by Sebastian Bergmann.

Configuration read from /home/matt/dev/piwik-master/tests/PHPUnit/phpunit.xml

Warning: include(/home/matt/dev/piwik-master/tmp/cache/tracker/piwikcache_general.php): failed to open stream: Permission denied in /home/matt/dev/piwik-master/vendor/doctrine/cache/lib/Doctrine/Common/Cache/PhpFileCache.php on line 48

Call Stack:
    0.0002     235240   1. {main}() /home/matt/dev/piwik-master/vendor/phpunit/phpunit/phpunit:0
    0.0072    1018360   2. PHPUnit_TextUI_Command::main() /home/matt/dev/piwik-master/vendor/phpunit/phpunit/phpunit:62
    0.0072    1018992   3. PHPUnit_TextUI_Command->run() /home/matt/dev/piwik-master/vendor/phpunit/phpunit/src/TextUI/Command.php:138
    2.6617   83096600   4. PHPUnit_TextUI_TestRunner->doRun() /home/matt/dev/piwik-master/vendor/phpunit/phpunit/src/TextUI/Command.php:186
    2.7552   83500368   5. PHPUnit_Framework_TestSuite->run() /home/matt/dev/piwik-master/vendor/phpunit/phpunit/src/TextUI/TestRunner.php:423
    2.9502   83504424   6. PHPUnit_Framework_TestSuite->run() /home/matt/dev/piwik-master/vendor/phpunit/phpunit/src/Framework/TestSuite.php:751
    3.0200   83507536   7. PHPUnit_Framework_TestSuite->run() /home/matt/dev/piwik-master/vendor/phpunit/phpunit/src/Framework/TestSuite.php:751
    3.0208   83510856   8. call_user_func() /home/matt/dev/piwik-master/vendor/phpunit/phpunit/src/Framework/TestSuite.php:708
    3.0208   83511032   9. Piwik\Tests\Framework\TestCase\SystemTestCase::setUpBeforeClass() /home/matt/dev/piwik-master/vendor/phpunit/phpunit/src/Framework/TestSuite.php:708
    3.0209   83512512  10. Piwik\Tests\Framework\Fixture->performSetUp() /home/matt/dev/piwik-master/tests/PHPUnit/Framework/TestCase/SystemTestCase.php:67
    3.3285   87571024  11. Piwik\Tests\Fixtures\ManySitesImportedLogs->setUp() /home/matt/dev/piwik-master/tests/PHPUnit/Framework/Fixture.php:251
   10.8992   87918168  12. Piwik\Tests\Fixtures\ManySitesImportedLogs->setupSegments() /home/matt/dev/piwik-master/tests/PHPUnit/Fixtures/ManySitesImportedLogs.php:51
   10.9000   88000936  13. Piwik\Plugins\SegmentEditor\API->add() /home/matt/dev/piwik-master/tests/PHPUnit/Fixtures/ManySitesImportedLogs.php:161
   10.9001   88001464  14. Piwik\Plugins\SegmentEditor\API->checkSegmentValue() /home/matt/dev/piwik-master/plugins/SegmentEditor/API.php:270
   10.9005   88039912  15. Piwik\Segment->__construct() /home/matt/dev/piwik-master/plugins/SegmentEditor/API.php:35
   10.9005   88040312  16. Piwik\Segment->initializeSegment() /home/matt/dev/piwik-master/core/Segment.php:99
   10.9012   88119424  17. Piwik\Segment->getCleanedExpression() /home/matt/dev/piwik-master/core/Segment.php:129
   10.9013   88119472  18. Piwik\Plugins\API\API->getSegmentsMetadata() /home/matt/dev/piwik-master/core/Segment.php:150
   10.9264   88324896  19. Piwik\Piwik::postEvent() /home/matt/dev/piwik-master/plugins/API/API.php:151
   10.9264   88324992  20. Piwik\EventDispatcher->postEvent() /home/matt/dev/piwik-master/core/Piwik.php:700
   10.9266   88333728  21. call_user_func_array() /home/matt/dev/piwik-master/core/EventDispatcher.php:121
   10.9266   88334152  22. Piwik\Plugins\CustomVariables\CustomVariables->getSegmentsMetadata() /home/matt/dev/piwik-master/core/EventDispatcher.php:121
   10.9266   88334152  23. Piwik\Plugins\CustomVariables\CustomVariables::getMaxCustomVariables() /home/matt/dev/piwik-master/plugins/CustomVariables/CustomVariables.php:100
   10.9266   88334152  24. Piwik\Tracker\Cache::getCacheGeneral() /home/matt/dev/piwik-master/plugins/CustomVariables/CustomVariables.php:75
   10.9266   88334152  25. Piwik\Cache\Lazy->fetch() /home/matt/dev/piwik-master/core/Tracker/Cache.php:128
   10.9266   88334456  26. Piwik\Cache\Backend\File->doFetch() /home/matt/dev/piwik-master/vendor/piwik/cache/src/Lazy.php:37
   10.9266   88334472  27. Doctrine\Common\Cache\PhpFileCache->doFetch() /home/matt/dev/piwik-master/vendor/piwik/cache/src/Backend/File.php:51

Warning: include(): Failed opening '/home/matt/dev/piwik-master/tmp/cache/tracker/piwikcache_general.php' for inclusion (include_path='/home/matt/dev/piwik-master/vendor/phpunit/php-text-template:/home/matt/dev/piwik-master/vendor/phpunit/php-timer:/home/matt/dev/piwik-master/vendor/phpunit/php-file-iterator:/home/matt/dev/piwik-master/vendor/phpseclib/phpseclib/phpseclib:/home/matt/dev/piwik-master/vendor/phpunit/php-code-coverage:.:/usr/share/php:/usr/share/pear:/home/matt/dev/piwik-master/vendor/bin:/home/matt/dev/piwik-master/core:/home/matt/dev/piwik-master/libs:/home/matt/dev/piwik-master/plugins') in /home/matt/dev/piwik-master/vendor/doctrine/cache/lib/Doctrine/Common/Cache/PhpFileCache.php on line 48

Maybe you have some ideas?

@mattab commented on December 29th 2014 Owner

FYI @tsteur we have to add the repo alias to the root composer.json for it to be used. In the 2.10.0-rc1 we actually didn't have the "filecache-race-condition-fix" branch code and we were using still doctrine/cache repo. It was fixed in: 41a0e0df6c642b8ddf90f2ea0972418dd89e7e16

@mattab commented on December 29th 2014 Owner

Added the fix to the doctrine/cache pull request

@tsteur commented on January 4th 2015 Owner

Where are we actually using the doctrine file cache so that we need that composer json include? I'm maybe not up to date...

@mattab commented on January 4th 2015 Owner

not sure what you meant but our class extends from Doctrine class File extends PhpFileCache implements Backend

@tsteur commented on January 4th 2015 Owner

Yeah sure, but that's in the Piwik-Cache library which requires the correct doctrine version. If nothing else requires doctrine etc we should be fine I reckon. Just curious...

@mattab commented on January 4th 2015 Owner

@mnapoli had an explanation, it's a feature / bug of Composer that we need to set the branch aliases in the root composer.json as well.

see maybe if it does not, it must be re-inline-aliased in A's composer.json. in https://getcomposer.org/doc/articles/aliases.md#require-inline-alias

@tsteur commented on January 4th 2015 Owner

ah... another project is requiring it too (PHP-DI), that's what I was missing

@mnapoli commented on January 4th 2015 Member

Not related to PHP-DI, it's just that piwik-cache uses our fork&branch of doctrine-cache using composer alias. But composer aliases are ignored when they are in dependencies, so the alias works in piwik-cache itself but not when it's included in piwik.

So we need to re-do the alias in piwik's composer.json.

See https://getcomposer.org/doc/articles/aliases.md#require-inline-alias

Note: If a package with inline aliases is required, the alias (right of the as) is used as the version constraint. The part left of the as is discarded. As a consequence, if A requires B and B requires monolog/monolog version dev-bugfix as 1.0.x-dev, installing A will make B require 1.0.x-dev, which may exist as a branch alias or an actual 1.0 branch. If it does not, it must be re-inline-aliased in A's composer.json.

This Issue was closed on December 29th 2014
Powered by GitHub Issue Mirror