- 🇳🇿New Zealand quietone
@juampynr, thanks for the report and the patch.
I think this was fixed in #2672888: BrowserTestBase fails when the webserver runs as another user → , therefor closing as outdated.
While setting up a Jenkins job to run BrowserTests, we realized that we could not run tests with this command with the jenkins
user when using ACLs to grant write permissions but not chmod permissions:
vendor/bin/phpunit -c core --testsuite kernel --group mymodule --verbose --debug
The above command was failing due to directory permissions, here is the error message:
Exception: Warning: mkdir(): Permission denied
Drupal\Component\PhpStorage\FileStorage->createDirectory()() (Line: 165)
/var/www/myweb/drupal/core/lib/Drupal/Core/Test/HttpClientMiddleware/TestHttpClientMiddleware.php:44
/var/www/myweb/drupal/vendor/guzzlehttp/promises/src/FulfilledPromise.php:39
/var/www/myweb/drupal/vendor/guzzlehttp/promises/src/TaskQueue.php:61
/var/www/myweb/drupal/vendor/guzzlehttp/promises/src/Promise.php:246
/var/www/myweb/drupal/vendor/guzzlehttp/promises/src/Promise.php:223
/var/www/myweb/drupal/vendor/guzzlehttp/promises/src/Promise.php:266
/var/www/myweb/drupal/vendor/guzzlehttp/promises/src/Promise.php:225
/var/www/myweb/drupal/vendor/guzzlehttp/promises/src/Promise.php:62
/var/www/myweb/drupal/vendor/guzzlehttp/guzzle/src/Client.php:129
/var/www/myweb/drupal/vendor/fabpot/goutte/Goutte/Client.php:138
/var/www/myweb/drupal/vendor/symfony/browser-kit/Client.php:315
/var/www/myweb/drupal/vendor/behat/mink-browserkit-driver/src/BrowserKitDriver.php:144
/var/www/myweb/drupal/vendor/behat/mink/src/Session.php:143
/var/www/myweb/drupal/core/tests/Drupal/Tests/BrowserTestBase.php:330
/var/www/myweb/drupal/core/tests/Drupal/Tests/BrowserTestBase.php:433
/var/lib/jenkins/workspace/myJob/mymodule/tests/src/Functional/Mytest.php:56
It is a bad practice to allow the jenkins
user to sudo into www-data
in order to run tests and overcome the above warnings. We needed a way to run this command from the jenkins user and, as long as the sites/simpletest
directory had the correct ownership (jenkins:www-data
), then we should not get these kind of errors.
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
@juampynr, thanks for the report and the patch.
I think this was fixed in #2672888: BrowserTestBase fails when the webserver runs as another user → , therefor closing as outdated.