Adding Cypress container to run e2e tests#334
Conversation
beekley
left a comment
There was a problem hiding this comment.
Good work putting this together. I left a few small comments/questions. Something that might be good for a future PR is to set docker up for general dev use, not just for testing (e.g. by adding nodemon and updating the readme).
I had worked on dockerizing this too in #335 😆.
| # note: inside e2e container, the network allows accessing | ||
| # "web" host under name "web" | ||
| # so "curl http://web" would return whatever the webserver | ||
| # in the "web" container is cooking |
There was a problem hiding this comment.
nit: Should this be "webapp"?
| ports: | ||
| - "8080:8080" | ||
| env_file: | ||
| - webapp.env |
There was a problem hiding this comment.
I think the mongo container's setup points to .env. Do both containers use the same file?
| "test": "echo \"Error: no test specified\" && exit 1" | ||
| }, | ||
| "keywords": [], | ||
| "author": "Gleb Bahmutov <gleb.bahmutov@gmail.com> (https://glebbahmutov.com/)", |
| COPY . . | ||
|
|
||
| EXPOSE 8080 | ||
| CMD [ "npm", "start" ] No newline at end of file |
There was a problem hiding this comment.
Could we use nodemon here? npm start might require us to restart the container every time the code changes.
| version: '2' | ||
|
|
||
| services: | ||
| webapp: |
There was a problem hiding this comment.
It might be good to add a depends_on mongo so we can turn all containers up together.
beekley
left a comment
There was a problem hiding this comment.
I’m going to merge this since it shouldn’t affect anything dev/prod use of the app. Then I'll work on the feedback from the comments in a new PR.
resolves #325
addresses #
Motivation and context
Adding a dockerized test harness for cypress
Screenshots
What I did