Ritu Singh
Solution
You are facing this issue because you might be accessing the postgres service using localhost/127.0.0.1.On the other hand, the hostname postgres allows access to the postgres container. To connect to the database using this hostname, your application code under test needs to be configured.
If you have DB_HOST set to postgres in your .env.ci file and your phpunit file seems to try to get this: env('TESTING_DB_HOST') ?? env('DB_HOST', '127.0.0.1') but something is wrong here because the error clearly shows 127.0.0.1 -- so it seems like your env variables aren't being set in some case.
In one job, you do the following:
Make sure to include the above line in your other assignments, including pest_tests. This is one of the reason why you are not getting the desired result.
If you want to define postgres, you can also add TESTING_DB_HOST and/or DB_HOST to the variables: section in your.gitlab-ci.yml file. As far as I can tell, if your phpunit file is being used correctly, that should resolve the issue.
Suggested blogs:
>5 easy ways to Repair the .NET Framework on Windows
>8 Steps to use Redux Persist in React Native
>Adding a search filter inside the dropdown in AngularJS?
>Adding new column/columns to the existing table in a migration-Laravel
>Authentication with Vue 3 and Firebase
>Build a minimal API using ASP.NET Core with Android Studio