Tests fails because of typo in webform_cards submodule FunctionalJavaScript folder

Created on 18 April 2024, 10 months 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

Active

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 10 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 10 months ago
  • πŸ‡¬πŸ‡§United Kingdom aaron.ferris
  • Pipeline finished with Success
    10 months ago
    Total: 2303s
    #151287
  • Pipeline finished with Skipped
    10 months ago
    #154153
  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 10.1.4 + Environment: PHP 8.2 & MySQL 8
    last update 10 months ago
    544 pass
  • First commit to issue fork.
  • Status changed to Fixed 10 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 10 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....

  • Open on Drupal.org β†’
    Core: 10.1.4 + Environment: PHP 8.2 & MySQL 8
    last update 10 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 10 months ago
  • πŸ‡¬πŸ‡§United Kingdom aaron.ferris
  • Pipeline finished with Failed
    10 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
    10 months ago
    Total: 368s
    #167738
  • Pipeline finished with Failed
    10 months ago
    Total: 387s
    #167757
  • Pipeline finished with Failed
    10 months ago
    Total: 382s
    #167764
  • Pipeline finished with Failed
    10 months ago
    Total: 390s
    #167904
  • Pipeline finished with Failed
    10 months ago
    Total: 428s
    #168697
  • Pipeline finished with Failed
    10 months ago
    Total: 438s
    #168705
  • Pipeline finished with Failed
    10 months ago
    Total: 409s
    #168772
  • Pipeline finished with Failed
    10 months ago
    Total: 392s
    #168810
  • Pipeline finished with Failed
    10 months ago
    Total: 390s
    #168821
  • Pipeline finished with Success
    10 months ago
    Total: 351s
    #168858
  • Pipeline finished with Success
    10 months ago
    Total: 383s
    #169003
  • Pipeline finished with Success
    10 months ago
    Total: 408s
    #169109
  • Pipeline finished with Success
    10 months ago
    Total: 415s
    #169112
  • Pipeline finished with Success
    10 months ago
    Total: 377s
    #169798
  • Pipeline finished with Success
    10 months ago
    Total: 1739s
    #169800
  • Pipeline finished with Success
    10 months ago
    Total: 427s
    #171947
    • 3b43d8ed committed on 6.x
      revert "Issue #3441905: PHPUnit tests fail because of typo in...
  • Status changed to Fixed 8 months 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.

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

  • Pipeline finished with Success
    7 months ago
    Total: 276s
    #244936
  • Pipeline finished with Success
    7 months ago
    Total: 218s
    #244956
  • πŸ‡³πŸ‡±Netherlands johan_vm Tilburg

    I'm running into the same issues on PHP 8.3 and Drupal 10.3

    MR 464 doesn't seem to apply for me, so I created this patch.

  • Status changed to Active 5 months ago
  • πŸ‡¨πŸ‡¦Canada Liam Morland Ontario, CA πŸ‡¨πŸ‡¦

    This change was made and then reverted. @jrockowitz was it reverted because it made rebasing other merge requests difficult?

  • πŸ‡ΊπŸ‡ΈUnited States jrockowitz Brooklyn, NY

    I think I kept running into rebase issues. I am willing to try this again via 6.3.x

  • πŸ‡¨πŸ‡¦Canada Liam Morland Ontario, CA πŸ‡¨πŸ‡¦

    Should this be considered a blocker for 6.3.x?

  • Pipeline finished with Failed
    3 months ago
    Total: 619s
    #365946
  • Pipeline finished with Canceled
    3 months ago
    Total: 174s
    #365950
  • Pipeline finished with Failed
    2 months ago
    Total: 674s
    #365953
  • Pipeline finished with Skipped
    2 months ago
    #365987
  • Pipeline finished with Failed
    2 months ago
    Total: 673s
    #366945
  • Pipeline finished with Canceled
    2 months ago
    Total: 210s
    #367007
  • Pipeline finished with Failed
    2 months ago
    Total: 831s
    #367012
  • Pipeline finished with Canceled
    2 months ago
    Total: 452s
    #367719
  • Pipeline finished with Failed
    2 months ago
    Total: 817s
    #367722
  • Pipeline finished with Success
    2 months ago
    Total: 1324s
    #367741
  • πŸ‡ΊπŸ‡ΈUnited States jrockowitz Brooklyn, NY

    I think we should try again. I am pretty sure the patch caused some expected issues.

    I am leaning toward the delete the directory, commit, recreate directory, and commit approach to be safe.

  • πŸ‡¨πŸ‡¦Canada Liam Morland Ontario, CA πŸ‡¨πŸ‡¦

    Sure. That separated approach could be put into the merge request. When the MR is merged, squashing the commits into one will have the same result.

Production build 0.71.5 2024