TTUSDC / cpceed-webapp

CPCEED Web App
https://ttusdc.github.io/cpceed-webapp/
3 stars 0 forks source link

Dockerized Test Environment #59

Closed NilsG-S closed 6 years ago

NilsG-S commented 6 years ago

I like the idea of Dockerizing our test environment. It eliminates some setup headaches. Plus, the tests will theoretically run the same no matter the development environment. As we start introducing stuff like integration tests, it'll be easy to spin up our entire system.

However, it does introduce some complexity. In particular, managing dependencies. We have two options:

  1. Standard docker container. We rebuild the image with each code change. This allows for easy caching of dependency layers. The inconvenience of running two commands can be mitigated by simply having Docker Compose automatically rebuild the image (usually a short process, given the caching).
  2. Docker container with volume. Allows for a simpler set of commands. Introduces additional complexity for dependency management. Every time a new package is added, yarn install has to be run. In a DockerForWin or DockerForMac context, this can take a long time. It should be alright to just run Yarn on the host, but it's not ideal.

Resources:

ynigoreyes commented 6 years ago

Okay, so I have a question. Unit testing should not be environment specific (besides node the node version, which we can control). We would test functions. Integration and acceptance testing would depend on the environment, but we would only (properly) test integration through Travis (we could run integration test on local just for funsies, too but eh) Thoughts?

NilsG-S commented 6 years ago

So you're proposing that we not Dockerize for unit testing?

ynigoreyes commented 6 years ago

Correct. We should not have to dockerize for unit testing for reasons above. As long as we specify our node version, we should be fine. So now we would only build when we push, and keep that off our local Dev machines.

Unit test should testing everything in isolation anyways

NilsG-S commented 6 years ago

You make a good point. I'll remove the unit testing containers before I PR.

I'd argue it's totally possible to properly integration test on a local dev machine using Docker Compose. However, that's for later.