Git workflow using Moropo API

Moropo supports the basic usage of a git workflow, which at its basic level breaks down into the below stages;

All git platforms are different, but all adhere to this basic workflow. Moropo can be used to complement this workflow using CI workflows to ensure that changes are tested when a PR is raised, and results fed back.

The below sections will go through Moropo's suggested implementation of the git workflow using the Moropo platform. However, we realise every organisation is different and needs can be complex. If you feel that the workflow isn't quite right for you, let us know and we will help work out a solution.

Assumptions

Before continuing it is worth stating the assumptions made by us in this guide

  1. You are using git

  2. You are using a CI system which has access to your git repository

  3. You wish to version control your tests in your git repository

  4. Test editing can be done either locally or on the Moropo platform

Create Branch

When creating a branch in your git platform, CI can be configured to replicate this branch in Moropo by;

  1. Creating a branch using the Branches endpoint

  2. Uploading any tests required to the branch using the Testsendpoint.

By default, branches are initialised in an empty state. If you wish to create a copy of an existing branch, download and then upload tests between the source and target branches.

Make Changes

Changes to tests can be made locally on git, or on the Moropo platform. We don't prescribe how you write your tests.

Create a Pull Request

As part of CI pipeline logic for creating a PR, we suggest that tests are synced between git & Moropo before any test runs are triggered. We would therefore suggest

  1. Either uploading or downloading tests from/to Moropo using the Tests endpoint to ensure the two systems are in sync.

  2. Uploading any builds once built by the CI pipeline using the Builds endpoint

  3. Triggering tests against the required branch using the Test Runs, ensuring the buildId for the uploaded is build is passed to the action.

  4. Polling the Test Runs endpoint for the status of the test to set the CI check statuses.

Address Review Comments

If any comments required changes to code, or to the tests, we would expect the actions in Create a Pull Request to be ran again.

Merge Pull Request

In order to make sure the Moropo target branch is up to date with the changes, tests must be uploaded to the target branch using the Tests endpoint to ensure the tests in the Moropo UI are kept up to date with git.

Delete Branch

Once the git workflow is complete, the branch can be deleted in Moropo by calling the Branches endpoint.

Last updated