-
-
Notifications
You must be signed in to change notification settings - Fork 406
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
Deprecate usage of restricted resolver. #229
Deprecate usage of restricted resolver. #229
Conversation
+1 this was a good idea in principle and a pain in the neck in practice |
Yes please! Very tired of adding 5 lines of code, including one new injection, to a core service and needing to update dozens of unit test files 😺 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rwjblue the mocha examples look correct.
I'm a little worried about that moduleFor()
and moduleForComponent()
will behave differently now, even though they are both called integration test 🤔
@Turbo87 - Can you expand on that a bit? I'm not sure of the difference you are referring to. After this proposal is implemented the |
I can update the RFC a bit to make this clearer, but once this deprecation has landed and been absorbed by the community we will be able to remove the requirement to specify |
right now we have three options for testing components:
if we now change everything that was |
Ah, I see! Thank you for clarifying. I think that is important for me to address in the drawbacks section, but ultimately I believe that the folks would generally not assume two different APIs ( This deprecation RFC is not proposing adding new behaviors to any of the main testing functions, and is attempting to reduce the total number of valid options (with the long term goal of removing even |
Updated drawbacks section with that concern (and the mitigation), as well as added a section RE: removing the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, big 👍 on this! I've updated needs
more times than I could ever care for.
## Remove Deprecated `unit` / `needs` Options | ||
|
||
Once the changes from this RFC are made, we will be able to remove | ||
support for `unit` and `needs` options from `ember-test-helpers`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we also deprecate integration
during this change? Seems like we should since it will no longer have much significance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we can deprecate it but it provides somewhat little benefit to deprecate other than forcing all blueprints to change and all tests to be updated (yet again).
I think I'd prefer to avoid the second deprecation...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I definitely understand wanting to avoid the churn, but it feels incorrect to me to leave integration: true
sitting in a bunch of tests with no apparent reason for it being there. One concern about this is that even though the flag will no longer do anything, developers may still believe it has some effect on the behavior of the tests.
Maybe rather than introduce a deprecation that logs on every single test that has the flag, we log a message the first time it is encountered? Just to ensure context is given.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@trentmwillis - OK, that seems like a reasonable compromise. Basically a single deprecation mentioning that integration: true
has no effect and should be removed. I'll update this section to mention that...
Also, for context, I am working on another RFC that will suggest migrating to a new ember-qunit API (see emberjs/ember-qunit#258 for context). My plan is to land both of these RFCs in roughly the same timeframe, so that we can update the blueprints once. The new API will not allow unit
, needs
, or integration
options, and will likely suggest deprecating the current style completely (which is why I am not terribly concerned with leaving integration
around for long...).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the verbiage here...
@rwjblue since this will be a larger refactoring for everyone I'm wondering if this change should be combined with the proposed new testing API... 🤔 |
@Turbo87 - There will be another RFC (hoping to submit today/tomorrow) for that. My plan is to move forward with both things together to avoid needless churn in the blueprints (and mental models). However, I wanted to discuss both changes independently. One of the changes is a true deprecation (as you can see I used the deprecation template here) and the other is a "new feature". |
This was discussed at the 2017-06-30 core team meeting, and given that the responses by folks are overwhelmingly positive it is ready to advance to final comment period. |
No new information was identified during final comment period, thanks to everyone for the detailed review and help working through this. Let's do it! |
rendered
This is the first of the RFC's mentioned in the core team notes from 2017-05-26.