Skip to main content

.NET Reporter

The Testream .NET Reporter runs your tests (or reads existing TRX files), converts results to CTRF, and uploads them to Testream.

Installation

# Use with npx (recommended)
npx @testream/dotnet-reporter --help

# Or install globally
npm install -g @testream/dotnet-reporter

Quick Start

npx @testream/dotnet-reporter -k $TESTREAM_API_KEY

This single command will:

  1. Run dotnet test
  2. Generate a CTRF report
  3. Upload to Testream (project key inferred from API key)

CLI Options

OptionTypeDefaultDescription
-k, --api-keystring-Required API key (unless --no-upload is used)
--project <path>stringcurrent dirPath to .NET project or solution
--trx-path <path>string-Use existing TRX file(s) instead of running tests
--branch <name>stringauto (CI)Git branch name
--commit-sha <sha>stringauto (CI)Git commit SHA
--repository-url <url>stringauto (CI)Git repository URL
--build-name <name>string-Build name
--build-number <num>stringauto (CI)Build number
--build-url <url>stringauto (CI)Build URL
--test-environment <env>string-Test environment (e.g., ci, staging)
--app-name <name>string-Application name
--app-version <ver>string-Application version
--test-type <type>string-Test type (e.g., unit, integration)
--no-uploadbooleanfalseSkip uploading (validate + summarize only)
--fail-on-errorbooleanfalseExit with non-zero code if upload fails
-- <args>--Additional arguments passed to dotnet test

Examples

Run tests and upload

npx @testream/dotnet-reporter -k $TESTREAM_API_KEY

Use a specific project or solution

npx @testream/dotnet-reporter -k $TESTREAM_API_KEY --project ./MySolution.sln

Pass extra dotnet test arguments

npx @testream/dotnet-reporter -k $TESTREAM_API_KEY -- --filter "Category=Unit"

Use existing TRX files

npx @testream/dotnet-reporter -k $TESTREAM_API_KEY --trx-path TestResults/*.trx

Full Configuration Example

npx @testream/dotnet-reporter \
-k $TESTREAM_API_KEY \
--project ./MySolution.sln \
--build-name $GITHUB_WORKFLOW \
--test-environment ci \
--app-name "My App" \
--app-version 1.0.0 \
--test-type unit \
--fail-on-error

GitHub Actions Example

.github/workflows/dotnet.yml
name: .NET Tests

on: [push, pull_request]

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: "8.0.x"

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20

- name: Run tests and upload
run: |
npx @testream/dotnet-reporter \
-k ${{ secrets.TESTREAM_API_KEY }} \
--project ./MySolution.sln \
--test-environment ci \
--app-name MyApp \
--app-version 1.0.0 \
--test-type unit \
--fail-on-error

Supported Test Frameworks

  • xUnit
  • NUnit
  • MSTest
  • TRX (generic)

Sample Project

The testream/dotnet-jira-reporter repository is a complete working example of a .NET project integrated with Testream. It includes example tests, full reporter configuration, and a ready-to-use GitHub Actions workflow.

NPM Package

What's Next?