Skip to content

[Notifier] [DX] Abstract test cases #39495

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
Dec 22, 2020

Conversation

OskarStark
Copy link
Contributor

@OskarStark OskarStark commented Dec 14, 2020

Q A
Branch? 5.1
New feature? no
Deprecations? no
Tickets ---
License MIT
Doc PR ---

This PR

  • adds a new abstract TransportTestCase
  • adds a new abstract TransportFactoryTestCase (code is mainly taken from the Mailer/TransportFactoryTestCase)

We have a lot of code duplication in the notifier bridges

Todos

  • check if we want this
  • I would want to use Dsn strings (like already used in the notifier bridge tests) instead of objects for the providers, what do you think? For me it is more readably
  • update all bridges
  • Bump notifier to ~5.1.10

Questions

  • is it Ok to consider this a bugfix and merge into 5.1?
  • shall I prefix the abstract test cases with Abstract ? As we did the same for Mailer, I would say no

@symfony/mergers have to change ^5.2 into ^5.2.1

@carsonbot carsonbot added Status: Needs Review Notifier DX DX = Developer eXperience (anything that improves the experience of using Symfony) labels Dec 14, 2020
@carsonbot carsonbot added this to the 5.1 milestone Dec 14, 2020
@OskarStark OskarStark force-pushed the abstract-test-case branch 2 times, most recently from 59dc394 to 2996190 Compare December 14, 2020 14:53
fabpot added a commit that referenced this pull request Dec 15, 2020
… (OskarStark)

This PR was merged into the 5.1 branch.

Discussion
----------

[Notifier]  [Free Mobile] Could not use custom host in DSN

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

While working on #39509 I discovered, that you cannot set a custom host through the DSN string itself, only by calling `setHost()` method in the transport, which is only possible by **not** using the factory....

I changed it the way all other bridges work. I don't add a testcase for the port, because non of the others have that test.
I plan to implement it in #39495

As this is a bugfix I created an extra PR.

Cheers

EDIT:

Also the host is not allowed to contain `https://` otherwise calling `__toString()` will result in: `freemobile://https://......`

Commits
-------

63350cc [Notifier] [Free Mobile] Could not use custom host in DSN
@OskarStark OskarStark changed the title [Notifier] [DX] Use abstract factory test case [Notifier] [DX] Use abstract test case Dec 16, 2020
@OskarStark OskarStark changed the title [Notifier] [DX] Use abstract test case [Notifier] [DX] Use abstract test cases Dec 16, 2020
@OskarStark OskarStark force-pushed the abstract-test-case branch 4 times, most recently from a030df5 to 8d7700f Compare December 18, 2020 11:09
@OskarStark OskarStark changed the title [Notifier] [DX] Use abstract test cases [Notifier] [DX] Abstract test cases Dec 19, 2020
@@ -18,7 +18,7 @@
"require": {
"php": ">=7.2.5",
"symfony/http-client": "^4.3|^5.0",
"symfony/notifier": "~5.1.0"
"symfony/notifier": "~5.1.10"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I guess I need to bump this to ~5.1.11, now that 5.1.10 was released, right?

@OskarStark
Copy link
Contributor Author

Ready to merge from my side 👍

Copy link
Member

@derrabus derrabus left a comment

Choose a reason for hiding this comment

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

Okay, first of all, I really like the new test case classes. They give the tests of all bridges more structure and makes it easier to maintain.

But:

  • We're basically rewriting the test suites of all notifier bridges for the 5.1 branch here. That branch is going to die next month.
  • I have merged several tests refactorings from 5.1 to 5.2 and had to solve quite a few conflicts each time. Slack bridge, I'm looking at you.
  • Quite a few bridges have changed fundamentally in 5.2. It is close to impossible to merge this PR cleanly to 5.2 and beyond.

So, this PR certainly improves things, but I wonder if we should really target 5.1.

@OskarStark
Copy link
Contributor Author

OskarStark commented Dec 22, 2020

So, this PR certainly improves things, but I wonder if we should really target 5.1.

If you like you can just merge it in 5.1 and keep the 5.2 like it is. I would then create a follow up PR against 5.2, so no need to fix all the merge conflicts. But the only thing (but not complicated at all) is Slack.I tried to merge 5.2 in my branch and all merge conflicts are not hard to fix, because of my PR #39428, which I created before 👍

@derrabus
Copy link
Member

Thank you Oskar.

@derrabus derrabus merged commit 1ee1659 into symfony:5.1 Dec 22, 2020
@OskarStark OskarStark deleted the abstract-test-case branch December 22, 2020 14:17
nicolas-grekas added a commit that referenced this pull request Jan 7, 2021
This PR was squashed before being merged into the 5.2 branch.

Discussion
----------

[Notifier] Use abstract test cases in 5.2

| Q             | A
| ------------- | ---
| Branch?       | 5.2
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | Follows #39495
| License       | MIT
| Doc PR        | ---

Same as #39495, but for `5.2`

cc @derrabus

Commits
-------

8f6b08c [Notifier] Use abstract test cases in 5.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DX DX = Developer eXperience (anything that improves the experience of using Symfony) Notifier Status: Reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants