I would like to specify some long-running c# project xUnit tests to only run in azure devops CI pipeline, but not when a click 'Run All' in Visual Studio locally (vs2019). Is there a 'best practice' for this kind of behaviour?
I played around with making a test playlist and running that locally instead of Run All
, but that would require updating the list (or lists) everytime i add new tests and this is error-prone.
AzureDevOps defines some environment variables. I would use TF_BUILD
in conjunction with Ruben Bartelinks answer.
Set to True if the script is being run by a build task.
This variable is agent-scoped. It can be used as an environment variable in a script and as a parameter in a build task, but not as part of the build number or as a version control tag.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With