What is the difference between a nightly build and continuous integration?

2.7k views Asked by At

What is the difference between nightly builds and continuous integration? Is it just the frequency of checkin/build/test? For example, if a nightly build process were run every hour or every minute would it be indistinguishable from CI?

This question is similar but not identical: Continuous Integration vs. Nightly Builds

2

There are 2 answers

0
Waylon Flinn On BEST ANSWER

Continuous Integration focuses on building (and running tests) every time a checkin is done. Nightly builds do it once a day and may emphasize testing less.

In practice the continuous integration checkins that trigger building and running tests might be separate from checkins that a developer does throughout the day. They might occur, for instance, only when checking in to the trunk while most development for the day is checked in to a branch. It is encouraged that these occur relatively frequently, for instance once a day.

Building more frequently would produce similar results but would probably result in some wasted effort, that is running tests when nothing has changed. Another possible difference is that a significant level of testing is done with each build in continuous integration. Sometimes requiring developer intervention to fix errors that result. This would be more difficult with a nightly build process for several reasons. Including being more difficult to tie the errors to a particular set of changes and responsible party.

0
Gerald On

It may depends on the number of tests and how long they take. If a full build and full tests takes a few minutes, you can run it in continuous integration after each push to the sources.

For my part, our nightly build is about 2 hours, building all sources, and running all tests. In daily builds, we build only some librairies and run some tests, depending on the branch and the thing that the developers are likely to modify.