Rules automated testing runs cleanly at core versions 8.1, 8.2 and 8.3, as shown on https://travis-ci.org/fago/rules

However, at core 8.4 there is one failure. From my own local test run:

1) Drupal\Tests\rules\Kernel\Engine\AutocompleteTest::testNodeAutocomplete
Failed asserting that Array &0 (
    'value' => 'node.revision_timestamp'
    'label' => 'node.revision_timestamp (Revision create time)'
) is identical to Array &0 (
    'value' => 'node.revision_timestamp'
    'label' => 'node.revision_timestamp (Revision timestamp)'
).
/modules/rules/tests/src/Kernel/Engine/AutocompleteTest.php:253
FAILURES!
Tests: 45, Assertions: 178, Failures: 1.

This is echoed on https://www.drupal.org/pift-ci-job/653385

I have not yet investigated this. If anyone knows what has changed in the autocomplete functionality between core 8.3 and 8.4 please share it here. I will do some investigations too.

Maybe on github testing we should also use core 8.4 to highlight problems earlier in the development cycle.

Comments

jonathan1055 created an issue. See original summary.

jonathan1055’s picture

OK, the expected values have changed. In 8.3 we have

[
        'value' => 'node.revision_timestamp',
        'label' => 'node.revision_timestamp (Revision timestamp)',
],

but in 8.4 this needs to be

[
        'value' => 'node.revision_timestamp',
        'label' => 'node.revision_timestamp (Revision create time)',
],

This occurs twice. Likewise 'node.revision_uid (Revision user ID)' now has to change to 'node.revision_uid (Revision user)' twice. With these alterations the tess pass cleanly at 8.4

How do we want to resolve this, given we want tests to pass at 8.3 and 8.4? Is there a recognised way to cater for this kind of change, i.e. test for the core version being run and use alternative expected data?

jonathan1055’s picture

Status: Active » Needs review
StatusFileSize
new2.28 KB

Here's a patch which solves the problem. Similar technique to what has already been used in that file.

  • fago committed e7aa0d6 on 8.x-3.x authored by jonathan1055
    Issue #2871526 by jonathan1055: AutocompleteTest fails at D8.4 but OK at...
fago’s picture

Status: Needs review » Fixed

thx, not very nice, but makes sense. Committed.

Status: Fixed » Closed (fixed)

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