Comments (11)
Ended up resolving this by calling phpunit with the web user
from drupal9ci.
Managed to get it working, by starting apache before running the phpunit command.
I know have another issue, which is permission denied:
Exception: User warning: mkdir(): Permission Denied
Drupal\Component\PhpStorage\FileStorage->createDirectory()() (Line: 174)
from drupal9ci.
Hi @acha5066,
What CI tool are you using? Travis or CircleCI? Can you paste screenshots or describe further details about your setup and the error?
from drupal9ci.
Hi @juampynr ,
I'm also facing issues running Drupal PHPUnit Functional tests.
However, the only thing I see on CircleCI is:
"Too long with no output (exceeded 10m0s)"
The tests work fine locally, but it is using a different endpoint. For these I am just using the default (modified for 8.5) phpunit.xml that comes with the installer.
Any thoughts on what might be wrong?
Thanks!
from drupal9ci.
Actually I just tried a different test (Metatag module) and the error is the same as above:
For example:
GuzzleHttp\Exception\ConnectException: cURL error 7: Failed to connect to localhost port 80: Connection refused (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)
/var/www/html/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:185
/var/www/html/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:149
/var/www/html/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:102
/var/www/html/vendor/guzzlehttp/guzzle/src/Handler/CurlHandler.php:43
/var/www/html/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php:28
/var/www/html/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php:51
/var/www/html/web/core/tests/Drupal/Tests/BrowserTestBase.php:326
/var/www/html/web/core/lib/Drupal/Core/Test/HttpClientMiddleware/TestHttpClientMiddleware.php:31
/var/www/html/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php:37
/var/www/html/vendor/guzzlehttp/guzzle/src/Middleware.php:36
/var/www/html/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php:54
/var/www/html/vendor/guzzlehttp/guzzle/src/Middleware.php:60
/var/www/html/vendor/guzzlehttp/guzzle/src/HandlerStack.php:67
/var/www/html/vendor/guzzlehttp/guzzle/src/Client.php:277
/var/www/html/vendor/guzzlehttp/guzzle/src/Client.php:125
/var/www/html/vendor/guzzlehttp/guzzle/src/Client.php:131
/var/www/html/vendor/fabpot/goutte/Goutte/Client.php:180
/var/www/html/vendor/symfony/browser-kit/Client.php:351
/var/www/html/vendor/behat/mink-browserkit-driver/src/BrowserKitDriver.php:144
/var/www/html/vendor/behat/mink/src/Session.php:148
/var/www/html/web/core/tests/Drupal/Tests/BrowserTestBase.php:266
/var/www/html/web/core/tests/Drupal/Tests/BrowserTestBase.php:246
/var/www/html/web/core/tests/Drupal/Tests/BrowserTestBase.php:391
/var/www/html/web/modules/contrib/metatag/tests/src/Functional/DefaultTags.php:43```
from drupal9ci.
Hi. I am having the same problem as the original poster.
Getting the error Failed to connect to localhost port 80 when running functional tests.
Has anyone else found a solution or hit this issue?
Base URL is set in phpunit.xml as
<env name="SIMPLETEST_BASE_URL" value="http://localhost"/>
This is running in Circle CI.
from drupal9ci.
Hi @JakeMilburn! Can you open a new issue with the above details plus anything else that may help to pinpoint the reason of the error?
Thanks!
from drupal9ci.
@JakeMilburn I found that the jobServeDrupal job wasn't being called from either another method in RoboFile.php or .gitlab-ci as per the default configuration so have added:
before_script:
- vendor/bin/robo job:serve-drupal
to drupal9ci:unit_kernel_tests and drupal9ci:code_coverage in .gitlab-ci and now it works. I am getting a different error now but I've made some progress.
from drupal9ci.
Thanks for the update @welly ! Let us know if you need help with the different error that you mentioned.
from drupal9ci.
One of the problems I found was I was getting mkdir() permission denied errors when running functional tests and code coverage reports. I forget where I found a suggested solution for the issue but in runUnitTests() by running it through sudo. I suspect the apache environment variables are redundant though.
$tasks[] = $this->taskExecStack()
->exec('chmod -R 777 ../web/sites')
->envVars(['XDEBUG_MODE' => 'coverage', 'APACHE_RUN_USER' => 'root', 'APACHE_RUN_GROUP' => 'root'] + getenv())
->dir('web')
->exec('sudo -u root -E sudo -u www-data ../vendor/bin/phpunit -c core --verbose modules/custom');
seemed to fix it. I'm not sure if it's the perfect/ideal fix but it does seem to work. I had to do something similar for runCoverageReport() as well.
from drupal9ci.
I think that's fine, this is an isolated environment that runs temporarily.
from drupal9ci.
Related Issues (20)
- Annotations for code-standards HOT 2
- Changes to upstream image causes CircleCI to break HOT 1
- Is this still supported? HOT 5
- Run Travis CI in a Drupal Docker project HOT 3
- Clarify instructions in scripts/databases HOT 8
- Cannot touch 'storage/testing.sqlite': No such file or directory HOT 1
- Errors saving and restoring cache HOT 8
- Drupal Test Traits configured for Github Actions config, but not other CI configs HOT 9
- Drupal 9 compatibility HOT 4
- Replace Behat tests by Cypress.io ones HOT 4
- Create Composer 2 version for both Dockerfile and Dockerfile9 HOT 6
- "Failed to connect to localhost port 80: Connection refused" HOT 1
- DocumentRoot directory doesn't exist HOT 12
- jq not available by default in drupal8ci:latest image
- Include intl extension for PHP
- Update underlying docker image or use third party one HOT 8
- Interactive command line interface HOT 2
- Remove CircleCI test
- Config validation in CI
- Rename project and references from drupal9ci to drupalci HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from drupal9ci.