0

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.

3
  • 3
    Split integration tests into a separate assembly. That's a good practice in general anyway. Commented Feb 11, 2020 at 21:04
  • I agree with @DanielMann . Then, once you have your two separate assemblies, run them in different steps or jobs in your Pipeline. You can use conditions to continue the Pipeline if the integration tests fail, but allow the unit tests to fail the entire Pipeline. Commented Feb 13, 2020 at 15:07
  • @TxRegex Not get your latest information, I think the above workaround is feasible. Or if you have any concern, feel free to share it here. Commented Feb 17, 2020 at 2:13

1 Answer 1

2

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

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.