Daniel15 / BuildSize

Automatically track the size of your build artifacts
MIT License
54 stars 7 forks source link

Add Circle config #23

Closed serima closed 6 years ago

serima commented 6 years ago

This repo does not have .circle/config.yml I tried it using circleci/php:7.1-node-browsers docker image, but it did not have php-soap, and the following error occurred when running phpunit. We need to configure php with --enable-soap if we use this.

Fatal error: Uncaught BadMethodCallException: For soap support you need to install the soap extension. in /home/circleci/laravel/vendor/php-vcr/php-vcr/src/VCR/LibraryHooks/SoapHook.php on line 47

BadMethodCallException: For soap support you need to install the soap extension. in /home/circleci/laravel/vendor/php-vcr/php-vcr/src/VCR/LibraryHooks/SoapHook.php on line 47

Call Stack:
    0.0001     366512   1. {main}() /home/circleci/laravel/vendor/phpunit/phpunit/phpunit:0
    0.0152    2750832   2. PHPUnit\TextUI\Command::main() /home/circleci/laravel/vendor/phpunit/phpunit/phpunit:53
    0.0152    2750944   3. PHPUnit\TextUI\Command->run() /home/circleci/laravel/vendor/phpunit/phpunit/src/TextUI/Command.php:141
    0.0152    2750944   4. PHPUnit\TextUI\Command->handleArguments() /home/circleci/laravel/vendor/phpunit/phpunit/src/TextUI/Command.php:152
    0.0183    3059008   5. PHPUnit\TextUI\Command->handleBootstrap() /home/circleci/laravel/vendor/phpunit/phpunit/src/TextUI/Command.php:735
    0.0184    3064760   6. PHPUnit\Util\Fileloader::checkAndLoad() /home/circleci/laravel/vendor/phpunit/phpunit/src/TextUI/Command.php:913
    0.0184    3064968   7. PHPUnit\Util\Fileloader::load() /home/circleci/laravel/vendor/phpunit/phpunit/src/Util/Fileloader.php:45
    0.0185    3067312   8. include_once('/home/circleci/laravel/tests/bootstrap.php') /home/circleci/laravel/vendor/phpunit/phpunit/src/Util/Fileloader.php:61
    0.0187    3073080   9. VCR\VCR::turnOn() /home/circleci/laravel/tests/bootstrap.php:4
    0.0187    3073136  10. VCR\VCR::__callStatic() /home/circleci/laravel/tests/bootstrap.php:4
    0.0196    3169112  11. call_user_func_array:{/home/circleci/laravel/vendor/php-vcr/php-vcr/src/VCR/VCR.php:35}() /home/circleci/laravel/vendor/php-vcr/php-vcr/src/VCR/VCR.php:35
    0.0196    3169176  12. VCR\Videorecorder->turnOn() /home/circleci/laravel/vendor/php-vcr/php-vcr/src/VCR/VCR.php:35
    0.0196    3169176  13. VCR\Videorecorder->enableLibraryHooks() /home/circleci/laravel/vendor/php-vcr/php-vcr/src/VCR/Videorecorder.php:122
    0.0231    3704344  14. VCR\VCRFactory::get() /home/circleci/laravel/vendor/php-vcr/php-vcr/src/VCR/Videorecorder.php:288
    0.0231    3704344  15. VCR\VCRFactory->getOrCreate() /home/circleci/laravel/vendor/php-vcr/php-vcr/src/VCR/VCRFactory.php:98
    0.0231    3704776  16. call_user_func_array:{/home/circleci/laravel/vendor/php-vcr/php-vcr/src/VCR/VCRFactory.php:119}() /home/circleci/laravel/vendor/php-vcr/php-vcr/src/VCR/VCRFactory.php:119
    0.0231    3704840  17. VCR\VCRFactory->createVCRLibraryHooksSoapHook() /home/circleci/laravel/vendor/php-vcr/php-vcr/src/VCR/VCRFactory.php:119
    0.0241    3724472  18. VCR\LibraryHooks\SoapHook->__construct() /home/circleci/laravel/vendor/php-vcr/php-vcr/src/VCR/VCRFactory.php:60
Daniel15 commented 6 years ago

I'm not using SOAP at all, so it's strange that it'd throw a SOAP-related error. Hmm. I'll take a look soon.

Daniel15 commented 6 years ago

I'm hitting a different error while trying to set up this project on CircleCI to install dependencies using Composer and then run the GrumPHP tasks:

Fatal error: Uncaught TypeError: Argument 6 passed to Symfony\Component\Process\Process::__construct() must be of the type array, null given, called in /home/circleci/repo/vendor/symfony/process/ProcessBuilder.php on line 274 and defined in phar:///usr/local/bin/composer/vendor/symfony/process/Process.php:141
Stack trace:
#0 /home/circleci/repo/vendor/symfony/process/ProcessBuilder.php(274): Symfony\Component\Process\Process->__construct(Array, NULL, Array, NULL, 60, NULL)
#1 /home/circleci/repo/vendor/phpro/grumphp/src/Composer/GrumPHPPlugin.php(182): Symfony\Component\Process\ProcessBuilder->getProcess()
#2 /home/circleci/repo/vendor/phpro/grumphp/src/Composer/GrumPHPPlugin.php(137): GrumPHP\Composer\GrumPHPPlugin->runGrumPhpCommand('configure')
#3 [internal function]: GrumPHP\Composer\GrumPHPPlugin->runScheduledTasks(Object(Composer\Script\Event))
#4 phar:///usr/local/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php(171): call_user_func(Array, Object(Composer\Script\Event))
#5 phar:///usr/local/bin/compose in phar:///usr/local/bin/composer/vendor/symfony/process/Process.php on line 141

Seems to be related to Laravel 5.5 + Composer: https://github.com/laravel/framework/issues/20995

I don't get this error on my own computer though, so I'm not too sure why it's happening.

https://circleci.com/gh/Daniel15/BuildSize/4

serima commented 6 years ago

Ah, I also encountered same error on CircleCI. I think that the issue should be re-opened too, thanks.

veewee commented 6 years ago

By default VCR enables all library hooks: http://php-vcr.github.io/documentation/configuration/#library-hooks

You'll have to change the phpunit bootstrap file in order to make this work. Add

\VCR\VCR::configure()->enableLibraryHooks(array('curl_rewrite'));

Before

https://github.com/Daniel15/BuildSize/blob/master/tests/bootstrap.php#L4