Force developer to run unit test project before PR

2019-08-21 03:45发布

I am writing .Net 4.8 code and have MSTest tests in a single assembly dll. Using Azure Devops git as repository. The code in the branch should check-in only if all unit test PASS. Is it possible? I am also ok, if required, to use some script like powershell etc.. to help me enable this.

1条回答
Animai°情兽
2楼-- · 2019-08-21 04:24

you can use branch policies to force a specific build to run and succeed before PR can be merged. You have to create a build that runs those tests and configure branch policies to run that build (consult the link below to figure out how to do that exactly).

in short: go to branches, click 3 dots near branch and choose "branch policies". then configure build validation.

https://docs.microsoft.com/en-us/azure/devops/repos/git/branch-policies?view=azure-devops#build-validation

查看更多
登录 后发表回答