All phpunit testing failing

Created on 7 November 2024, 27 days ago

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 🐛 Unable to run "composer (previous major)"; no image Active which is also causing issues. Related? Has PHP changed, or some version of something?

Steps to reproduce

Run a test pipeline against a branch or release:

Proposed resolution

Unknon

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

  • unknown
🐛 Bug report
Status

Active

Version

2.1

Component

Testing

Created by

🇦🇺Australia elc

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @elc
  • Pipeline finished with Failed
    27 days ago
    #331580
  • 🇦🇺Australia elc

    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');
      }
    
  • 🇦🇺Australia elc

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

  • Pipeline finished with Failed
    27 days ago
    Total: 325s
    #331602
  • 🇦🇺Australia elc

    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.

  • Pipeline finished with Failed
    27 days ago
    Total: 180s
    #331662
  • 🇦🇺Australia elc

    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.

  • Pipeline finished with Failed
    27 days ago
    Total: 818s
    #331687
  • Merge request !402.1.x 3486022 phpunit failing → (Merged) created by elc
  • 🇦🇺Australia elc

    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 💬 Updating phpstan and twig via Composer generates a blank page when editing a node Active .

    • elc committed 93a14d11 on 2.1.x
      [#3486022] Test to check Drupal working and installing genpass.
      
  • 🇦🇺Australia elc

    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.

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

Production build 0.71.5 2024