PHPUnit tests fail because of typo in webform_cards submodule FunctionalJavaScript folder

Created on 18 April 2024, 2 months ago
Updated 26 June 2024, 1 day ago

Problem/Motivation

PHPUnit tests are failing because of an uppercase "S" in the following folder web/modules/contrib/webform/modules/webform_cards/tests/src/FunctionalJavaScript.

Here is the stacktrace I get:

Fatal error: Uncaught UnexpectedValueException: RecursiveDirectoryIterator::__construct(/var/www/html/web/modules/contrib/webform/modules/webform_cards/tests/src/FunctionalJavaScript): Failed to open directory: No such file or directory in /var/www/html/web/core/tests/bootstrap.php:25
Stack trace:
#0 [internal function]: RecursiveDirectoryIterator->__construct('/var/www/html/w...', 16384)
#1 /var/www/html/web/core/tests/bootstrap.php(25): RecursiveDirectoryIterator->getChildren()
#2 [internal function]: drupal_phpunit_find_extension_directories('/var/www/html/w...')
#3 /var/www/html/web/core/tests/bootstrap.php(143): array_map('drupal_phpunit_...', Array)
#4 /var/www/html/web/core/tests/bootstrap.php(155): drupal_phpunit_populate_class_loader()
#5 Standard input code(123): require_once('/var/www/html/w...')
#6 {main}
  thrown in /var/www/html/web/core/tests/bootstrap.php on line 25

Steps to reproduce

Simply try to run some phpunit tests on you current Drupal installation.

Proposed resolution

Remove the uppercase "S" in the folder name: FunctionalJavaScript -> FunctionalJavascript.

🐛 Bug report
Status

Fixed

Version

6.2

Component

Code

Created by

🇫🇷France mably

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

Merge Requests

