.NET collector
To use Test Engine with your .NET projects use the
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.
Create a test suite and copy the API token that it gives you.
-
Add
Buildkite.TestAnalytics.Xunitto your list of dependencies in your xUnit test project:$ dotnet add package Buildkite.TestAnalytics.Xunit -
Set up your API token
Add the
BUILDKITE_ANALYTICS_TOKENenvironment variable to your build system's environment. -
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
CIenvironment variable to any value and it will work.$ dotnet test Buildkite.TestAnalytics.Tests Verify that it works
If all is well, you should see the test run analytics on the Buildkite Test Engine dashboard.