Hace poco me encontré con un error bastante común (pero frustrante) al ejecutar tests de PHPUnit en GitHub Actions usando Laravel. Localmente todo funcionaba perfecto, pero en CI los tests fallaban inmediatamente con un error de conexión a la base de datos.
El problema
Al ejecutar los tests en GitHub Actions, aparecía el siguiente error:
Illuminate\Database\QueryException: SQLSTATE[08006] [7] connection to server at "127.0.0.1", port 5432 failed: Connection refused
Is the server running on that host and accepting TCP/IP connections?
Esto ocurría al intentar correr un test básico:
Tests\Feature\Auth\AuthenticationTest::test_login_screen_can_be_rendered








