Problem/Motivation
#2870194: Ensure that process-isolated tests can use Symfony's PHPunit bridge to catch usages of deprecated code surfaced a lot of technical debt in core. By default, deprecation errors cause test failures.
Conversations in #2607260: [meta] Core deprecation message introduction, contrib testing etc. lead us to understand that we need to hide some of this technical debt (in the form of test failures) from contrib.
Proposed resolution
Have the testbot run run-tests.sh with --suppress-deprecations for contrib projects, but not for core.
Remaining tasks
Figure out a more sustainable solution to deprecation error contrib workflows.
Potentially allow individual projects to maintain their own build file so they can have granular control over deprecations. #2901677: Allow projects to contain their own drupalci.yml file
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | 2926314-8.do_not_test.patch | 18.08 KB | alexpott |
| #8 | 7-8-interdiff.txt | 4.77 KB | alexpott |
| #7 | 2926314_6_do_not_test.patch | 12.89 KB | mile23 |
Comments
Comment #3
mile23Added branch 2926314-contrib-should-suppress-deprecations
This refactors building the run-tests.sh command into its own method, so that we can unit test it. And then adds a unit test.
It figures out whether we're on core or contrib based on
$this->configuration['extension_test'] == TRUE;and then also figures out whether we're on core 8.5.x based onDCI_CoreBranch.In order to figure out the branch version, it uses composer/semver, which is now an explicit dependency. I also bumped up the composer/composer requirement so we're not stuck at 1.3.0-dev.
Minor CS changes in the Simpletest plugin.
Comment #4
alexpottI've had a look at the code and it seems sane. Given we have the flag
$this->configuration['extension_test']already and the patch copes with the fact that--suppress-deprecationsis only available on 8.5.x in a good way (ie. using the semver dependency) +1 to the approach.Comment #5
mile23Thanks.
I was thinking about this today and it needs to more formally add the
--suppress-deprecationsflag as an environmental variable similar to the others, and only apply it if the core branch is ^8.5.Comment #7
mile23Added
DCI_RTSuppressDeprecations, andgetRunTestsFlagValues()is now responsible for figuring out if core is ^8.5.Since the commits are hard to read in order, there's a patch attached, diff against dev.
Comment #8
alexpottI think it is worthwhile expanding the test coverage because the code is not quite as straightforward as before. Something like this:
Because the
core_branchflag is always set and the code now supports asuppress-deprecationsflag (at least for core).I think here we should trust the flag if it is set.
Patch attached does the two things mentioned in this review.
Comment #9
mile23The policy with testbot plugins is that default config values should support core. So moving forward we want
suppress-deprecationsto beFALSEunless we hear otherwise from the environmental variable.If the plan is to tell contrib builds to ignore the deprecation errors by sending
DCI_RTSuppressDeprecationsfrom D.O, then we want to honor it. But I don't see an issue about it.Comment #10
alexpott@Mile23 re #9 that's exactly the way it works. It allows a flag to overrule instead of always setting based on
$is_extension_testso when we do allow contrib maintainers to configure this via the UI it just works without any code change.Comment #11
mile23Talked with @mixologic about this in slack.
Basically we don't want to care about core versions in the testbot.
Since the phpunit-bridge is in both 8.4.x and 8.5.x, there should be a backport of
--suppress-deprecationsto 8.4.x before we can add it as an argument to the simpletest plugin here.@Mixologic will add a band-aid fix at the Jenkins level to turn off deprecation fails for contrib, using
SYMFONY_DEPRECATIONS_HELPER=disabled, and that will be the temporary fix we should try to replace with something more sustainable.So this issue is now postponed on #2927636: Backport --supress-deprecations to run-tests.sh 8.4.x
And other sustainable CI strategies should be discussed in #2607260: [meta] Core deprecation message introduction, contrib testing etc.
Woot.
Comment #12
samuel.mortenson@mile23 Is there an issue to track for the "band-aid" fix? I'm seeing a module I just published have test failures for deprecation notices in its dependencies (https://www.drupal.org/pift-ci-job/827146). Thanks for working on this!
Comment #13
samuel.mortensonI don't usually re-ping issues but this seems pretty bad - modules I contribute to have failing branch tests and issues cannot get out of Needs Work, which makes review difficult.
Comment #14
mile23#2927636: Backport --supress-deprecations to run-tests.sh 8.4.x is in, so this needs work. It should remove the version checking part of the simpletest plugin and leave support for --suppress-deprecations which is now in both 8.4.x and 8.5.x.
I believe the plan is also to add the suppression flag at the Jenkins level, so we should also remove logic about whether or not we're dealing with contrib.
Comment #15
MixologicI did a bunch of work on this yesterday, I'll be able to deploy soon.
Comment #18
MixologicOkay, finally got this massaged into a state where we dont have to do any version dependent twiddling. It just does a basic grep for suppress to gather whether or not the capability exists.
Contrib tests should now be run without failing due to using deprecations.
Comment #19
MixologicThis is an example of one that had a deprecation warning that no longer does.
https://www.drupal.org/pift-ci-job/836319