Faster .NET CI/CD pipelines with test filters

Faster .NET CI/CD pipelines with test filters:


Sluggish integration and delivery pipelines leave developers vulnerable to distraction. If your unit and integration tests live in one .csproj and run in both CI and CD, tune your pipeline stages to run only relevant tests.

The Tests

public async Task ThisTest_ShouldBeAUnitTest() 
   // Useful unit test

public async Task WhenThisThingDoesX_ThatThingShouldDoY() 
   // Useful integration test

Tuning the Pipelines

To run only unit tests in CI:
dotnet test --filter Category=Unit

To run only integration tests in CD:
dotnet test --filter Category=Integration

from Tumblr

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s