Search code examples
reactjscontinuous-integrationautomated-testscontinuous-deploymentplaywright

For CI/CD (Github Actions) end to end tests, should you have a whole docker-compose setup (including database migrations)?


I'm trying to ask what is the best practice for automatic (ci/cd) end to end tests in web apps?

To be honest, I'm not sure what is the best approach for CI/CD end to end tests with playwright, node/express backend, mongodb, and react frontend. I have an app that can be deployed with docker-compose but when it's deployed the empty database is automatically populated through migrations but can take up to 30 minutes (large amounts of data). Should I be doing the same thing in Github Actions and deploy the whole app with the database migration?


Solution

  • It depends on the type of app you have and what you want to test with e2e.

    Maybe it is worth deploying the front end only and tests. Or the back end and front end connected to the external staging database. Or deploy everything with DB migration if your data for testing should be unique. Or deploying DB snapshot, not whole DB migration.