How to run tests in a Docker Compose Express/React application?

ui-test
#1

Hey guys I am working on a project with a React.js front end and a Express backend. The front end uses Jest testing and the back uses Mocha testing. The project is Dockerized. I was wondering what the best way to test a project is like this? I tried running

docker-compose up

but is said…

Too long with no output (exceeded 10m0s)

The project uses a MySQL and Redis database and I dont think I can run the container to exec into the container to run the tests so an alternative would be to create a Redis and MySQL database through CircleCI but I feel that is redundant when there is already a Docker container with the entire environment. What do you think would be the best way to go about setting up testing in production deployments?

#2

That’s exactly what I do. Provided your container can run its own tests, use docker exec.

It sounds like your docker-compose up needs debugging first though. If you need help, show us your config.yml file (in a code-formatted block please).

Agree completely - if you normally run your app in DC, run it in DC in CI as well. It is a more accurate reflection of how your app is run in live.

closed #3

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.