Problem/Motivation

The patch in #3227033-52: Remove Quick Edit from core where we deprecated Core module quickedit showed that enabling deprecated and experimental modules at the same time leads to a test failure in Drupal\Tests\system\Functional\Module\InstallUninstallTest .

Steps to reproduce

- Make a core module deprecated by adding to appropriated lifecyle parameters in its .info.yml file.
- Weep whilst looking at the test failure:

There was 1 error:

1) Drupal\Tests\system\Functional\Module\InstallUninstallTest::testInstallUninstall
Behat\Mink\Exception\ResponseTextException: The text "Are you sure you wish to enable experimental modules?" was not found anywhere in the text of the current page.

/var/www/html/vendor/behat/mink/src/WebAssert.php:785
/var/www/html/vendor/behat/mink/src/WebAssert.php:262
/var/www/html/core/tests/Drupal/Tests/WebAssert.php:898
/var/www/html/core/modules/system/tests/src/Functional/Module/InstallUninstallTest.php:234
/var/www/html/vendor/phpunit/phpunit/src/Framework/TestResult.php:726

Remaining tasks

Create MR
Review
Commit

Issue fork drupal-3259888

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

Spokje created an issue. See original summary.

spokje’s picture

Status: Needs work » Needs review
spokje’s picture

Assigned: spokje » Unassigned
spokje’s picture

Title: InstallUninstallTest fails on enabling both deprecated and expirimental modules at the sime time » InstallUninstallTest fails on enabling both deprecated and experimental modules at the sime time
spokje’s picture

Title: InstallUninstallTest fails on enabling both deprecated and experimental modules at the sime time » InstallUninstallTest fails on enabling both deprecated and experimental modules at the same time
spokje’s picture

Assigned: Unassigned » spokje
Status: Needs review » Needs work
andypost’s picture

Is it ok to use the trait in testing class?

spokje’s picture

Status: Needs work » Needs review

Is it ok to use the trait in testing class?

Surely not when it's not working as planned...

daffie’s picture

Status: Needs review » Needs work

All the code changes look, just 1 question.

spokje’s picture

Status: Needs work » Needs review

Thanks @daffie, tried to give an answer in the MR comments

daffie’s picture

Status: Needs review » Reviewed & tested by the community

The code changes to the test look good to me.
For me it is RTBC.

spokje’s picture

Thanks @daffie.

Although this is RTBC now, he got me thinking: What we're doing here is making the test very explicit (looking for very specific page text/titles for very specific cases). Since those specific cases are already handled in NonStableModulesTest we could go the other way: Making InstallUninstallTest a lot more general, so more like a catch-all "If there's a confirm page for any lifecycle warning, click the continue button".

This would make this test a bit more robust so it might handle the next "new thing" (for example another confirm screen for a specific combo of experimental/deprecated modules) instead of failing straight away when that would appear.

We won't loose any test-coverage because of each and every combo being (hopefully) handled inNonStableModulesTest.

Personally I like that approach, but since this is already RTBC and currently a blocker for deprecating Core modules in D9.4 for removing in D10, this might be for a follow-up or even just my ramblings before having enough caffeine in the morning. (My doctor ordered me to stay away from any keyboard in that case... ;)

I'll leave decisions on this idea to Bigger Brains.

Drops EUR 0.02

  • catch committed 9597a77 on 10.0.x
    Issue #3259888 by Spokje, daffie: InstallUninstallTest fails on enabling...

  • catch committed ddd02d3 on 9.4.x
    Issue #3259888 by Spokje, daffie: InstallUninstallTest fails on enabling...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Agreed with #13, the idea behind the test is 'can we do this without anything blowing up', so it'd be fine to remove the specifics.

However, also agreed that's good follow-up material.

Committed/pushed to 10.0.x and cherry-picked to 9.4.x, thanks!

spokje’s picture

Assigned: spokje » Unassigned

Status: Fixed » Closed (fixed)

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