Kernel Tests: Deprecations

Created on 1 April 2024, about 1 year ago
Updated 12 August 2024, 8 months ago

Problem/Motivation

When I run kernel tests, I get this self deprecation notice:

Remaining self deprecation notices (6)

2x: The definition for the 'rules.reaction.test_rule.expression.conditions.conditions' sequence declares the type of its items in a way that is deprecated in drupal:8.0.0 and is removed from drupal:11.0.0. See https://www.drupal.org/node/2442603
2x in EventIntegrationTest::testHoneypotRejectEvent from Drupal\Tests\honeypot\Kernel

2x: The definition for the 'rules.reaction.test_rule.expression.actions.actions' sequence declares the type of its items in a way that is deprecated in drupal:8.0.0 and is removed from drupal:11.0.0. See https://www.drupal.org/node/2442603
2x in EventIntegrationTest::testHoneypotRejectEvent from Drupal\Tests\honeypot\Kernel

1x: The Drupal\Tests\field\Traits\EntityReferenceTestTrait is deprecated in drupal:10.2.0 and is removed from drupal:11.0.0. Instead, use \Drupal\Tests\field\Traits\EntityReferenceFieldCreationTrait. See https://www.drupal.org/node/3401941
1x in KernelTestSuite::suite from Drupal\Tests\TestSuites

1x: Installing the table sequences with the method KernelTestBase::installSchema() is deprecated in drupal:10.2.0 and is removed from drupal:12.0.0. See https://www.drupal.org/node/3349345
1x in EventIntegrationTest::testHoneypotRejectEvent from Drupal\Tests\honeypot\Kernel

Steps to reproduce

Run phpunit --testsuite="kernel" --group="honeypot"

📌 Task
Status

Fixed

Version

2.1

Component

Code

Created by

🇨🇦Canada ryanrobinson_wlu

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @ryanrobinson_wlu
  • 🇺🇸United States tr Cascadia

    Yes, deprecations are introduced into core all the time - this is just a normal part of keeping the module up-to-date, not a bug.

    That's why we have automated testing - so we see these things. It's not necessary to post an issue for notices in the tests unless you want to provide a patch to address these issues.

    The deprecation notices are simply notices that something will be changing in the future - in this case the current code is just fine and will be fine until Drupal 11 (or Drupal 12 in that one case!).

    Are you planning on providing a patch for this issue?

  • 🇺🇸United States japerry KVUO

    I'd suggest closing this. It should be taken care of during the d11 automated fixes patch.

    Note, 'fixing' this deprecation will cause testing to stop working on versions of Drupal earlier than 10.2, unless you use a BC layer around the renamed trait.

  • Status changed to Postponed 9 months ago
  • 🇺🇸United States tr Cascadia

    2

    x: The definition for the 'rules.reaction.test_rule.expression.conditions.conditions' sequence declares the type of its items in a way that is deprecated in drupal:8.0.0 and is removed from drupal:11.0.0. See https://www.drupal.org/node/2442603
    2x in EventIntegrationTest::testHoneypotRejectEvent from Drupal\Tests\honeypot\Kernel
    
    2x: The definition for the 'rules.reaction.test_rule.expression.actions.actions' sequence declares the type of its items in a way that is deprecated in drupal:8.0.0 and is removed from drupal:11.0.0. See https://www.drupal.org/node/2442603
    2x in EventIntegrationTest::testHoneypotRejectEvent from Drupal\Tests\honeypot\Kernel

    These two are in the Rules module, not Honeypot, and were taken care of by the Rules issue 📌 [11] Schema Validation errors: Incompatible types Fixed

    1x: The Drupal\Tests\field\Traits\EntityReferenceTestTrait is deprecated in drupal:10.2.0 and is removed from drupal:11.0.0. Instead, use \Drupal\Tests\field\Traits\EntityReferenceFieldCreationTrait. See https://www.drupal.org/node/3401941
    1x in KernelTestSuite::suite from Drupal\Tests\TestSuites

    I don't know what this is. Honeypot doesn't use EntityReferenceTestTrait.

    1x: Installing the table sequences with the method KernelTestBase::installSchema() is deprecated in drupal:10.2.0 and is removed from drupal:12.0.0. See https://www.drupal.org/node/3349345
    1x in EventIntegrationTest::testHoneypotRejectEvent from Drupal\Tests\honeypot\Kernel

    Similar to all deprecation notices, this one is telling us that this was changed in core 10.2. That means if Honeypot is going to support versions of core below 10.2, it CAN'T make this change yet. Or at least, if it does make the change it has to insert conditional code into Honeypot to do the equivalent of "if core version < 10.3 then do something, else do something different". I don't plan to do that - instead, because of all the breaking changes in 10.2, 10.3, and 11, I plan to make a new branch of Honeypot which supports only core 10.3 and above. This deprecation will be fixed in the new branch, but not in the old since the old branch will never support core versions greater than 10.2.

    As a side note, running tests on your own is not a good way to find and fix problems - you are reporting errors that depend on your testing setup (unknown to me) and the modules you have installed (unknown to me). As I said, Honeypot has automated tests which run on GitLabCI where the test environment and conditions are defined and known. If an error shows up in the automated tests, then we are aware of it! If you would like to provide a fix for any testing error that shows up, please open a new issue and link to the automated test output. But there is no need to open an issue unless you plan to create a patch.

    Postponing this because the one deprecation about installSchema() does need to be taken care of eventually, but it will be in a new branch which does not exist yet.

  • Status changed to Fixed 8 months ago
  • 🇺🇸United States tr Cascadia

    The installSchema() fix was made in 📌 [10.2] Drupal\Core\Database\Connection::nextId(), the {sequences} table and schema are deprecated Fixed

    I plan to make a new branch of Honeypot which supports only core 10.3 and above. This deprecation will be fixed in the new branch, but not in the old since the old branch will never support core versions greater than 10.2.

    This has been done. Honeypot 2.2.x support D10.3+ and D11.

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

Production build 0.71.5 2024