Search code examples
deploymentcontinuous-integrationagilecontinuous-delivery

Is deployment to a test environment a part of Continuous Integration?


I have checked quite a lot of sources and it still remains unclear to me: is deployment to a test environment part of CI, or is CI just about committing often and keeping the mainline bug-free and integrated? Some say this, some say deployment to a target environment is a part of CI.

Otherwise I do not seem to see the difference between CI and Continous Delivery.


Solution

  • Continuous integration might or might not require something you'd consider a deployment to a test environment. The main point of CI is that automated tests are run on a version of the software to ensure that that version i's ready to be deployed to the next step (QA, staging, production, or whatever the next step in one's process is). So the software is deployed if that's needed for the software to be tested and not if it's not.

    There's always a test environment of some kind, because the automated tests have to run on some computer(s), but the code might or might not get there through what you'd consider a deployment. For example, if an application is in an interpreted language, running automated tests might require nothing more than copying the source to the test environment and running a script, not actually deploying.

    Whether deployment is needed for automated testing depends on what kind of automated tests the application has. If it only has unit tests, no deployment is needed. If it has full-stack integration tests, deployment might or might not be needed depending on the integration test framework. For example, the integration testing framework which is a part of Rails runs a test-specific version of a Rails server for tests to talk to, so those test don't require deployment. On the other hand, other frameworks might not provide that support, so the application would have to be deployed to the test environment to give full-stack integration tests something to run against. Or a CI build might include automated performance tests; those would certainly need to run against the application deployed to a test environment.