Skip to content

Conversation

@hantsy
Copy link
Owner

@hantsy hantsy commented Jun 7, 2024

No description provided.

@qodo-merge-pro
Copy link

qodo-merge-pro bot commented Mar 6, 2025

CI Feedback 🧐

(Feedback updated until commit 3f0dad6)

A test triggered by this PR failed. Here is an AI-generated analysis of the failure:

Action: Symfony (PHP 8.3)

Failed stage: Run Tests [❌]

Failed test name: App\Tests\Repository\PostRepositoryTest

Failure summary:

The action failed because of two errors in the App\Tests\Repository\PostRepositoryTest:

1. testCreatePost failed with a database error: "Duplicate table: relation 'post' already exists".
The test is trying to create a database table that already exists.

2. There's a method call error: "Call to undefined method
Testcontainers\Modules\PostgresContainer::stop()". The test is trying to call a stop() method on the
PostgresContainer class that doesn't exist.

Relevant error logs:
1:  ##[group]Operating System
2:  Ubuntu
...

212:  - Downloading php-http/message (1.16.2)
213:  - Downloading php-http/client-common (2.7.2)
214:  - Downloading php-jsonpointer/php-jsonpointer (v4.0.0)
215:  - Downloading league/uri-interfaces (7.5.0)
216:  - Downloading league/uri (7.5.1)
217:  - Downloading jane-php/json-schema-runtime (v7.8.1)
218:  - Downloading jane-php/open-api-runtime (v7.8.1)
219:  - Downloading beluga-php/docker-php-api (v7.1.45.2)
220:  - Downloading symfony/error-handler (v7.2.4)
...

275:  - Installing jane-php/open-api-runtime (v7.8.1): Extracting archive
276:  - Installing beluga-php/docker-php-api (v7.1.45.2): Extracting archive
277:  - Installing symfony/routing (v7.2.3): Extracting archive
278:  - Installing symfony/http-foundation (v7.2.3): Extracting archive
279:  - Installing psr/event-dispatcher (1.0.0): Extracting archive
280:  - Installing symfony/event-dispatcher-contracts (v3.5.1): Extracting archive
281:  - Installing symfony/event-dispatcher (v7.2.0): Extracting archive
282:  - Installing symfony/var-dumper (v7.2.3): Extracting archive
283:  - Installing symfony/error-handler (v7.2.4): Extracting archive
...

662:  Runtime:       PHP 8.3.17 with Xdebug 3.4.1
663:  Configuration: /home/runner/work/symfony-rest-sample/symfony-rest-sample/phpunit.xml.dist
664:  ....json response:::{"id":"1effa419-e08e-6208-9bb3-75aeae64c47d","title":"test title","content":"test content","status":"DRAFT","createdAt":"2025-03-06T04:15:20+00:00","publishedAt":null,"tags":[],"comments":[]}json response of updated post:::{"id":"1effa419-e08e-6208-9bb3-75aeae64c47d","title":"title update","content":"content update","status":"DRAFT","createdAt":"2025-03-06T04:15:20+00:00","publishedAt":null,"tags":[],"comments":[]}update post status::::
665:  \App\Dto\UpdatePostStatusDto::__set_state(array(
666:  'status' => 
667:  \App\Entity\Status::PendingModerated,
668:  ))json response of updated post status:::{"id":"1effa419-e08e-6208-9bb3-75aeae64c47d","title":"title update","content":"content update","status":"PENDING_MODERATED","createdAt":"2025-03-06T04:15:20+00:00","publishedAt":null,"tags":[],"comments":[]}json response of comments:::[{"id":"1effa419-e119-688a-838c-75aeae64c47d","content":"test comment","createdAt":"2025-03-06T04:15:20+00:00"}]..E                                                             7 / 7 (100%)
669:  Time: 00:08.352, Memory: 52.50 MB
670:  There were 2 errors:
671:  1) App\Tests\Repository\PostRepositoryTest::testCreatePost
672:  Doctrine\ORM\Tools\ToolsException: Schema-Tool failed with Error 'An exception occurred while executing a query: SQLSTATE[42P07]: Duplicate table: 7 ERROR:  relation "post" already exists' while executing DDL: CREATE TABLE post (id UUID NOT NULL, title VARCHAR(255) NOT NULL, content VARCHAR(255) NOT NULL, status VARCHAR(255) NOT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, published_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, PRIMARY KEY(id))
...

675:  /home/runner/work/symfony-rest-sample/symfony-rest-sample/vendor/doctrine/orm/src/Tools/Console/Command/SchemaTool/CreateCommand.php:69
676:  /home/runner/work/symfony-rest-sample/symfony-rest-sample/vendor/doctrine/orm/src/Tools/Console/Command/SchemaTool/AbstractCommand.php:37
677:  /home/runner/work/symfony-rest-sample/symfony-rest-sample/vendor/symfony/console/Command/Command.php:279
678:  /home/runner/work/symfony-rest-sample/symfony-rest-sample/vendor/symfony/console/Tester/CommandTester.php:72
679:  /home/runner/work/symfony-rest-sample/symfony-rest-sample/tests/Repository/RepositoryTestBase.php:57
680:  /home/runner/work/symfony-rest-sample/symfony-rest-sample/tests/Repository/PostRepositoryTest.php:26
681:  /home/runner/work/symfony-rest-sample/symfony-rest-sample/vendor/phpunit/phpunit/phpunit:104
682:  Caused by
683:  Doctrine\DBAL\Exception\TableExistsException: An exception occurred while executing a query: SQLSTATE[42P07]: Duplicate table: 7 ERROR:  relation "post" already exists
...

