The Rules daily tests all still pass at 8.5 but fail at 8.6 and 8.7. We've had 2 test fails daily from 21 March 2018 up to 13 July. Then we've had 8 test fails daily since then. The fails are:
Drupal\Tests\rules\Functional\UiPageTest
has error:
Drupal\Tests\rules\Functional\UiPageTest::testReactionRulePage
Behat\Mink\Exception\ResponseTextException: The text "There is no Reaction Rule yet." was not found anywhere in the text of the current page
and
Drupal\Tests\rules\Kernel\Engine\MetadataAssertionTest
Drupal\Tests\rules\Kernel\Engine\AutocompleteTest
Drupal\Tests\rules\Kernel\RulesEngineTest
all have error:
Argument 1 passed to Drupal\Core\Plugin\Context\EntityContext::fromEntity() must implement interface Drupal\Core\Entity\EntityInterface, null given, called in /var/www/html/core/modules/user/src/ContextProvider/CurrentUserContext.php on line 58
I suspect that the 'no text' error was originally the cause of the 2 fails. and then the EntityInterface problem is the next 6 fails.
[edit] This issue now covers the text string problem only.
See
#2989417: Argument 1 passed to \EntityContext::fromEntity() must implement EntityInterface for the EntityInterface errors.
Comments
Comment #2
tr commentedThanks for opening the issue.
The first two are due to a core change made in #2942588: EntityListBuilder::render() should use the entity type plural label in the empty text
As is typical with core development these days, no change record was created for this modification, therefore leaving contributed module maintainers to experience the test failures and figure out for themselves what was changed in core.
Let's see if this fixes it.
Of course, now we will be faced with the issue that it won't work in 8.5.x anymore ...
Comment #3
tr commentedThat seems to have worked ... Filing a follow-up issue in core because making this sort of change without a change record is very disruptive to the contributed module ecosystem: #2989254: String changes should get change records
However, I expect that my concerns will be dismissed, as core developers have consistently shown that they don't much care about how their deviations from the documented community process (e.g. requiring change records) affect contributed module developers.
Comment #4
tr commentedThe remaining 6 fails are due to the core change made in #2932462: Add EntityContextDefinition for the 80% use case
I don't have a fix for that yet.
Comment #6
tr commentedI just ran the 8.5.x tests to verify what I said in #3: The patch in #2 fixes the 2 test fails going forward in 8.6.x and 8.7.x, but it adds two new fails to 8.5.x.
I don't know how this core policy of bc breaks between minor core versions is supposed to work with contrib - are we supposed to make a new release every time there's a bc break? Or add a core version dependency into our modules (but then, we didn't know for the last release that 8.6.x would introduce a bc break, so we couldn't have known to add a dependency of core < 8.6.x at that time...). Or perhaps we just wait until 8.6.0 is released then publish a new alpha release - still there's no way for us to specify that alpha4 requires 8.5.x while alpha5 requires 8.6.x ... so how is a user supposed to know what all the dependencies are when they try to install or upgrade?
Comment #7
jonathan1055 commentedOK, I have created #2989417: Argument 1 passed to \EntityContext::fromEntity() must implement EntityInterface to cover the other fails, so this issue can remain concentrated on the text strings.
Comment #8
tr commentedHere's a new patch for the string change, using the nasty ugly hack that we've used previously in other tests. Hopefully this ensures that 8.5.x tests continue to run while also fixing 8.6.x and 8.7.x tests.
Comment #10
tr commentedOK, I don't like that patch, but I committed it so that our tests would continue to run green in 8.5.x and so that we can eliminate those two string errors in our 8.6.x and 8.7.x tests.
There's a @todo that should help us to find and remove this hack when 8.5.x becomes unsupported.
Comment #11
jonathan1055 commentedThanks for fixing this. Yes the new code looks a bit clumsy, but you have explained it very well, and we have used this method before. We need to have tests passing so that we can detect new failures, so this is a step forward.
Just a minor thing, you could also add
@see https://www.drupal.org/project/rules/issues/2989050so that all the background info we have in this issue is easily findable by any person reading the @todo.
Comment #12
tr commentedGood idea.
Comment #14
jonathan1055 commentedThanks for adding that.
I have changed the issue title to be specific, to help us when searching later.
Comment #16
tr commentedThe commit in #13 was NOT the patch in #12 that I intended to commit.
I reverted #13, and am now committing the patch shown in #12.
Comment #18
jonathan1055 commentedThanks for noticing that. I checked your patch and very often I do check that a commit matches a patch. But for some reason I did not do that this time.
Comment #20
tr commentedFollow up patch to remove the @todo now that Drupal 8.5.x is unsupported, as mentioned in #10.
Comment #21
tr commentedNR so the patch can be tested.
Comment #23
tr commentedCommitted #20.
Comment #24
tr commentedComment #25
jodavidson commentedNote that version 8.x-3.0-alpha4 that I downloaded on 22 July 2019 still has this issue.
When running the test UiPageTest::testReactionRulePage I received the error
1) Drupal\Tests\rules\Functional\UiPageTest::testReactionRulePage
Behat\Mink\Exception\ResponseTextException: The text "There is no Reaction Rule yet." was not found anywhere in the text of the current page.
Updating the text of line 40 in UiPageTest.php to:
$this->assertSession()->pageTextContains('There are no reaction rules yet.');fixes the issue.
Comment #26
jonathan1055 commentedHI jodavidson,
Yes you are correct. This is because Alpha4 was released on 18 May 2018 (as shown on project front page) but this issue was started after that, on 30 July 2018 (as shown at the top of page) and the first commit was done in #9 above on 1st Aug 2018.
So, yes, Alpha4 still has the fault, but the latest dev release is fixed.