Closed (fixed)
Project:
Drupal core
Version:
8.7.x-dev
Component:
base system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
8 Feb 2019 at 11:42 UTC
Updated:
28 Feb 2019 at 12:44 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
lendudeThis makes perfect sense to me, the move from simpletest to PHPUnit should be easy. Taking \Drupal\FunctionalTests\AssertLegacyTrait out of D9 would make the hurdle much higher for modules still on Simpletest as they would also need to update a huge amount of methods in the test at the same time.
Comment #3
catchShould we undeprecate or just change the deprecation to Drupal 10 now?
Comment #4
jibranI'm trying to understand the logic behind this.
This doesn't seem to be a good logic to me. This just shows that we have to improve our analysis tools.
There is no learning curve involved here. We can have one change record with a table in it to show 'From' to 'To' methods. It will just become find and replace which is already shared in #3027952-2: [Plan] Remove the usage of deprecated methods in tests.
We have added
\Drupal\FunctionalTests\AssertLegacyTraitalmost two and half year ago. D9 is still more than a year away. I honestly don't get the reason why this is not enough time for people to adapt to the new standards.Personally, I'm worried that if on day 0 of D9 we'll go in with deprecated stuff then by the time we'll create a D10 branch we'll be getting rid of a lot more of dead code.
Comment #5
lendudeThe whole idea behind
\Drupal\FunctionalTests\AssertLegacyTraitwas to make the transition from Simpletest to PHPUnit based tests easier, I think AssertLegacyTrait has value until that transition is fully done. The first moment we know that this transition is done, is going to be when modules run on a system without Simpletest (hopefully D9).Imagine the horror show the conversions would have been if we needed to update all these methods at the same time we did the conversions. If we take this out before D9, that is exactly what we would be asking from contrib that hasn't moved over yet.
I think the burden of maintaining this in D9 is lower then the relief it provides for modules having to do the conversions.
Comment #6
gábor hojtsyThat is my assessment as well.
Ideally we can change it to deprecate until Drupal 10 and have our tools be able to deal with ignoring those deprecations or report them differently.
Comment #7
alexpottI think we should try not to have special tooling or configuration for things as much as possible. PHPstorm for example comes with an built-in deprecation checker.
So here's one possible approach - let's remove the
@and deprecate for Drupal 10. Then in Drupal 9 we add the@back. Static analysis will work. PHPStorm won't pick these out in Drupal 8. And we can deprecate and remove usages 1 by 1 in Drupal 9 thereby not leaving core with a mound of tech debt that we've not paid down.Comment #8
dawehnerThat seems to be a good tradeoff. The benefits from moving to phpunit (better assertions etc.) come for free, whether you use the legacy trait or not. The different assertions in phpunit doesn't do. Given that it seems fine to not deprecate them.
Is it possible to ignore just one rule in this file?
Comment #9
berdir+1
As @alexpott said, we can't change how PHPStorm and other tools displays these and a lot of our tests currently look like a mess with basically every other line striked through. That really makes working with these tests harder because you don't know how much you should clean up while making some small changes.
Doing them method-by-method with some automated tools then in 9.x sounds like a good plan. We have tons of more important things to do still until 9.0. That said, a downside is that it will be easy to use the wrong method when writing new tests when they are not marked as deprecated.
Comment #10
gábor hojtsyThe "Deprecated Scheduled for removal" stuff reads odd but I can see you want to keep the greppability. I think this sounds like a fine compromise. Newly added usage of the "deprecated" methods is IMHO not that bad since it will appear as soon as we actually re-deprecate.
The point about @deprecation tooling in places like phpstorm shows us we need to be careful when we start deprecate for Drupal 10.
Comment #11
alexpottRe #8 - unfortunately there does not appear to be in PHPCS 2.x - there is 3.2.x - which funnily enough we need to update to at some point :)
Comment #13
alexpottUnrelated test fail.
Comment #15
gábor hojtsyUnrelated random fail. Sent for retest.
Comment #17
catchOK this seems like a decent balance between premature deprecation and not telling anyone that it's going to go.
Committed/pushed to 8.7.x, thanks!