Git Flow: should develop branch be unit tested in CI

continuous integrationgit

We have a Git Flow type workflow (in rails) where our 'testing' (aka develop) branch has feature branches merged into it for UAT.

So:

  • master has the current running production system.
  • feature branches have a single feature (against a pull request)
  • testing has a number of features that are in the development cycle

Currently we have CI (in travis) turned on for all feature branches, testing and master.

Should we run the (slow) unit test suite on testing, given that all code in it will have been tested at feature level (as master + feature branch)?
The only things I can think of that could lead to testing failing and the feature branch not are:

  • a mismerge
  • a test stability issue
  • a functional incompatibility between branches

(I'd note that we only release one feature at a time, so the latter will resolve itself for master to pass).

Best Answer

Unless you think you can't spare the electricity, or the unit tests take an inordinate amount of time (measured in days), I see no reason why you wouldn't go ahead and run the tests on the feature branch first.

The whole point of a CI server is to run those tests so that you don't have to. It's the cheapest form of insurance available to you. Wouldn't it be nice to find out that a problem has crept into your feature branch before you merge into master?

Oh? The odds of finding something at that level are small? How much did you say that electricity costs you again?

Related Topic