mercredi 5 avril 2023

Laravel: Integration tests failing on bitbucket pipelines

I am working on Laravel 5.5 integration tests and they are passing on local env but failing on Bitbucket pipelines. Here is my bitbucket-pipelines.yml:

image: php:7.1

pipelines:
  default:
    - step:
        script:
          - apt-get update && apt-get install -y unzip libzip-dev --force-yes
          - docker-php-ext-install zip
          - docker-php-ext-enable zip
          - docker-php-ext-install sockets
          - docker-php-ext-enable sockets
          - docker-php-ext-install bcmath
          - docker-php-ext-enable bcmath
          - docker-php-ext-install pdo_mysql
          - docker-php-ext-enable pdo_mysql
          - curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
          - composer --version
          - composer self-update --1
          - composer install
          - cp .env.example .env
          - php artisan key:generate
          - sleep 5
          - ./vendor/bin/phpunit --testsuite=unit-api
          - ./vendor/bin/phpunit --testsuite=unit-domain
          - ./vendor/bin/phpunit --testsuite=unit-controllers
          - ./vendor/bin/phpunit --testsuite=integration
        services:
          - mysql
definitions:
  services:
    mysql:
      image: mysql:5.7
      variables:
        MYSQL_DATABASE: 'my_db'
        MYSQL_RANDOM_ROOT_PASSWORD: 'yes'

Here is the error I am receving:

  1. DeleteOrderFileTest::apiDeleteOrderFile Illuminate\Database\QueryException: SQLSTATE[HY000] [2002] No such file or directory (SQL: insert into modules (name, description, updated_at, created_at) values (System Administration, System administration feature, 2023-04-05 09:07:03, 2023-04-05 09:07:03)) /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Database/Connection.php:664 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Database/Connection.php:624 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Database/Connection.php:459 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Database/Connection.php:411 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Database/Query/Processors/Processor.php:32 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:2494 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php:1283 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:787 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:752 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:615 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php:755 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Support/helpers.php:1041 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php:756 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:1570 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:1582 /opt/atlassian/pipelines/agent/build/tests/integration/database/seeds/shared/TestModulesTableSeeder.php:26 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:29 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:87 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:31 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Container/Container.php:564 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Database/Seeder.php:122 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Database/Seeder.php:42 /opt/atlassian/pipelines/agent/build/tests/integration/database/seeds/shared/TestDefaultSeeder.php:24 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:29 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:87 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:31 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Container/Container.php:564 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Database/Seeder.php:122 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Database/Seeder.php:42 /opt/atlassian/pipelines/agent/build/tests/integration/database/seeds/shared/TestSeeder.php:22 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:29 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:87 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:31 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Container/Container.php:564 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Database/Seeder.php:122 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Database/Seeder.php:42 /opt/atlassian/pipelines/agent/build/tests/integration/OrderLineProcessing/OrderLinesFilesSeeder.php:18 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:29 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:87 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:31 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Container/Container.php:564 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Database/Seeder.php:122 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Database/Console/Seeds/SeedCommand.php:63 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/GuardsAttributes.php:122 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Database/Console/Seeds/SeedCommand.php:64 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:29 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:87 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:31 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Container/Container.php:564 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Console/Command.php:179 /opt/atlassian/pipelines/agent/build/vendor/symfony/console/Command/Command.php:255 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Console/Command.php:166 /opt/atlassian/pipelines/agent/build/vendor/symfony/console/Application.php:1021 /opt/atlassian/pipelines/agent/build/vendor/symfony/console/Application.php:275 /opt/atlassian/pipelines/agent/build/vendor/symfony/console/Application.php:149 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Console/Application.php:89 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Console/Application.php:188 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:250 /opt/atlassian/pipelines/agent/build/vendor/laravel/browser-kit-testing/src/Concerns/InteractsWithConsole.php:25 /opt/atlassian/pipelines/agent/build/vendor/laravel/browser-kit-testing/src/Concerns/InteractsWithDatabase.php:87 /opt/atlassian/pipelines/agent/build/tests/integration/IntegrationTestCase.php:19 /opt/atlassian/pipelines/agent/build/tests/integration/API/DeleteOrderFileTest.php:46

What am I doing wrong here?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire