Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Replicate Gated check-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!

like image 748
V Lukashevych Avatar asked Jul 29 '15 20:07

V Lukashevych


1 Answers

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.

like image 99
MrHinsh - Martin Hinshelwood Avatar answered Sep 22 '22 07:09

MrHinsh - Martin Hinshelwood