- Issue created by @jonathan1055
- Merge request !242#3527579 Add #[Group()] attributes for PHPUnit 11 → (Open) created by jonathan1055
- 🇬🇧United Kingdom jonathan1055
Need to remove the 3rd-party deprecation warnings so that we can see what actually needs to be done for Scheduler. Initial results as-is before any work, split by test @group:
scheduler
- 23 tests triggered deprecations (all range between 54 and 74 deps) = too many add up accurately. Log is 41K linesscheduler_api
, 63 + 58 + 59 + 54 = 234 deprecations, log is 8K linesscheduler_js
- each test triggered 54 deprecations. Log is 3K, not too big.scheduler_kernel
- each test triggered 7-9 deprecations. Log 890 lines.scheduler_rules_integration
- each test triggered between 67-74 deprecations. Log is 8K linesscheduler_workbench
- 68 deprecations. Log 1300 lines.
- 🇬🇧United Kingdom jonathan1055
First round of 3rd-party ignores. Big improvements made:
scheduler
- 23 tests triggered deprecations (12-15 deps each). Log is 12K linesscheduler_api
, each 12 - 13 deprecations, log is 2,900 linesscheduler_js
- each test triggered 11 deprecations. Log is 1,500scheduler_kernel
- each test triggered 7-9 deprecations. Log 890 lines (no change).scheduler_rules_integration
- each test triggered 16 deprecations. Log is 3,100 linesscheduler_workbench
- 22 deprecations. Log 880 lines.
-
jonathan1055 →
committed 2b111a55 on 2.x
Issue #3527579 by jonathan1055: Ignore 3-party deprecations in phpunit...
-
jonathan1055 →
committed 2b111a55 on 2.x
- 🇬🇧United Kingdom jonathan1055
After adding group attributes for
scheduler_js
Before: There were 27 PHPUnit test runner deprecations
After: There were 18 PHPUnit test runner deprecations.
The 9 removed messages were allMetadata found in doc-comment for class Drupal\Tests\scheduler\FunctionalJavascript\SchedulerJavascriptDefaultTimeTest. Metadata in doc-comments is deprecated and will no longer be supported in PHPUnit 12. Update your test code to use attributes instead.
So that's good. Even though the
@group scheduler_js<code> is still in the doc-comment, providing there is also the new <code>#[Group('scheduler_js')]
then the phpunit test runner deprecation is not displayed. That should mean we can fix the code for the new core 11.2+ and still support testing at the old core versions. - 🇮🇹Italy mondrake 🇮🇹
As per #3497431-107: Deprecate TestDiscovery test file scanning, use PHPUnit API instead → , you may opt-out from reporting PHPUnit runner deprecations (if they're too noisy for now), by setting the env variable
PHPUNIT_FAIL_ON_PHPUNIT_DEPRECATION
to FALSE. - 🇬🇧United Kingdom jonathan1055
Thanks, yes that worked. After adding
#[DataProvider()]
to go with each@dataProvider
in the javascript tests we still had the messageThere were 9 PHPUnit test runner deprecations
followed by8 tests triggered 11 deprecations
https://git.drupalcode.org/project/scheduler/-/jobs/5598340#L663With
PHPUNIT_FAIL_ON_PHPUNIT_DEPRECATION: 0
we just get straight to8 tests triggered 11 deprecations
https://git.drupalcode.org/project/scheduler/-/jobs/5599415#L661Thanks also for raising 📌 Introduce PHPUNIT_FAIL_ON_PHPUNIT_DEPRECATION Active