Problem/Motivation

phpunit testing has suddenly started failing, without the code having been changed, or even the code against which it is testing being changed.

See also #3486021: Unable to run "composer (previous major)" from pipeline UI; no image which is also causing issues. Related? Has PHP changed, or some version of something?

NB: Cannot be reproduced locally, only on gitlabci testing

Steps to reproduce

Run a test pipeline against a branch or release:

Proposed resolution

Caused by #3485956: Recursion limit exceeded with Twig v3.14.1 when editing a node or a block.

Remaining tasks

  • ✅ File an issue
  • ✅ Figure out what is wrong
  • ✅ Addition/Change/Update/Fix
  • ✅ Testing to ensure no regression

User interface changes

  • unknown

API changes

  • unknown

Data model changes

  • unknown

Release notes snippet

  • #3486022: Test to check Drupal working and installing genpass.

Issue fork genpass-3486022

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

elc created an issue. See original summary.

elc’s picture

Status: Active » Needs work

Without Generate Password event installed, testing is unable to access admin/config/people/accounts in current or next minor.

From the new NotInstalledTest.php =>

  /**
   * Check to see that Drupal core is working, then install genpass.
   */
  public function testDrupalWorkingWithoutAndWith(): void {
    // Check that Drupal is working before installing Generate Password.
    // THIS IS WHAT FAILS! UNABLE TO ACCESS THIS PAGE?
    $this->drupalGet('admin/config/people/accounts');
    $this->assertSession()->statusCodeEquals(200);

    // Install Generate Password.
    $this->assertTrue(
      \Drupal::service('module_installer')
        ->install(['genpass']),
      'Failed to install Generate Password module.'
    );

    // Check that the same page is still accessible.
    $this->drupalGet('admin/config/people/accounts');
    $this->assertSession()->statusCodeEquals(200);

    // Check all of the form changes.
    $this->assertSession()->pageTextContains('Account settings');
    $this->assertSession()->pageTextContains('Generate Password - User Account Registration');
    $this->assertSession()->pageTextContains('User password entry');
    $this->assertSession()->pageTextContains('Admin password entry');
    $this->assertSession()->pageTextContains('Generated password length');
    $this->assertSession()->pageTextContains('Generated password display');
  }
elc’s picture

Issue summary: View changes

All tests work perfectly locally so this is only on the testing infrastructure that things are broken.

elc’s picture

The act of logging into drupal as an administrator with ['administer account settings', 'administer users'] and accessing $this->drupalGet('admin/config/people/accounts'); is causing a 500 error. This should be without genpass installed unless I am mistaken about the $this->modules array, from which I have removed genpass. Should check on that.

elc’s picture

Added to the test; genpass is not installed at the start, and drupal core is still giving 500 error on admin/config/people/accounts, NOT on admin.

elc’s picture

Status: Needs work » Postponed

Forcing twig to 3.14.0 fixes it here, and all the live sites I just dutifully updated just today.

Fix will be done in #3485956: Recursion limit exceeded with Twig v3.14.1 when editing a node or a block.

  • elc committed 93a14d11 on 2.1.x
    [#3486022] Test to check Drupal working and installing genpass.
    
elc’s picture

Title: All phpunit testing failing » Add test to check drupal working before installing genpass
Issue summary: View changes
Status: Postponed » Fixed

Change of title to reflect the actual change as a result of this isssue; to avoid going down the rabbit hole of suspecting something wrong with the module, make sure that Drupal works before genpass is installed.

Status: Fixed » Closed (fixed)

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