Tests are not passing on Drupal 11.4 which is the current "next minor". Other tests are passing.

Issue fork webform-3550117

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

jonathan1055 created an issue. See original summary.

jonathan1055’s picture

Issue summary: View changes
Status: Active » Postponed

The 'phpunit next minor' correctly tries to run just the three tests, but we get no details due to the pre-existing problem
https://git.drupalcode.org/issue/webform-3550117/-/jobs/6764595

Therefore postponing this, as it requires #3547627: LogicException: The hook update_dependencies does not support attributes

jonathan1055’s picture

Now that MR742 on #3547627: LogicException: The hook update_dependencies does not support attributes has been merged, this work can be unpostponed. We now see the details of the three failing tests:

There were 3 failures:
1) Drupal\Tests\webform_scheduled_email\Functional\WebformScheduledEmailTest::testWebformScheduledEmail
Behat\Mink\Exception\ExpectationException: The string "Webform submission from: Test: Handler: Test scheduled email</em> sent to <em class="placeholder">simpletest@example.com</em> from <em class="placeholder">Drupal</em> [<em class="placeholder">simpletest@example.com</em>" was not found anywhere in the HTML response of the current page.

2) Drupal\Tests\webform\Functional\Element\WebformElementDateTimeTest::testDateTime
Behat\Mink\Exception\ExpectationException: The string "datetime_default: '2009-08-18T16:00:00+1000'" was not found anywhere in the HTML response of the current page.

3) Drupal\Tests\webform\Functional\WebformEntityTranslationTest::testSettingsTranslate
Behat\Mink\Exception\ExpectationException: The string "<span lang="en"><p>Submitted on [webform_submission:created]</p>
<p>Submitted by: [webform_submission:user]</p>
<p>Submitted values are:</p>
[webform_submission:values]
</span>" was not found anywhere in the HTML response of the current page.

Note that I have no knowledge of how webform works, and I am not actively fixing these tests, just preparing this issue so that they can be worked on by someone else.

liam morland’s picture

Title: Fix PHPUnit tests that fail in Core 11.3-dev » Make tests pass on "next minor", Drupal 11.4
Priority: Normal » Major
Issue summary: View changes
jonathan1055’s picture

I will rebase/fix conflicts, then see where we are.

jonathan1055’s picture

Have you considered adding a weekly scheduled pipeline?
https://git.drupalcode.org/project/webform/-/pipeline_schedules

As it stands, it's not straightforward to see the current state of the pipeline for the repo, you have to look at a MR branch, and then you don't know the effect of the changes in that MR. Having a scheduled pipeline allows new contributors (like me) who are not familiar with the workings of the project to see clearly the current results for the default branch.

liam morland’s picture

Thanks for the suggestion. I just added a weekly pipeline run.

jonathan1055’s picture

After a bit of back-and-forth investigation I worked out that only two tests WebformElementTextFormatTest and WebformSettingsArchivedTest produce "failures" at 11.4. The log is so long it's surprisingly tedious to find the actual test failures, so here they are, with links to the log.

Webform Element Text Format (Drupal\Tests\webform\Functional\Element\WebformElementTextFormat)
✘ Text format
Behat\Mink\Exception\ExpectationException: 
  The string "" was not found anywhere in the HTML response of the current page.

Here is the log for this test

Webform Settings Archived (Drupal\Tests\webform\Functional\Settings\WebformSettingsArchived)
✘ Archived
Behat\Mink\Exception\ElementNotFoundException:
  Select with id|name|label|value "webform[0][target_id]" not found.

Here's the log.

All (or at least many) of the other "errors" are of the type InvalidArgumentException: Property summary is unknown.

As a bonus, I found that one of the previously skipped tests - WebformStatesRequiredJavaScriptTest now works and passes in all variants - see log. I have no idea how long ago it was marked as skipped, but the comment implies it was back when testing on drupal.org compared to Gitlab CI.

Only the the two failing tests are run here, using the temporary @group webform_fail_at_next_minor, to reduce log size and speed up run times. So this MR is now ready for whoever wants to work on fixing the those two tests.

  • liam morland committed 18a584de on 3550117-re-enable-skipped-test
    fix: #3550117 Re-enable skipped test
    

  • liam morland committed b2a6e679 on 3550117-re-enable-skipped-test
    fix: #3550117 Re-enable skipped test
    
    Test was disabled in 175eb76; see...

liam morland’s picture

Thanks for identifying that the test now passes. I have re-enabled it.

liam morland’s picture

This message doesn't appear to make any sense: The string "" was not found. What is happening is the string which appears to be empty is actually an HTML tag. So the tag does not display when the text is output on a web page.

liam morland’s picture

idebr made their first commit to this issue’s fork.

idebr’s picture

Status: Active » Needs review

Tests are now passing on next minor

Relevant change records:
https://www.drupal.org/node/3569941 : Standard profile and recipes no longer use text_with_summary
webform_node no longer installs a body field as the field_type is different in 11.4.x (text_long vs text_with_summary)

https://www.drupal.org/node/3567879 : The long format 'filter tips' are deprecated
Assertions regarding the link 'About text formats' now only apply to <= Drupal 11.3

BC break in hal: #3585446: PHP Fatal error: FieldNormalizer::normalize must be compatible with ListNormalizer::normalize

liam morland’s picture

Status: Needs review » Needs work

Thanks very much.

If I understand correctly, the changes in TextFormat.php relate to something removed in Drupal 11.4. There should be a @todo saying that the code should be removed when versions older than 11.4 are not supported.

I would be more comfortable if the hal patch referred to a file instead of a merge request, which could change.

idebr’s picture

Status: Needs work » Needs review
  1. Added a @todo to TextFormat to indicate the code can be removed once 11.4.0 is the minimum Core version
  2. hal is now patched with a static patch file instead of the MR diff in composer (next minor)

  • liam morland committed d6e06782 on 6.3.x
    fix: #3550117 Patch `hal` for compatibility with Drupal 11.4
    

  • liam morland committed 8f3800e8 on 6.3.x
    fix: #3550117 Modify text format help only when text format has help
    

  • liam morland committed 0fffba2b on 6.3.x
    fix: #3550117 Send Boolean argument to AccessResult::allowedIf()
    

  • liam morland committed bcb43a77 on 6.3.x
    fix: #3550117 Remove filter tips assertions for Drupal 11.4+
    

  • liam morland committed 552bcd00 on 6.3.x
    fix: #3550117 Remove configuration for node:webform:body which has been...
liam morland’s picture

Status: Needs review » Fixed

Thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • liam morland committed d6e06782 on 6.x
    fix: #3550117 Patch `hal` for compatibility with Drupal 11.4
    

  • liam morland committed 8f3800e8 on 6.x
    fix: #3550117 Modify text format help only when text format has help
    

  • liam morland committed 0fffba2b on 6.x
    fix: #3550117 Send Boolean argument to AccessResult::allowedIf()
    

  • liam morland committed bcb43a77 on 6.x
    fix: #3550117 Remove filter tips assertions for Drupal 11.4+
    

  • liam morland committed 552bcd00 on 6.x
    fix: #3550117 Remove configuration for node:webform:body which has been...

Status: Fixed » Closed (fixed)

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