DEV Community

Discussion on: Test automation for Laravel 7 and MySQL with GitHub Actions

robertobutti profile image
Roberto B. Author

I see you are using MYSQL_ALLOW_EMPTY_PASSWORD.
Just to give a try , instead of MYSQL_ALLOW_EMPTY_PASSWORD , please try to use a password.
MYSQL_ROOT_PASSWORD: secret

and setting the same passoword in the env section with DB_PASSWORD: secret

Thread Thread
zaratedev profile image
Jonathan Zarate

Hello Roberto.

I'm trying to run the laravel dusk tests, but sadly I keep getting the connection refused error.
The phpunit tests with database migrations trait run successful.

Thread Thread
robertobutti profile image
Roberto B. Author

Ok, I was able to replicate your problem with your YML file.
The difference is that the phpunit is executed via command line and dusk is executed with the webserver (php artisan serve). The problem is to pass the env to the right process.
With phpunit is enough to set the env before executing the command.
With dusk , you need to set the env variables before to launch the webserver.
Try to take a look this one:
github.com/roberto-butti/laravel7-...