Tests at core version 9.1 have just started to fail with

Behat\Mink\Exception\ExpectationException:
Current page is "/admin/config/workflow/rules/reactions/edit/test_condition_rules_data_comparison?uuid=18a51c33-6f4d-4c51-a714-73a7f870cc82" but "/admin/config/workflow/rules/reactions/edit/test_condition_rules_data_comparison" expected.

The failing tests are ConditionsFormTest.php line 115 and ActionsFormTest.php line 115.

Tests at 8.8, 8.9 and 9.0 still pass cleanly.

Core issue #3164686: WebAssert::addressEquals() and AssertLegacyTrait::assertUrl() fail to check the querystring

Comments

TR created an issue. See original summary.

jonathan1055’s picture

Assigned: Unassigned » jonathan1055

OK I can work on this, provided you have not started on it?

tr’s picture

Nope, I'm not working on it.

jonathan1055’s picture

Title: D9.1 test fails because of core change » Query string in AddressEquals (D9.1 test failure)
Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new4.01 KB
new320.53 KB

It turns out that the solution was quite simple in the end. Using addressEquals() in core versions up to and including 9.0 just checked the actual main address part, ignoring any query string in the url. This was actually quite helpful. Anyway, in 9.1 the full url is checked, including the query string. We can create the full string because we have the ->getUuid() method in the $action and $condition. But we cannot use addressEquals() because in core version prior to 9.1 the ?uuid=... is not in the value being checked.

Therefore I changed the assertions to use addressMatches() which takes a regex, and specified a pattern which allows for the string "?uuid=.." or blank.

I needed to add a 9.1 branch to the Travis test file, to check that my changes worked. I've added a nice way to specify and display the allowed deprecations per branch (screen shot attached), because there are deprecations at 9.1. It is clean up to and including 9.0.

tr’s picture

Yeah, I thought it would be easy. This is just the start of dealing with non-BC changes in D9.1 though ... more to come I'm sure ...

We can work on deprecations as we encounter them - just post an issue with #3089502: [meta] Rules deprecated code as the parent. Priority will be to deal with things that break tests, like this.

I also opened the same issue for Flag, if you're feeling ambitious - #3168046: D9.1 test fails because of core change

  • TR committed 1dcc238 on 8.x-3.x authored by jonathan1055
    Issue #3168040 by jonathan1055: Query string in AddressEquals (D9.1 test...
tr’s picture

Status: Needs review » Fixed

Committed.

jonathan1055’s picture

Assigned: jonathan1055 » Unassigned

OK I may look at #3168046: D9.1 test fails because of core change but I also have plenty of work with Scheduler, Coder and Devel, not to mention all the great stuff here in Rules that we really need to resolve to get an alpha7 release. Currently, other contrib modules that want to use/test Rules in D9 have to use the latest dev in a test suite, which is not desirable as it is a moving target.

I will look at all those Rules issues you listed, work out what the blockages and inter-dependencies are, and try to work out what we need to do, in what order.

[edit: That's nice. My link to the Scheduler issue queue automatically filled in the number of issues]

Status: Fixed » Closed (fixed)

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