Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHPUnit tests cannot be run locally using lando #3546

Closed
bberndt-uaz opened this issue Jul 15, 2024 · 0 comments · Fixed by #3547
Closed

PHPUnit tests cannot be run locally using lando #3546

bberndt-uaz opened this issue Jul 15, 2024 · 0 comments · Fixed by #3547
Assignees
Labels
2.11.x only bug Something isn't working ci Continuous integration / automation

Comments

@bberndt-uaz
Copy link
Contributor

Problem/Motivation

When trying to run PHPUnit testing with lando on a new local Quickstart build as indicated in the How to contribute document, the command results in fatal errors and the tests are not completed.

Describe the bug

When running the lando phpunit or lando phpunit-fastest commands, the XML configuration file (phpunit.xml.dist) cannot be located, resulting in multiple errors like the one below:

1) Drupal\Tests\az_cas\Functional\AzCasAdminSettingsTest::testUserLoginFormBehavior with data set #0 (false)
PHPUnit\Framework\Exception: PHP Fatal error:  Uncaught PHPUnit\Util\Xml\Exception: Could not read "web/profiles/custom/az_quickstart/phpunit.xml.dist". in /app/vendor/phpunit/phpunit/src/Util/Xml/Loader.php:38
Stack trace:
#0 /app/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Loader.php(72): PHPUnit\Util\Xml\Loader->loadFile('web/profiles/cu...', false, true, true)
#1 Standard input code(101): PHPUnit\TextUI\XmlConfiguration\Loader->load('web/profiles/cu...')
#2 {main}

Next PHPUnit\TextUI\XmlConfiguration\Exception: Could not read "web/profiles/custom/az_quickstart/phpunit.xml.dist". in /app/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Loader.php:74
Stack trace:
#0 Standard input code(101): PHPUnit\TextUI\XmlConfiguration\Loader->load('web/profiles/cu...')
#1 {main}
  thrown in /app/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Loader.php on line 74
Fatal error: Uncaught PHPUnit\Util\Xml\Exception: Could not read "web/profiles/custom/az_quickstart/phpunit.xml.dist". in /app/vendor/phpunit/phpunit/src/Util/Xml/Loader.php:38
Stack trace:
#0 /app/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Loader.php(72): PHPUnit\Util\Xml\Loader->loadFile('web/profiles/cu...', false, true, true)
#1 Standard input code(101): PHPUnit\TextUI\XmlConfiguration\Loader->load('web/profiles/cu...')
#2 {main}

Next PHPUnit\TextUI\XmlConfiguration\Exception: Could not read "web/profiles/custom/az_quickstart/phpunit.xml.dist". in /app/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Loader.php:74
Stack trace:
#0 Standard input code(101): PHPUnit\TextUI\XmlConfiguration\Loader->load('web/profiles/cu...')
#1 {main}
  thrown in /app/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Loader.php on line 74

/app/vendor/phpunit/phpunit/src/Framework/TestSuite.php:685
/app/vendor/phpunit/phpunit/src/Framework/TestSuite.php:685
/app/vendor/phpunit/phpunit/src/Framework/TestSuite.php:685
/app/vendor/phpunit/phpunit/src/TextUI/TestRunner.php:651
/app/vendor/phpunit/phpunit/src/TextUI/Command.php:146
/app/vendor/phpunit/phpunit/src/TextUI/Command.php:99

To Reproduce

Steps to reproduce the behavior:

  1. Clone a local copy of Quickstart
  2. Run lando start
  3. Run lando phpunit or lando phpunit-fastest
  4. Observe the fatal errors

Proposed resolution

Update references to the phpunit.xml.dist file path in .lando.yml so that the PHPUnit testing can run successfully.
 

Expected behavior

PHPUnit testing should run as indicated in our CONTRIBUTING.md document.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.11.x only bug Something isn't working ci Continuous integration / automation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant