Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
When running address tests locally, I'm seeing this:
Testing Drupal\Tests\address\Kernel\Plugin\migrate\field\AddressFieldTest
.. 2 / 2
(100%)
Time: 2.41 seconds, Memory: 4.00MB
OK (2 tests, 6 assertions)
Remaining deprecation notices (2)
1x: AddressField is deprecated in Address 1.3 and will be be removed
before Address 2.x. Use \Drupal\address\Plugin\migrate\field\AddressField
instead.
1x in AddressFieldTest::testDeprecatedPlugin from
Drupal\Tests\address\Kernel\Plugin\migrate\field
1x: MigrateCckFieldInterface is deprecated in Drupal 8.3.x and will be
removed before Drupal 9.0.x. Use
\Drupal\migrate_drupal\Annotation\MigrateField instead.
1x in AddressFieldTest::testDeprecatedPlugin from
Drupal\Tests\address\Kernel\Plugin\migrate\field
Proposed resolution
Use @expectedDeprecation so our tests pass cleanly without themselves triggering the deprecation warnings.
Remaining tasks
- Investigate what's really going on.
- Fix it.
- Review/RTBC.
- Commit.
User interface changes
None.
API changes
None.
Data model changes
None.
Release notes snippet
N/A.
Comment | File | Size | Author |
---|---|---|---|
#5 | 3088624-5.address.patch | 931 bytes | mikelutz |
|
Comments
Comment #2
mglamanWe can't remove it until Drupal 9, when the deprecated code we're testing is removed.
Comment #3
dwwRight, but we should be able to write the tests such that we tell the bot "yeah. we're expecting this deprecated warning, don't bother me." ;)
I believe
@expectedDeprecation
is our friend on this. Updating the summary accordingly.Comment #4
mglamanTIL! so it is
https://git.drupalcode.org/search?utf8=✓&search=expectedDeprecation&group_id=&project_id=59858&search_code=true&repository_ref=8.8.x&nav_source=navbar
Comment #5
mikelutzWe don't have deprecation suppression turned off here, but yes @expectedDeprecation is the proper way to manage that legacy test.
Comment #7
dwwPerfect, thanks! Bot is happy. I re-ran the tests locally and the deprecation warnings are indeed gone.
Committed and pushed to 8.x-1.x.
Cheers,
-Derek
Comment #9
Kristen PolPer a Slack discussion with Gábor Hojtsy regarding usage of D9 tags (Drupal 9, Drupal 9 compatibility, Drupal 9 readiness, etc.), "Drupal 9 compatibility" should be used for contributed projects that need updating and "Drupal 9" was the old tag for D8 issues before the D9 branch was ready. Doing tag cleanup here based on that discussion.
Comment #10
Chris Matthews CreditAttribution: Chris Matthews commented