Closed (won't fix)
Project:
Drupal core
Version:
11.x-dev
Component:
phpunit
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
14 Nov 2017 at 08:27 UTC
Updated:
14 Nov 2025 at 07:53 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
alexpottHere's a patch that allows tests to add to the skipped deprecations list - this should allow contrib to manage their own approach to tech debt.
Comment #3
jonathan1055 commentedThis looks very interesting, and would solve the problem for Scheduler module https://www.drupal.org/pift-ci-job/810669, until such time as Rules #2922757: Replace deprecated RouteEnhancerInterface, then remove @group legacy is fixed.
Is there a way that a contrib module can test these changes alongside a patch/change for it's own tests? I know you have added tests for the new functionality but it would be good to see how it works for real. If I submit a patch for a contrib module I can't see how I can include this core change in the same test build run. Any ideas?
Thanks for doing this - and making the patch so quickly,
Jonathan
Comment #4
lendudeShould be 'that this means', one 'is' too many
Do we want to use the same pattern we use for $modules? So check all parent classes, so you can set this in a base class and you don't have to copy it in every child class if the base class runs into deprecations during setup or something?
Comment #5
jonathan1055 commented@Lendude, that would be really helpful, because the Rules test failures are over 20 test classes.
Comment #6
mile23If we're doing this then it's time to re-open #2922887: Drupal DeprecationListener only works for process-isolated tests
Comment #7
alexpottHere's a patch that addresses #4.
I'm not wild about doing this. Something just feels like we're doing this wrong. In the rules case even though their tests are failing on 8.5.x - they are not "really" failing. They are just using deprecated code. In order to not use deprecated code the rules maintainer is going to need to release a new version that only supports 8.5.x and up. So that means a new minor that should only be tested on those versions of Drupal. I think we really need is the ability for contrib to disable/enable deprecation testing on specific branches.
Comment #8
jonathan1055 commented@alexpott
Not sure this is good, or maybe I have mis-understood. Take the Rules case as an example - to keep the tests passing we turn off deprecation failures when testing at core 8.5.x. Then we would miss new deprecations. Or are you still proposing to have the functionality to select which deprecations to ignore?
I am also not that keen on this solution, as I always want to fix problems asap and not maintain 'tech debt' carried forward. What we really want is backwards compatibility to 8.4 and in this Rules case it is simple to do - I have created a patch on #2883680-112: Force all route filters and route enhancers to be non-lazy which allows the new replacement class to be used in 8.4 and 8.3. Hopefully someone can review it, then commit and we can move forward with replacing the actual deprecated code.
Jonathan
Comment #9
alexpott@jonathan1055 well you need to ability to turn off deprecation checking for the current stable branch cause that works on 8.4.x and 8.5.x and then open a new branch which is only compatible with 8.5.x and up that has deprecation checking.
Comment #10
almaudoh commented@alexpott, I don't know if it is worth opening up a new branch each time an API gets deprecated, especially considering that most contrib modules are not yet using semantic versioning. So one would have to jump from 8.x-1.x to 8.x-2.x in order to avoid test fails.
IMHO, a better way would be to require that where API's are deprecated, the new API should be backported to ensure contrib modules can switch to the new API. If we don't want to backport, then the deprecation should be postponed till the next minor Drupal release.
Comment #11
alexpott@almaudoh the problem is we are not in charge of all deprecations - lots of the deprecations come Symfony.
Comment #12
jonathan1055 commentedThat is true, but many of them can be backported easily. The deprecation which caused this entire issue to be started is very easy to backport to 8.4 and 8.3, as per my patch in #2883680-112: Force all route filters and route enhancers to be non-lazy Is it possible for a Core maintainer to take a look at that, because committing this to 8.4 and 8.3 will solve the problem and we can all then move to the new non-deprecated code.
Comment #13
mile23Hey, check out this postponed issue: #1612910: [policy, no patch] Switch to Semantic Versioning for Drupal contrib extensions (modules, themes, etc)
:-)
Anyway... If contrib can specify minor versions for compatibility, then making a new release per core minor version is reasonable. But: #2313917: Core version key in module's .info.yml doesn't respect core semantic versioning
You can specify a core branch per contrib branch in the automated testing page of a project. So an 8.x-5.x branch could map to core 8.5.x and test against it.
Also, in an ideal world, we'd be able to specify our own rules about whether deprecations fail the test in our own per-project drupalCI build file: #2901677: Allow projects to contain their own drupalci.yml file
So a lot of work is exposed by this issue, and we could either do it or just allow people to ignore deprecations in an array.
Comment #23
smustgrave commentedShould this be targeted for D10?
Comment #25
smustgrave commentedThis issue is being reviewed by the kind folks in Slack, #need-reveiw-queue. We are working to keep the size of Needs Review queue [2700+ issues] to around 200
Moving to PNMI to see if this is still needed? Seems like there was an issue when upgrading from 8.4 from 8.3 that I assume has been resolved as I have not heard of test issues for D10?
And it seems like this wasn't a fix a lot of people here were sure about? But could be mistaken on that.
Comment #27
smustgrave commentedJust following up if still valid? If no follow up could close in 3 months
Comment #28
smustgrave commentedWanted to bump 1 more time before closing.
Comment #29
jonathan1055 commentedIt would have been useful, but I guess if it didn't happen back then, it won't be done now. There was also not a clear agreement.
We do still have this type of problem in Contrib at 11.2 - see the list of 3rd-party modules in the summary of #3514380: Autoloading hooks in the file tokens.inc is deprecated D11.2 which clouds the log with noise and affects the test results.
But thanks for following up, though. If no one else picks this up it can be closed.
Comment #30
mondrakeWell I guess since the introduction of the
.deprecation-ignore.txtfile this is solved in the sense that contrib can define their own file, and use it during testing with a proper setup of theSYMFONY_DEPRECATIONS_HELPERenvironment variable, no?https://git.drupalcode.org/project/drupal/-/blob/11.x/core/phpunit.xml.d...
Comment #31
jonathan1055 commentedThanks mondrake, yes you are right. I had forgotten that solution, and have updated the issue summary. This can be closed now.
Comment #32
mondrakePer #31