|
|
|
|
|
by happymellon
932 days ago
|
|
> However, I think it's less common to run automated testing within the same Docker image you build and deploy to these environments. When you say "automated tests" do you mean unit or integration tests, or both? Because unit should generally be in your compilation process, not part of any image, and integration shouldn't require anything different in the image compared to any other environment. Build it, which includes unit tests, and then deploy and integration tests should be run against your stable API. |
|
I think normally this isn't much of an issue because other automated/manual integration testing in the staging environments will catch any major problems, to your point.
Another example would be for browser testing via chromedriver. I've usually seen this implemented along side unit tests (i.e., prior to the build phase) but since it generally serves as an integration level test for many applications, this has lead to issues due to the testing and production environments being out of sync.
I think multi-layer Docker images are a compelling solution to this, but it's not usually how I've seen it implemented.
Instead, I've typically seen that test and prod environments are manually maintained. Sometimes these are two separate Dockerfiles or some shared CI environment managed by different teams.