Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Mailer][Translation] Remove some static occurrences that may cause unstable tests #49431

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

Merged
merged 1 commit into from
Feb 21, 2023

Conversation

alexandre-daubois
Copy link
Member

@alexandre-daubois alexandre-daubois commented Feb 17, 2023

Q A
Branch? 6.3
Bug fix? no
New feature? no
Deprecations? no
Tickets NA
License MIT
Doc PR NA

I had a little tchat with @nicolas-grekas who warned me that a few of my late edits on static data providers are a bit dangerous. Indeed, some helper methods were using static properties, which could lead to some leaks between test cases, and/or unstable tests.

Helper classes doing so, found in Translation and Mailer, have been reverted to non-static ones. Data-providers are of course still statics and have been adapted to not use those methods.

The targeted branch is 6.3 and this is intended, as requested by Nicolas. If you need any help during the backport of these edits, I'll be happy to help again!

ℹ️ A lot of notifier bridges has been introduced in 6.3 and their data providers weren't updated. I also bundled this change in the PR, which should fix 6.3 pipeline as well.

Finally, I updated SmsapiTransportFactoryTest::missingRequiredOptionProvider. As the from option has been made optional, the only dataset provided failed.

@carsonbot carsonbot added this to the 6.3 milestone Feb 17, 2023
@alexandre-daubois alexandre-daubois force-pushed the improve-static-tests branch 2 times, most recently from 54b6b57 to e8b83e5 Compare February 17, 2023 21:00
@alexandre-daubois alexandre-daubois changed the title [Mailer][Translation] Remove some static occurrences that may cause unstable tests [Mailer][Translation][Notifier] Remove some static occurrences that may cause unstable tests Feb 17, 2023
@carsonbot carsonbot changed the title [Mailer][Translation][Notifier] Remove some static occurrences that may cause unstable tests [Mailer][Translation] Remove some static occurrences that may cause unstable tests Feb 17, 2023
@fabpot
Copy link
Member

fabpot commented Feb 20, 2023

@alexandre-daubois Can you have a look at the failing tests?

@alexandre-daubois alexandre-daubois force-pushed the improve-static-tests branch 2 times, most recently from 0653bc7 to ea342f8 Compare February 20, 2023 17:37
@alexandre-daubois
Copy link
Member Author

@fabpot I fixed tests by adding "psr/event-dispatcher": "^1" to Postmark/composer.json. I think remaining tests will be fixed when packages will be created and once this branch is fully back ported to earlier versions. Don't hesitate to tell me, @nicolas-grekas, if you need any help/new PR to ease this work! 👍

@fabpot
Copy link
Member

fabpot commented Feb 21, 2023

For your information, we never backport pull requests.

@alexandre-daubois
Copy link
Member Author

Right! This one's a bit special as this was a request from Nicolas to target 6.3 before backporting it. I'll do the appropriate updates if this needs to be changed 🙂

Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

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

@nicolas-grekas
Copy link
Member

Thank you @alexandre-daubois.

@nicolas-grekas nicolas-grekas merged commit f80a5bd into symfony:6.3 Feb 21, 2023
@alexandre-daubois
Copy link
Member Author

Thank you for the changes! 🙏

@alexandre-daubois alexandre-daubois deleted the improve-static-tests branch February 21, 2023 10:38
nicolas-grekas added a commit that referenced this pull request Feb 21, 2023
…hat may cause unstable tests (alexandre-daubois)

This PR was merged into the 6.3 branch.

Discussion
----------

[Mailer][Translation] Remove some `static` occurrences that may cause unstable tests

| Q             | A
| ------------- | ---
| Branch?       | 6.3
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | _NA_
| License       | MIT
| Doc PR        | _NA_

I had a little tchat with `@nicolas`-grekas who warned me that a few of my late edits on static data providers are a bit dangerous. Indeed, some helper methods were using static properties, which could lead to some leaks between test cases, and/or unstable tests.

Helper classes doing so, found in `Translation` and `Mailer`, have been reverted to non-static ones. Data-providers are of course still statics and have been adapted to not use those methods.

The targeted branch is 6.3 and this is intended, as requested by Nicolas. If you need any help during the backport of these edits, I'll be happy to help again!

ℹ️ A lot of notifier bridges has been introduced in 6.3 and their data providers weren't updated. I also bundled this change in the PR, which should fix 6.3 pipeline as well.

Finally, I updated `SmsapiTransportFactoryTest::missingRequiredOptionProvider`. As the `from` option has been made optional, the only dataset provided failed.

Commits
-------

2ca9cf8 [Mailer][Translation][Notifier] Remove some `static` occurrences that may cause unstable tests
nicolas-grekas added a commit that referenced this pull request Feb 21, 2023
…hat may cause unstable tests (alexandre-daubois)

This PR was merged into the 6.3 branch.

Discussion
----------

[Mailer][Translation] Remove some `static` occurrences that may cause unstable tests

| Q             | A
| ------------- | ---
| Branch?       | 6.3
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | _NA_
| License       | MIT
| Doc PR        | _NA_

I had a little tchat with `@nicolas`-grekas who warned me that a few of my late edits on static data providers are a bit dangerous. Indeed, some helper methods were using static properties, which could lead to some leaks between test cases, and/or unstable tests.

Helper classes doing so, found in `Translation` and `Mailer`, have been reverted to non-static ones. Data-providers are of course still statics and have been adapted to not use those methods.

The targeted branch is 6.3 and this is intended, as requested by Nicolas. If you need any help during the backport of these edits, I'll be happy to help again!

ℹ️ A lot of notifier bridges has been introduced in 6.3 and their data providers weren't updated. I also bundled this change in the PR, which should fix 6.3 pipeline as well.

Finally, I updated `SmsapiTransportFactoryTest::missingRequiredOptionProvider`. As the `from` option has been made optional, the only dataset provided failed.

Commits
-------

2ca9cf8 [Mailer][Translation][Notifier] Remove some `static` occurrences that may cause unstable tests
nicolas-grekas added a commit that referenced this pull request Feb 21, 2023
* 5.4:
  minor #49431 [Mailer][Translation] Remove some `static` occurrences that may cause unstable tests (alexandre-daubois)
  [Workflow] remove new lines from workflow metadata
  Fix phpdocs in HttpClient, HttpFoundation, HttpKernel, Intl components
  [WebProfilerBundle] Render original (not encoded) email headers
nicolas-grekas added a commit that referenced this pull request Feb 21, 2023
* 6.2:
  minor #49431 [Mailer][Translation] Remove some `static` occurrences that may cause unstable tests (alexandre-daubois)
  minor #49431 [Mailer][Translation] Remove some `static` occurrences that may cause unstable tests (alexandre-daubois)
  [Clock] fix url in README.md
  [Workflow] remove new lines from workflow metadata
  Fix phpdocs in HttpClient, HttpFoundation, HttpKernel, Intl components
  [WebProfilerBundle] Render original (not encoded) email headers
  improve deprecation message
  [Console] fix clear of section with question
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants