.NET collector

To use Test Analytics with your .NET projects use the :github: test-collector-dotnet package with xUnit.

You can also upload test results by importing JSON or JUnit XML.

Before you start, make sure .NET runs with access to CI environment variables.

  1. Create a test suite and copy the API token that it gives you.

  2. Add Buildkite.TestAnalytics.Xunit to your list of dependencies in your xUnit test project:

    $ dotnet add package Buildkite.TestAnalytics.Xunit
    
  3. Set up your API token

    Add the BUILDKITE_ANALYTICS_TOKEN environment variable to your build system's environment.

  4. Run your tests

    Run your tests like normal. Note that we attempt to detect the presence of several common CI environments, however if this fails you can set the CI environment variable to any value and it will work.

    $ dotnet test Buildkite.TestAnalytics.Tests
    
  5. Verify that it works

If all is well, you should see the test run in the test analytics section of the Buildkite dashboard.