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

  1. Investigate what's really going on.
  2. Fix it.
  3. Review/RTBC.
  4. Commit.

User interface changes

None.

API changes

None.

Data model changes

None.

Release notes snippet

N/A.

CommentFileSizeAuthor
#5 3088624-5.address.patch931 bytesmikelutz
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dww created an issue. See original summary.

mglaman’s picture

We can't remove it until Drupal 9, when the deprecated code we're testing is removed.

dww’s picture

Issue summary: View changes

Right, 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.

mglaman’s picture

TIL! so it is

   * @expectedDeprecation Book is deprecated in Drupal 8.6.x and will be removed before Drupal 9.0.x. Use \Drupal\book\Plugin\migrate\source\Book instead. See https://www.drupal.org/node/2947487 for more information.

https://git.drupalcode.org/search?utf8=✓&search=expectedDeprecation&group_id=&project_id=59858&search_code=true&repository_ref=8.8.x&nav_source=navbar

mikelutz’s picture

Status: Active » Needs review
FileSize
931 bytes

We don't have deprecation suppression turned off here, but yes @expectedDeprecation is the proper way to manage that legacy test.

  • dww committed bcd9df9 on 8.x-1.x authored by mikelutz
    Issue #3088624 by mikelutz, dww, mglaman: Kernel\Plugin\migrate\field\...
dww’s picture

Status: Needs review » Fixed

Perfect, 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

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

Kristen Pol’s picture

Issue tags: +Drupal 9 compatibility

Per 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.

Chris Matthews’s picture