Problem/Motivation
#2870194: Ensure that process-isolated tests can use Symfony's PHPunit bridge to catch usages of deprecated code gave us a way to have deprecations fail tests for all test types. It also added a --suppress-deprecations flag to run-tests.sh.
This flag is not present in the 8.4.x version of run-tests.sh.
Since it's not present, we can't allow for it in the testbot. The testbot should not be making exceptions for various core versions, because that causes the testbot to be less maintainable.
Proposed resolution
Add --suppress-deprecations to run-tests.sh for core 8.4.x. This only has to support turning off the phpunit-bridge, which, as of 8.4.x, only supports unit tests.
How to test:
- Remove
@group legacyfrom\Drupal\Tests\link\Unit\Plugin\migrate\cckfield\LinkCckTest - Run
php ./core/scripts/run-tests.sh --color --class '\Drupal\Tests\link\Unit\Plugin\migrate\cckfield\LinkCckTest'- it fails - Run
php ./core/scripts/run-tests.sh --suppress-deprecations --color --class '\Drupal\Tests\link\Unit\Plugin\migrate\cckfield\LinkCckTest'- it passes
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | 2927636-3.patch | 1.65 KB | alexpott |
Comments
Comment #2
mile23This issue is blocking #2926314: Contrib should run with --suppress-deprecations
Comment #3
MixologicLets just add the option, and have it NOOP. we just need it to exist, but it wont actually do anything.
Comment #4
alexpottHere's all we need.
Comment #5
alexpottThis patch was created by doing
git co 8.5.x core/scripts/run-tests.shComment #6
alexpottComment #7
mile23I reviewed this by modifying
Drupal\Tests\Core\EntityReferenceSelection\EntityReferenceSelectionUnitTest(at random) to remove@group legacyand@expectedDeprecation.Then I ran run-tests.sh and verified that the test fails:
Browser output shows that the fail was caused by the deprecation:
Applying the patch in #4, I re-ran the test without adding
--suppress-deprecationsand got the same fail.Adding
--suppress-deprecationsI get this:So I'm saying right on, this works.
Comment #8
Mixologic+1
Comment #9
catchTheoretically we want the actual functionality in 8.4.x for unit tests, it's just no-one really noticed that support since they're used less than kernel/functional tests. Patch looks fine so committed bfe2a01 and pushed to 8.4.x. Thanks!
Comment #11
mile23Added to change record https://www.drupal.org/node/2811561