user5539517
user5539517

Reputation:

What branch to test continuous integration?

For a new project, the version control branch structure is as follows,

* develop
* feature
* master

I am confused if I should write tests on a different branch, say a new branch test branch or just in the existing develop branch? Is it a good practice to write unit tests in feature or develop branch and integration tests in a test branch. If not where should the tests go to? what are the good and bad things about keeping a separate test branch? My develop branch will be committed and pushed frequently.

thank you for any answer.

Upvotes: 1

Views: 1064

Answers (2)

Dan Cornilescu
Dan Cornilescu

Reputation: 39814

What you're describing is not really continuous integration, it looks rather like waterfall - because of all these branches. The work in any of those branches is NOT (continuously) integrated with the work in any other branch.

Which means the impact of your testing would also be limited to the branch in which you're executing that testing. To apply it to other branches you'd need to wait for your changes to be integrated in the respective branches (or double commit, but that would add to the list of conflicts to be addressed during branch merges). And, of course, you'd need to repeat your testing in each branch for which test results are needed - since the branch context is different and results obtained in one branch aren't necessarily repeatable in another.

Sure, nothing stops you from using CI tools inside some/all of these branches, but that doesn't make it continuous integration.

In such context (in which I assume the feature branches would eventually be merged into developed and from there, when stable enough, everything would get merged into master) you'd make the biggest impact with the minimal amount of work by working in develop and maybe repeating test execution in master to verify that any other additional work done in master, if any, didn't break things.

In true continuous integration all development work is done a single/main branch, including most/all of the testing. Everyone is on the same page, no exposure to the disruptions in quality levels and the additional unquantifiable amounts of work required due to branch merges and no repeated work. Not to mention a much simpler and clearer process - you wouldn't even need to ask this question :)

Upvotes: 0

James Black
James Black

Reputation: 41858

What I have done in the past is to build from feature for QA and development for the development server.

This way you can see the latest code by the developers and when you merge in the feature changes then it can be pushed to QA.

You should always run your unit tests and integration tests on both branches, I believe.

Testing should be part of the build process.

Upvotes: 2

Related Questions