32423hjh32423
32423hjh32423

Reputation: 3088

Integrate Cypress tests into Azure Devops Pull Request

I have been reading the Azure Devops docs and I am completely confused by them. All I want to is something very simple (simple with Github Actions in Github anyway) where

  1. A developer creates a PR.
  2. As the PR is created Azure runs all the associated Cypress tests
  3. If any fail then the notes at the top of the PR indicate this. For example just next to the bit where it says 'there are merge conflicts'

We had this working in Github, but I can't figure it out here.

Thanks

Upvotes: 1

Views: 776

Answers (1)

Hugh Lin
Hugh Lin

Reputation: 19491

There is no extension like "Cypress GitHub app" in azure devops, so it is impossible to achieve exactly the same function as in github pull request.

As a workaround , you can try to add status policy.

Using status alone, details from an external service can be provided to users within the PR experience. Sometimes, sharing information about a PR is all that is necessary, but in other cases PRs should be blocked from merging until requirements are met. Like the in-box policies, the Status policy provides a way for external services to block PR completion until requirements are met. If the policy is required, it must pass in order to complete the pull request. If the policy is optional, it is informational only, and a status of succeeded is not required in order to complete the pull request.

External services can use the PR Status API to post detailed status to your PRs. The branch policy for external services brings the ability for those 3rd party services to participate in the PR workflow and establish policy requirements. This article guides you through the process of configuring a branch policy for a service that is posting PR status.

In addition, here is a ticket about how to create required pull request status check, you can refer to it.

Upvotes: 2

Related Questions