Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): update phpunit to 10.4.2 #4188

Merged
merged 2 commits into from
Dec 29, 2023
Merged

Conversation

BacLuc
Copy link
Contributor

@BacLuc BacLuc commented Dec 2, 2023

api: update symfony/phpunit-bridge recipe

By running
docker compose exec php composer recipes:install symfony/phpunit-bridge --force -v
and then reverting the changes not needed for eCampV3

This will allow to update to phpunit 10.
(symfony/symfony#49069 (comment))

chore(deps): update phpunit to 10.4.2

Copy link
Member

@usu usu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot! Really nice.
Did you notice any performance improvements with v10?

/**
* @dataProvider usersWhichCanEditCampCollaborations
*/
#[DataProvider('usersWhichCanEditCampCollaborations')]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 🚀


<listeners>
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not needed anymore?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Listeners are not supported anymore with phpunit > 10
symfony-phpunit-bridge does not yet have a replacement, but it works now.
https://phpunit.de/announcements/phpunit-10.html

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I see. Doesn't this mean that we loose all the Symfony depreciation warnings then?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems not:

Remaining direct deprecation notices (17)

  15x: Since api-platform/core 3.1: The "openapiContext" option is deprecated, use "openapi" instead.
    15x in ResponseSnapshotTest::testOpenApiSpecMatchesSnapshot from App\Tests\Api\SnapshotTests

  1x: Passing an instance of DateTimeImmutable is deprecated, use Doctrine\DBAL\Types\DateTimeImmutableType::convertToDatabaseValue() instead. (DateTimeType.php:51 called by UTCDateTimeType.php:41, https://github.com/doctrine/dbal/pull/6017, package doctrine/dbal)
    1x in UTCDateTimeTypeTest::testDateTimeImmutableConvertsToDatabaseValue from App\Tests\Types\Doctrine

  1x: Passing an instance of DateTimeImmutable is deprecated, use Doctrine\DBAL\Types\DateImmutableType::convertToDatabaseValue() instead. (DateType.php:51 called by UTCDateType.php:26, https://github.com/doctrine/dbal/pull/6017, package doctrine/dbal)
    1x in UTCDateTypeTest::testDateTimeImmutableConvertsToDatabaseValue from App\Tests\Types\Doctrine

Remaining indirect deprecation notices (9250)

Other deprecation notices (7380)

  1477x: Since symfony/framework-bundle 6.4: The "annotations.cached_reader" service is deprecated without replacement.
    41x in EndpointQueryCountTest::testNumberOfQueriesDidNotChange from App\Tests\Api\SnapshotTests
    8x in CreateColumnLayoutTest::testCreateRejectsParentsWhichDontSupportChildren from App\Tests\Api\ContentNodes\ColumnLayout
    8x in UpdateColumnLayoutTest::testPatchRejectsParentsWhichDontSupportChildren from App\Tests\Api\ContentNodes\ColumnLayout
    8x in CreateMaterialNodeTest::testCreateRejectsParentsWhichDontSupportChildren from App\Tests\Api\ContentNodes\MaterialNode
    8x in UpdateMaterialNodeTest::testPatchRejectsParentsWhichDontSupportChildren from App\Tests\Api\ContentNodes\MaterialNode
    ...

  1477x: Since symfony/framework-bundle 6.4: The "annotations.reader" service is deprecated without replacement.
    41x in EndpointQueryCountTest::testNumberOfQueriesDidNotChange from App\Tests\Api\SnapshotTests
    8x in CreateColumnLayoutTest::testCreateRejectsParentsWhichDontSupportChildren from App\Tests\Api\ContentNodes\ColumnLayout
    8x in UpdateColumnLayoutTest::testPatchRejectsParentsWhichDontSupportChildren from App\Tests\Api\ContentNodes\ColumnLayout
    8x in CreateMaterialNodeTest::testCreateRejectsParentsWhichDontSupportChildren from App\Tests\Api\ContentNodes\MaterialNode
    8x in UpdateMaterialNodeTest::testPatchRejectsParentsWhichDontSupportChildren from App\Tests\Api\ContentNodes\MaterialNode
    ...

  1477x: Since symfony/framework-bundle 6.4: The "annotations.cache_adapter" service is deprecated without replacement.
    41x in EndpointQueryCountTest::testNumberOfQueriesDidNotChange from App\Tests\Api\SnapshotTests
    8x in CreateColumnLayoutTest::testCreateRejectsParentsWhichDontSupportChildren from App\Tests\Api\ContentNodes\ColumnLayout
    8x in UpdateColumnLayoutTest::testPatchRejectsParentsWhichDontSupportChildren from App\Tests\Api\ContentNodes\ColumnLayout
    8x in CreateMaterialNodeTest::testCreateRejectsParentsWhichDontSupportChildren from App\Tests\Api\ContentNodes\MaterialNode
    8x in UpdateMaterialNodeTest::testPatchRejectsParentsWhichDontSupportChildren from App\Tests\Api\ContentNodes\MaterialNode
    ...

  1475x: Since symfony/serializer 6.4: Passing a "Doctrine\Common\Annotations\PsrCachedReader" instance as argument 1 to "Symfony\Component\Serializer\Mapping\Loader\AttributeLoader::__construct()" is deprecated, pass null or omit the parameter instead.
    41x in EndpointQueryCountTest::testNumberOfQueriesDidNotChange from App\Tests\Api\SnapshotTests
    8x in CreateColumnLayoutTest::testCreateRejectsParentsWhichDontSupportChildren from App\Tests\Api\ContentNodes\ColumnLayout
    8x in UpdateColumnLayoutTest::testPatchRejectsParentsWhichDontSupportChildren from App\Tests\Api\ContentNodes\ColumnLayout
    8x in CreateMaterialNodeTest::testCreateRejectsParentsWhichDontSupportChildren from App\Tests\Api\ContentNodes\MaterialNode
    8x in UpdateMaterialNodeTest::testPatchRejectsParentsWhichDontSupportChildren from App\Tests\Api\ContentNodes\MaterialNode
    ...

  1471x: Since symfony/validator 6.4: Method "Symfony\Component\Validator\ValidatorBuilder::setDoctrineAnnotationReader()" is deprecated without replacement.
    41x in EndpointQueryCountTest::testNumberOfQueriesDidNotChange from App\Tests\Api\SnapshotTests
    8x in CreateColumnLayoutTest::testCreateRejectsParentsWhichDontSupportChildren from App\Tests\Api\ContentNodes\ColumnLayout
    8x in UpdateColumnLayoutTest::testPatchRejectsParentsWhichDontSupportChildren from App\Tests\Api\ContentNodes\ColumnLayout
    8x in CreateMaterialNodeTest::testCreateRejectsParentsWhichDontSupportChildren from App\Tests\Api\ContentNodes\MaterialNode
    8x in UpdateMaterialNodeTest::testPatchRejectsParentsWhichDontSupportChildren from App\Tests\Api\ContentNodes\MaterialNode
    ...

  1x: $typeBuilder argument of TypeConverter implementing "ApiPlatform\GraphQl\Type\TypeBuilderInterface" is deprecated since API Platform 3.1. It has to implement "ApiPlatform\GraphQl\Type\TypeBuilderEnumInterface" instead.
    1x in InvitationGraphQLTest::testFindInvitationWhenNotLoggedIn from App\Tests\Api\Invitations

  1x: $typeBuilder argument of FieldsBuilder implementing "ApiPlatform\GraphQl\Type\TypeBuilderInterface" is deprecated since API Platform 3.1. It has to implement "ApiPlatform\GraphQl\Type\TypeBuilderEnumInterface" instead.
    1x in InvitationGraphQLTest::testFindInvitationWhenNotLoggedIn from App\Tests\Api\Invitations

  1x: $fieldsBuilder argument of SchemaBuilder implementing "ApiPlatform\GraphQl\Type\FieldsBuilderInterface" is deprecated since API Platform 3.1. It has to implement "ApiPlatform\GraphQl\Type\FieldsBuilderEnumInterface" instead.
    1x in InvitationGraphQLTest::testFindInvitationWhenNotLoggedIn from App\Tests\Api\Invitations

we still have to fix them 😉

@usu
Copy link
Member

usu commented Dec 28, 2023

I think MailServiceTest was forgotten to update: It still has the legacy @dataProvider annotation. And I'm receiving the following depreciation messages:

4 tests triggered 4 PHPUnit deprecations:

1) App\Tests\Service\MailServiceTest::testSendInvitationMailDoesNotCrashForAllLanguages
Data Provider method App\Tests\Service\MailServiceTest::allSupportedLanguages() is not static

/srv/api/tests/Service/MailServiceTest.php:68

2) App\Tests\Service\MailServiceTest::testSendUserActivationMailDoesNotCrashForAllLanguages
Data Provider method App\Tests\Service\MailServiceTest::allSupportedLanguages() is not static

/srv/api/tests/Service/MailServiceTest.php:121

3) App\Tests\Service\MailServiceTest::testSendResetPasswordMailDoesNotCrashForAllLanguages
Data Provider method App\Tests\Service\MailServiceTest::allSupportedLanguages() is not static