689:  /home/runner/work/symfony-rest-sample/symfony-rest-sample/vendor/doctrine/orm/src/Tools/Console/Command/SchemaTool/CreateCommand.php:69
690:  /home/runner/work/symfony-rest-sample/symfony-rest-sample/vendor/doctrine/orm/src/Tools/Console/Command/SchemaTool/AbstractCommand.php:37
691:  /home/runner/work/symfony-rest-sample/symfony-rest-sample/vendor/symfony/console/Command/Command.php:279
692:  /home/runner/work/symfony-rest-sample/symfony-rest-sample/vendor/symfony/console/Tester/CommandTester.php:72
693:  /home/runner/work/symfony-rest-sample/symfony-rest-sample/tests/Repository/RepositoryTestBase.php:57
694:  /home/runner/work/symfony-rest-sample/symfony-rest-sample/tests/Repository/PostRepositoryTest.php:26
695:  /home/runner/work/symfony-rest-sample/symfony-rest-sample/vendor/phpunit/phpunit/phpunit:104
696:  Caused by
697:  Doctrine\DBAL\Driver\PDO\Exception: SQLSTATE[42P07]: Duplicate table: 7 ERROR:  relation "post" already exists
...

707:  /home/runner/work/symfony-rest-sample/symfony-rest-sample/vendor/doctrine/orm/src/Tools/Console/Command/SchemaTool/CreateCommand.php:69
708:  /home/runner/work/symfony-rest-sample/symfony-rest-sample/vendor/doctrine/orm/src/Tools/Console/Command/SchemaTool/AbstractCommand.php:37
709:  /home/runner/work/symfony-rest-sample/symfony-rest-sample/vendor/symfony/console/Command/Command.php:279
710:  /home/runner/work/symfony-rest-sample/symfony-rest-sample/vendor/symfony/console/Tester/CommandTester.php:72
711:  /home/runner/work/symfony-rest-sample/symfony-rest-sample/tests/Repository/RepositoryTestBase.php:57
712:  /home/runner/work/symfony-rest-sample/symfony-rest-sample/tests/Repository/PostRepositoryTest.php:26
713:  /home/runner/work/symfony-rest-sample/symfony-rest-sample/vendor/phpunit/phpunit/phpunit:104
714:  Caused by
715:  PDOException: SQLSTATE[42P07]: Duplicate table: 7 ERROR:  relation "post" already exists
...

724:  /home/runner/work/symfony-rest-sample/symfony-rest-sample/vendor/doctrine/orm/src/Tools/Console/Command/SchemaTool/CreateCommand.php:69
725:  /home/runner/work/symfony-rest-sample/symfony-rest-sample/vendor/doctrine/orm/src/Tools/Console/Command/SchemaTool/AbstractCommand.php:37
726:  /home/runner/work/symfony-rest-sample/symfony-rest-sample/vendor/symfony/console/Command/Command.php:279
727:  /home/runner/work/symfony-rest-sample/symfony-rest-sample/vendor/symfony/console/Tester/CommandTester.php:72
728:  /home/runner/work/symfony-rest-sample/symfony-rest-sample/tests/Repository/RepositoryTestBase.php:57
729:  /home/runner/work/symfony-rest-sample/symfony-rest-sample/tests/Repository/PostRepositoryTest.php:26
730:  /home/runner/work/symfony-rest-sample/symfony-rest-sample/vendor/phpunit/phpunit/phpunit:104
731:  2) App\Tests\Repository\PostRepositoryTest
732:  Error: Call to undefined method Testcontainers\Modules\PostgresContainer::stop()
733:  /home/runner/work/symfony-rest-sample/symfony-rest-sample/tests/Repository/RepositoryTestBase.php:42
734:  /home/runner/work/symfony-rest-sample/symfony-rest-sample/vendor/phpunit/phpunit/phpunit:104
735:  ERRORS!
736:  Tests: 7, Assertions: 34, Errors: 2.
...

738:  Generating code coverage report in PHPUnit XML format ... done [00:00.108]
739:  Remaining indirect deprecation notices (5)
740:  3x: Since jane-php/open-api-common 7.3: Using Docker\API\Runtime\Client\Client::Docker\API\Runtime\Client\Client::executeEndpoint method with $fetch parameter equals to response is deprecated, use Docker\API\Runtime\Client\Client::executeRawEndpoint instead.
741:  3x in RepositoryTestBase::setUpBeforeClass from App\Tests\Repository
742:  1x: Since doctrine/doctrine-bundle 2.12: The default value of "doctrine.orm.controller_resolver.auto_mapping" will be changed from `true` to `false`. Explicitly configure `true` to keep existing behaviour.
743:  1x in PostControllerTest::testWhenGettingAllPosts_thenReturnOK from App\Tests\Controller
744:  1x: Since doctrine/doctrine-bundle 2.13: Enabling the controller resolver automapping feature has been deprecated. Symfony Mapped Route Parameters should be used as replacement.
745:  1x in PostControllerTest::testWhenGettingAllPosts_thenReturnOK from App\Tests\Controller
746:  Script php bin/phpunit handling the test event returned with error code 2
747:  ##[error]Process completed with exit code 2.

@hantsy hantsy force-pushed the testcontainer branch 2 times, most recently from 9e8e18d to dd1cb60 Compare March 6, 2025 02:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant