in functionality in Visual Studio + VSO + Git

I'm trying to replicate Gated check-in functionality in Visual Studio + VSO + Git.

Actually I'd like to run Unit Tests before code will be committed to local repo OR pushed to remote.

But faced with an issue - there is no Gated check-in functionality in VSO + GIT.

I've tried to configure git hooks - pre-commit hook will work for me - but Visual Studio GIT provider doesn't support Git hooks! Its due to the libgit2 -it is used in Visual Studio and it doesn't support hooks:(

So my question is how can I run NUnit Tests automatically before commit in Visual Studio 2013 + VSO +Git and do not allow bad code get into my repo?

Thanks!


Gated checkin, or the equivalent has already been added to VSO. If you go to the properties of your Git repo in Admin you should see an additional settings tab when you select a branch.

Check the box to enable build before merge for your MASTER branch and select the build you want to use to validate.

https://www.visualstudio.com/en-us/news/2015-may-15-vso.aspx

Developers then have to create a pull request to MASTER and pass the gate to get in.


The best way to do is perhaps to use the pull requests feature and merge only the branches where the unit tests pass. You only be able to merge these successfully building.

The other possibility is to use a script like git-build which help you to run a command (build and test) locally before pushing... See here for explaination and here for a more recent script (sorry for the french...)

链接地址: http://www.djcxy.com/p/87102.html

上一篇: 如何将字典附加到熊猫数据框?

下一篇: 在Visual Studio + VSO + Git中的功能