Force developer to run unit test project before PR is Raised in Azure Devops

假装没事ソ 提交于 2019-12-13 03:28:36

问题


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:


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



来源:https://stackoverflow.com/questions/55891085/force-developer-to-run-unit-test-project-before-pr-is-raised-in-azure-devops

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!