在CIRCLECI中测试Laravel代码时,PHPUNIT失败

时间:2018-06-05 15:34:23

标签: php unit-testing phpunit circleci

当我向代码库提交git push时,circleci启动以确保在合并PHPUNIT运行之前完成测试并且无法完成。我已经为circleci和phpunit的输出添加了我的config.yml文件片段:

Circleci config:

        name: Downloading phpunit...
     command: wget https://phar.phpunit.de/phpunit-7.2.3.phar -O phpunit && chmod +x phpunit
  - run:
     name: Running phpunit...
     command: php phpunit --version
  - run:
     command: php phpunit -c phpunit.xml
  - run:
     name: Running PHPCS...
     command: phpcs .
     background: true
  - run: 
     name: Executing php linting...
     command: find . \( -path ./vendor -o -path ./storage -o -path    ./node_modules \) -prune -o -name "*.php" -print0 | xargs -0 -n1 -P8 php -l
 ##      - run:
  #         name: Start Chrome Driver
  #         command: ./vendor/laravel/dusk/bin/chromedriver-linux  --no-sandbox --whitelisted-ips="120.0.0.1,192.30.253.113"
  #         background: true
  #      - run:
  #         name: Run Laravel Server
  #         command: php artisan serve
  #         background: true
  #      - run: ./vendor/bin/phpunit --debug

我已经改变了phpunit线路仍然没有运气..这是正在运行的配置的当前副本。

这是phpunit使用--debug param运行抛出的输出:

#!/bin/bash -eo pipefail
./vendor/bin/phpunit --debug
PHPUnit 7.0.2 by Sebastian Bergmann and contributors.

Test 'Tests\Feature\LoginTest::testloginFormFailureBadPassword' started
Test 'Tests\Feature\LoginTest::testloginFormFailureBadPassword' ended
Test 'Tests\Feature\LoginTest::testloginFormFailureBadEmailBadPass' started
Test 'Tests\Feature\LoginTest::testloginFormFailureBadEmailBadPass' ended
Test 'Tests\Feature\LoginTest::testloginFormSuccess' started
Test 'Tests\Feature\LoginTest::testloginFormSuccess' ended
Test 'Tests\Feature\LogoutTest::testLogoutSuccess' started
Test 'Tests\Feature\LogoutTest::testLogoutSuccess' ended
Test     'Tests\Feature\RegistrationTest::testRegistrationFormFailureNoBirthDate' started
Test 'Tests\Feature\RegistrationTest::testRegistrationFormFailureNoBirthDate' ended
Test 'Tests\Feature\RegistrationTest::testRegistrationFormSuccess' started
Test 'Tests\Feature\RegistrationTest::testRegistrationFormSuccess' ended
Test 'Tests\Unit\DashboardTest::testDashboardIndex' started
Test 'Tests\Unit\DashboardTest::testDashboardIndex' ended
Test 'Tests\Unit\DashboardTest::testDashboardIndexNoAuth' started
Test 'Tests\Unit\DashboardTest::testDashboardIndexNoAuth' ended
Test 'Tests\Unit\LoginTest::testLoginPostSuccess' started
Test 'Tests\Unit\LoginTest::testLoginPostSuccess' ended
Test 'Tests\Unit\ParticipantPledgeTotalTest::testPplTotal' started
Test 'Tests\Unit\ParticipantPledgeTotalTest::testPplTotal' ended
Test 'Tests\Unit\ProgramFlatTotalTest::testFloatTotalSuccess' started
Test 'Tests\Unit\ProgramFlatTotalTest::testFloatTotalSuccess' ended
Test 'Tests\Unit\ProgramFlatTotalTest::testPercentToGoalSuccess' started
Test 'Tests\Unit\ProgramFlatTotalTest::testPercentToGoalSuccess' ended
Test 'Tests\Unit\ProgramFlatTotalTest::testPercentToGoalNullSuccess' started
Test 'Tests\Unit\ProgramFlatTotalTest::testPercentToGoalNullSuccess' ended
Test 'Tests\Unit\RegistrationTest::testRegistrationPostSuccess' started
Test 'Tests\Unit\RegistrationTest::testRegistrationPostSuccess' ended


Time: 15.02 minutes, Memory: 18.00MB

There were 10 errors:

1) Tests\Feature\LoginTest::testloginFormFailureBadPassword
Facebook\WebDriver\Exception\WebDriverCurlException: Curl error thrown for http POST to /session with params: {"desiredCapabilities":{"browserName":"chrome","platform":"ANY","chromeOptions":{"binary":"","args":["--disable-gpu","--headless"]}}}

Operation timed out after 30001 milliseconds with 0 bytes received

/root/repo/vendor/facebook/webdriver/lib/Remote/HttpCommandExecutor.php:286
/root/repo/vendor/facebook/webdriver/lib/Remote/RemoteWebDriver.php:126
/root/repo/tests/DuskTestCase.php:41
 ......{ snip for size }....
ERRORS!
Tests: 14, Assertions: 7, Errors: 10.
Exited with code 2

缩小尺寸..主要是所有行都有"操作在30001毫秒后超时,接收到0个字节"

有没有其他人用圆圈ci遇到过这个问题?

0 个答案:

没有答案