/srv/api/tests/Service/MailServiceTest.php:157

4) App\Tests\Service\MailServiceTest::testSendEmailVerificationMailDoesNotCrashForAllLanguages
Data Provider method App\Tests\Service\MailServiceTest::allSupportedLanguages() is not static

/srv/api/tests/Service/MailServiceTest.php:195

@BacLuc
Copy link
Contributor Author

BacLuc commented Dec 28, 2023

I think MailServiceTest was forgotten to update: It still has the legacy @dataProvider annotation. And I'm receiving the following depreciation messages:

4 tests triggered 4 PHPUnit deprecations:

1) App\Tests\Service\MailServiceTest::testSendInvitationMailDoesNotCrashForAllLanguages
Data Provider method App\Tests\Service\MailServiceTest::allSupportedLanguages() is not static

/srv/api/tests/Service/MailServiceTest.php:68

2) App\Tests\Service\MailServiceTest::testSendUserActivationMailDoesNotCrashForAllLanguages
Data Provider method App\Tests\Service\MailServiceTest::allSupportedLanguages() is not static

/srv/api/tests/Service/MailServiceTest.php:121

3) App\Tests\Service\MailServiceTest::testSendResetPasswordMailDoesNotCrashForAllLanguages
Data Provider method App\Tests\Service\MailServiceTest::allSupportedLanguages() is not static

