Reputation: 8374
I am starting to learn about git-flow (http://nvie.com/posts/a-successful-git-branching-model/).
I will put a webhook and start a jenkins job to make unit/integration test.
After that Jenkins will deploy the project in production.
Which branch can I make unit / integration test and the deploy? develop or master? What is the best approach?
Upvotes: 0
Views: 746
Reputation: 23
In case of Test Driven Development (TDD) I would recommend to implement the test in the Feature/My-Feature branch. For my understanding about TDD before implementation there is the (unit-) test first approach. This implies that the unit tests should be implemented in the feature branch.
Hugo Ferreira's suggestion of the development branch might make sense if uncovered codelines shall be covered later (first code then test). In this case I would also suggest to take care of the feature branch first and then integrate into the (git-flow style) development -> feature -> main branches.
If you say my organization does not use TDD than the development branch might be an appropriate use for managing unittests.
At the end it's about organizing the sourcecode in an appropriate way. Whats appropriate is defined by the CI/CD tools that are used or the way (if not used) about how the organization can handle the sourcecode in an effeicient (cost, time, understanding of the stakeholders) way.
Upvotes: 0
Reputation: 1634
Well, deployments to production should only be done from the master
branch. That’s what that branch is there for in git flow
.
But since the master
branch only gets a commit by the time a release is made, I would suggest you setup a Jenkins job on the develop
branch to run all the test and get a more “continuous integration” feedback during the development process.
Upvotes: 0