After editing and saving a test on a branch, you can run the branched version to check your changes. This article explains how to configure tests to run on branches.
Configuring tests to run on branches
You can run branched test runs ad hoc, in a plan run, or as part of a deployment event. After you're certain that both the tests and the app under test don't have any issues, you can merge the changes into master.
Ad hoc runs
Go to the test details page for the test you’d like to run, and take the following steps:
- Select the desired branch from the branch dropdown at the top of the page.
- Click on the Run test button.
- Select Local run or Cloud run. Make any other configurations as needed.
- If you’re testing a preview environment, or any testing environment, with an arbitrary and changing URL, you can use the URL override option to specify the URL you want to use.
- Click the Start run button at the bottom. Cloud runs appear with a branching icon indicating that this run is not on the master branch.
Plan runs
To run a plan on a branch, go to the plan details page and take the following steps:
- Click the menu dropdown next to the Run button.
- Select “Configure plan run”.
- In the Configure plan run modal, choose the branch you’d like to run the plan on. You can override the testing environment URL if needed.
- Click Run now. If a plan is run on a branch, you will see it marked with a branch icon. If you hover over the icon, the name of the branch that the plan was triggered against will appear.
To learn more about how branched plan runs work, see Branches and version control.
Deployment events
Depending on how you are triggering the deployment event, you can use one of the following options to specify the branch that plans should run on:
-
mabl CLI: use the
--mabl-branchflag -
mabl API: specify the
branchin the request body - CI/CD integration: specify the respective branch flag when configuring the deployment event
Troubleshooting
My plan run skipped tests or suddenly stopped with no error
mabl plan runs execute the latest version of tests on the current branch. If the test doesn't exist on the current branch or master, the plan skips that test.
- Skipped tests - mabl skips tests that aren't saved to the current branch or master. For example, in a plan run on test-branch-1, a test that only has a saved version on test-branch-2 will be skipped, but a test that has a saved version on test-branch-2 and master will run on master.
- Stopped plan - mabl stops plan runs if none of the tests are saved on the current branch or master. For example, scheduled runs always execute on master. If none of the tests in the plan exist on master, the scheduled run will skip all tests and have a stopped status.
To ensure tests run during a plan run, ensure they are either saved to the current branch or are merged into master.