High-velocity DevOps teams rely on branches and version control to safely and effectively collaborate across products, projects, and teams. In mabl, you can create new versions of tests and flows on branches to make isolated changes to tests and flows without impacting the core testing suite or interfering with each other’s work.
For those that are familiar with branching using git, it is important to note that branching in mabl works differently and is centered around managing versions of tests and flows.
How branching works
In mabl, branching is designed to allow working with different versions of specific tests and flows. When you create a branch, only versions of tests and flows that are saved to a branch live on that branch. To explicitly add a test or flow to an existing branch, save a new version on the branch.
Version control
As you create and edit tests and flows, mabl tracks changes through version numbers. Branched tests and flows in mabl don’t have independent version histories. Every change to a test or flow increments the version globally, regardless of the branch.
Exception
Test and flow metadata, such as the name, description, and labels, are not version controlled. Updating this information affects all versions of the test.
You can review the version history for a test or flow by clicking on the Change history tab. The version dropdown stores saved versions of a test or flow in sequence from either the master branch or a development branch.
In the following example, version 8 is the most recent version saved on the test1234 branch. If the next edit to this test occurs on the test1234 branch, it will become version 12. The version dropdown only indicates the most recent version saved to a branch. It does not track branching for earlier versions.
Viewing version history for a branched test
Deleting tests and flows
If you delete a test or flow, it will be deleted across all branches. You can restore an accidentally deleted test or flow within 30 days of deletion from the Activity feed: Settings > Activity feed.
Disabling a test or flow also applies across all branches. There is no way to disable a test on one branch while keeping it active on others.
Test and plan execution
If you run a test without specifying the branch, mabl executes the latest version of the tests and flows on master.
When you run a test on a branch, mabl executes the latest version of the test or flow on that branch. If a test or flow is not on the branch, the latest version of the test or flow on the master branch is executed.
A plan run targets a single branch. For each test that is in the plan, mabl runs the latest version that is saved to that branch, or falls back to the latest version on master if the test isn't saved to the branch. As a result:
- Tests that aren't saved to the target branch or master are skipped.
- If none of the tests in the plan are saved to the target branch or master, the plan run has a stopped status.
- Scheduled plan runs always run on master and can't target a branch. To run a branched plan on a recurring basis, use your team's CI/CD tool to trigger mabl deployment events on a schedule.
For help diagnosing stopped or skipped branch runs, see Running tests on branches.
Merging changes
When merging a mabl branch into master, you can resolve step and variable conflicts ahead of time to avoid unintentionally overwriting changes that have been made on master since the mabl branch was first created.
Branching limitations
- Reusable snippets do not adhere to branching. Updating a snippet on one branch updates the snippet across all branches where that snippet is used. To manage a snippet on a branch, save it as a one-time snippet and put it in a reusable flow.
- There is no support for branching visual tests.
- API tests do not support conflict resolution.
- In the mabl Desktop App, you can only merge branches into master. After saving a test to a branch, you cannot pull in any subsequent updates from master to the test branch.
- In the mabl CLI, you can merge any branch into another branch, but there is no merge conflict resolution.
Learn more
To learn more about branching, check out the following articles: