In TeamCity one can setup the build to fail on a metric change and on of the available metrics is number of warnings or number of tests, and more - I'm looking for similar functionality in Visual Studio Team Services.
Is it possible to fail a build if number of tests decreases or number of warnings increases?
EDIT: This is a first step in the direction for a long term goal to achieve TreatWarningsAsErrors (with few selected pragmas around obsolete code).
I'm not sure about number of tests but there is at least one build task in the marketplace that will let you fail a build if the code coverage falls below a certain level. Check out Colin's ALM Corner Build and Release Tools.
While I don't know of a custom build task that watches the trend of passing/failing tests and let's you fail a build based on deltas, it's likely that one could be created.