Unable to publish test assets to a Control repository

When you attempt to publish test assets from HCL DevOps Test Hub (Test Hub) to a Control repository, the publish operation might fail with the following message: Remote rejected; pre-receive hook declined.

Cause

The branch protection rule that is configured in Control prevents Test Hub from pushing test assets directly to the main branch.

Resolution

You must publish the test assets to a new branch, and then merge the changes into the main branch through a pull request.

Perform the following steps:

  1. Create a branch in Control.

    For example, ui_test.

  2. Select the newly created Control branch from the Branch list in Test Hub.

    For example, ui_test.

  3. Create an Edit branch.

    For example, ui_test_sub. This is a local branch that you can merge into ui_test that you created.

  4. Create test assets or make changes to the existing assets.
  5. Go to Author > Changes.
  6. Select the Control branch from the Branch list.

    For example, ui_test. All the updated assets that are present in the Edit branch are displayed in the Changes page.

  7. Click Publish.

    The Publish dialog is displayed.

  8. Enter a description for the changes that you performed to the asset, and then click Publish.
  9. Create a pull request from the newly created branch to the main branch in Control.
  10. Review and merge the pull request into the main branch.