Comments & Activities

  • Issue created by @mably
  • 🇬🇧United Kingdom aaron.ferris

    aaron.ferris made their first commit to this issue’s fork.

  • Merge request !462Resolve #3441905 "Phpunit tests fail" → (Merged) created by aaron.ferris
  • Open in Jenkins → Open on Drupal.org →
    Core: 10.1.4 + Environment: PHP 8.2 & MySQL 8
    last update 2 months ago
    544 pass
  • 🇬🇧United Kingdom aaron.ferris

    Think I got all of these, did a quick check for any other instances of FunctionalJavaScript and couldn't see any. MR raised.

  • Status changed to Needs review 2 months ago
  • Pipeline finished with Success
    2 months ago
    Total: 2303s
    #151287
  • Pipeline finished with Skipped
    2 months ago
    #154153
  • Open in Jenkins → Open on Drupal.org →
    Core: 10.1.4 + Environment: PHP 8.2 & MySQL 8
    last update 2 months ago
    544 pass
  • First commit to issue fork.
  • Status changed to Fixed 2 months ago
  • 🇺🇸United States jrockowitz Brooklyn, NY
    • 3b43d8ed committed on 6.2.x
      revert "Issue #3441905: PHPUnit tests fail because of typo in...
  • Status changed to Needs work 2 months ago
  • 🇺🇸United States jrockowitz Brooklyn, NY

    I am stumped because committing this change causes every MR to have rebasing issues. For now, I reverted the change.

    git checkout -b '3440366-modify-formula-injection' --track webform-3440366/'3440366-modify-formula-injection'
    error: The following untracked working tree files would be overwritten by checkout:
    	modules/webform_cards/tests/src/FunctionalJavaScript/WebformCardsAjaxJavaScriptTest.php
    	modules/webform_cards/tests/src/FunctionalJavaScript/WebformCardsAutoForwardJavaScriptTest.php
    	modules/webform_cards/tests/src/FunctionalJavaScript/WebformCardsDraftJavaScriptTest.php
    	modules/webform_cards/tests/src/FunctionalJavaScript/WebformCardsProgressJavaScriptTest.php
    	modules/webform_cards/tests/src/FunctionalJavaScript/WebformCardsStatesJavaScriptTest.php
    	modules/webform_cards/tests/src/FunctionalJavaScript/WebformCardsToggleJavaScriptTest.php
    	modules/webform_cards/tests/src/FunctionalJavaScript/WebformCardsUiJavaScriptTest.php
    	modules/webform_cards/tests/src/FunctionalJavaScript/WebformCardsValidationJavaScriptTest.php
    Please move or remove them before you switch branches.
    Aborting
    
  • 🇬🇧United Kingdom aaron.ferris

    Weird, I wonder if using git mv has somehow caused that issue....

  • Merge request !464Resolve #3441905 "Phpunit tests fail mk2" → (Open) created by aaron.ferris
  • Open on Drupal.org →
    Core: 10.1.4 + Environment: PHP 8.2 & MySQL 8
    last update 2 months ago
    Waiting for branch to pass
  • 🇬🇧United Kingdom aaron.ferris

    Raised a different MR, without using git mv (manual job of deleting the folder in one commit, adding a new folder in another). Not sure if that will help?

  • Status changed to Needs review 2 months ago
  • Pipeline finished with Failed
    2 months ago
    Total: 2484s
    #154365
  • 🇨🇦Canada Liam Morland Ontario, CA 🇨🇦

    @jrockowitz You can add -f to your checkout to have it overwrite the existing files.

    @aaron.ferris I don't think git mv will be different from deleting and re-creating. It can detect based on file similarity that it's the same file.

  • 🇬🇧United Kingdom aaron.ferris

    Yeah, have to honest I was sceptical if it would've made a difference but felt it worth a shot. Thanks.

  • 🇺🇸United States jrockowitz Brooklyn, NY

    @Liam Morland, I always appreciate your git-fu

  • Pipeline finished with Failed
    about 2 months ago
    Total: 368s
    #167738
  • Pipeline finished with Failed
    about 2 months ago
    Total: 387s
    #167757
  • Pipeline finished with Failed
    about 2 months ago
    Total: 382s
    #167764
  • Pipeline finished with Failed
    about 2 months ago
    Total: 390s
    #167904
  • Pipeline finished with Failed
    about 2 months ago
    Total: 428s
    #168697
  • Pipeline finished with Failed
    about 2 months ago
    Total: 438s
    #168705
  • Pipeline finished with Failed
    about 2 months ago
    Total: 409s
    #168772
  • Pipeline finished with Failed
    about 2 months ago
    Total: 392s
    #168810
  • Pipeline finished with Failed
    about 2 months ago
    Total: 390s
    #168821
  • Pipeline finished with Success
    about 2 months ago
    Total: 351s
    #168858
  • Pipeline finished with Success
    about 2 months ago
    Total: 383s
    #169003
  • Pipeline finished with Success
    about 2 months ago
    Total: 408s
    #169109
  • Pipeline finished with Success
    about 2 months ago
    Total: 415s
    #169112
  • Pipeline finished with Success
    about 2 months ago
    Total: 377s
    #169798
  • Pipeline finished with Success
    about 2 months ago
    Total: 1739s
    #169800
  • Pipeline finished with Success
    about 2 months ago
    Total: 427s
    #171947
    • 3b43d8ed committed on 6.x
      revert "Issue #3441905: PHPUnit tests fail because of typo in...
  • Status changed to Fixed 2 days ago
  • 🇺🇸United States Luke.Leber Pennsylvania

    Just helping out with triage where possible. This seems to be definitively fixed by #20/21, no?

  • 🇨🇦Canada Liam Morland Ontario, CA 🇨🇦

    I understand changing the namespace, but why the revert commit to rename them back?

  • 🇺🇸United States Luke.Leber Pennsylvania

    It looks like the change was originally reverted on 6.2.x back on April 23, but wasn't on 6.x until June 24. Seems 6.x and 6.2.x are kept somewhat in sync.

Production build 0.69.0 2024