/srv/api/tests/Service/MailServiceTest.php:157

4) App\Tests\Service\MailServiceTest::testSendEmailVerificationMailDoesNotCrashForAllLanguages
Data Provider method App\Tests\Service\MailServiceTest::allSupportedLanguages() is not static

/srv/api/tests/Service/MailServiceTest.php:195

Yes, i assume since you merged devel with the rumantsch changes

@usu
Copy link
Member

usu commented Dec 29, 2023

I think MailServiceTest was forgotten to update: It still has the legacy @dataProvider annotation. And I'm receiving the following depreciation messages:

4 tests triggered 4 PHPUnit deprecations:

1) App\Tests\Service\MailServiceTest::testSendInvitationMailDoesNotCrashForAllLanguages
Data Provider method App\Tests\Service\MailServiceTest::allSupportedLanguages() is not static

/srv/api/tests/Service/MailServiceTest.php:68

2) App\Tests\Service\MailServiceTest::testSendUserActivationMailDoesNotCrashForAllLanguages
Data Provider method App\Tests\Service\MailServiceTest::allSupportedLanguages() is not static

/srv/api/tests/Service/MailServiceTest.php:121

3) App\Tests\Service\MailServiceTest::testSendResetPasswordMailDoesNotCrashForAllLanguages
Data Provider method App\Tests\Service\MailServiceTest::allSupportedLanguages() is not static

/srv/api/tests/Service/MailServiceTest.php:157

4) App\Tests\Service\MailServiceTest::testSendEmailVerificationMailDoesNotCrashForAllLanguages
Data Provider method App\Tests\Service\MailServiceTest::allSupportedLanguages() is not static

/srv/api/tests/Service/MailServiceTest.php:195

Yes, i assume since you merged devel with the rumantsch changes

Oops, sorry for that. Didn't notice. Shall I fix it? Or you plan to rebase properly anyway?

@BacLuc
Copy link
Contributor Author

BacLuc commented Dec 29, 2023

Oops, sorry for that. Didn't notice. Shall I fix it? Or you plan to rebase properly anyway?

I will rebase properly anyway as soon as i have the approvals

Copy link
Member

@manuelmeister manuelmeister left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

By running
docker compose exec php composer recipes:install symfony/phpunit-bridge --force -v
and then reverting the changes not needed for eCampV3

This will allow to update to phpunit 10.
(symfony/symfony#49069 (comment))
@BacLuc BacLuc added this pull request to the merge queue Dec 29, 2023
Merged via the queue into ecamp:devel with commit 60e1b10 Dec 29, 2023
32 checks passed
@BacLuc BacLuc deleted the api-update-phpunit-10 branch December 29, 2023 22:44
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.

None yet

3 participants