简体   繁体   中英

Azure Devops - MSTest - How can I fail a build if my unit tests fail, but continue (with warning/notification) when integration test fail

I have two types of tests in my solution. Unit tests which test my own application's functionality, and integration tests which test my applications interactions with external applications/services.

If my unit tests are established and have been running well for a while. Integration tests are new, and I fear that a failure in an external system could cause my tests to fail and therefore my CI/CD pipeline to halt, preventing me from deploying anything until the external service is back up. Now if my unit tests are failing, that's on me, but if integration tests fail, the assumption is that the external application/service is down. While I do want to be notified, I don't want to be prevented from letting the CI/CD pipeline build and deploy my changes.

So how would I make one set of tests "mandatory" for my build while the other set is optional, and ideally sends me a warning/notification to investigate further, but allows the CI/CD pipeline to proceed.

Separate it into two assemblies and add separate tasks for separate assemblies. and set the below option on integration test assembly.

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM