Test Automation Academy
Git Branching
Model for
Automation Framework
Jatin Shharma
Jatin Shharma
Test Automation Academy
Benefit the Branching Model for Framework
4 eyes Principles
Better Knowledge Sharing
Less Conflicts
Complete Isolation of Work
Jatin Shharma
Test Automation Academy
Initial Set up the Branching Model for Framework
.git
master
Origin/master
C1 <- head
integration
Origin/integration
C1 <- head
Jatin Shharma
Test Automation Academy
Setting up Rules on Branches in Gitlab
1. Make the master and integration branches as protected
2. A protected branch is a branch which is meant for pull and not
push
3. No one is supposed to work on Protected Branches
Jatin Shharma
Test Automation Academy
Setting up Rules on Branches in Gitlab
Go the Project Settings and select Repositories and
scroll to Protected Branches
Jatin Shharma
Test Automation Academy
Setting up Rules on Branches in Gitlab
Go the Project Settings and select Repositories and
scroll to Protected Branches
Jatin Shharma
Test Automation Academy
Workflow to Write new Test Scripts
Remote Git Repo
.git
.git
integration integration
C1 C1
featureBranch1 featureBranch2
C1 C1
To create new features and test scripts every one will
Jatin Shharma
work on their feature branches
Test Automation Academy
How new Test Script will be part of Remote Integration Branch
Remote Git Repo
.git
integration
C1
featureBranch1 Origin/featureBranch1
C1
git push –u origin integration
git push –u origin featureBranch1
QAs will work on their respective feature branches and push the branch into the remote
Repository and raise a Merge Request (MR) to merge Feature branches to Integration
Jatin Shharma
Test Automation Academy
Merge Request for Feature Branches to Integration
Remote Code will be
Git Reviewed by 2nd
Repo Person
Create a Merge Request to
accept
Merge Feature Branch to Integration
C1 C1
feature integration
reject
Fix issues/ Conflicts and make code Proper and
create a new
Merge Request
Merging Feature Branches into Integration Branch is a major deal breaker in your
Project Cycle. Jatin Shharma
This is where our definition of done is achieved!
Test Automation Academy
/02
Controlling
Commit Message
Let’s start ...
Jatin Shharma
Test Automation Academy
Setting up Git Message Template
.gitMessage File helps in defining the template for all the commits from your system
Command :git config --global commit.template ~/.gitmessage
Jatin Shharma
Test Automation Academy
How Eclipse/ VSCODE Commit Window will look Now
Jatin Shharma
Test Automation Academy
Setting up Git hook to control commit Message Template
Jatin Shharma
Test Automation Academy
Git hook controls commit Message
If our team doesn't enter the commit message consist of
Subject:
Problem:
Solution:
Note:
Then this commit will not happen!
Jatin Shharma