Skip to content

testream/dotnet-jira-reporter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

.NET Jira Reporter: Send xUnit, NUnit, and MSTest Results to Jira with Testream

This repository is a practical .NET + Jira integration example using @testream/dotnet-reporter. It shows how to upload test results from xUnit, NUnit, and MSTest into Jira via Testream from local runs and GitHub Actions.

If you are searching for ".NET Jira test reporting", "xUnit Jira reporter", "NUnit Jira integration", or "MSTest GitHub Actions Jira", this repo is the implementation template.

Why this example is useful

  • Multi-framework coverage: Includes xUnit, NUnit, and MSTest in one solution.
  • CI-ready: Workflow uploads each framework in separate steps.
  • Framework-specific metadata: Uses --test-type per framework (xunit, nunit, mstest).
  • Failure visibility: Intentional failing tests demonstrate Jira triage behavior.

What is Testream?

Testream is an automated test management and reporting platform for Jira teams. It ingests CI test runs, then provides failure diagnostics, trends, and release quality visibility inside Jira.

If this sample repository is not the framework you need, browse all native reporters in the Testream docs: https://docs.testream.app/.

Watch Testream in action

Click to see how Testream turns raw CI test results into actionable Jira insights (failures, trends, and release visibility):
Watch the video

Install Testream Automated Test Management and Reporting for Jira in your Jira workspace to view uploaded runs.

Project structure

src/
  ShoppingCart/
    Cart.cs        - Cart behavior
    Product.cs     - Product model and service helpers
    Discount.cs    - Discount model and validation logic
tests/
  ShoppingCart.XUnit.Tests/
    CartTests.cs      - xUnit tests (passing + 1 intentional failure)
    ProductTests.cs   - xUnit tests (passing + 1 intentional failure)
    DiscountTests.cs  - xUnit tests (passing + 1 intentional failure)
  ShoppingCart.NUnit.Tests/
    CartTests.cs
    ProductTests.cs
    DiscountTests.cs
  ShoppingCart.MSTest.Tests/
    CartTests.cs
    ProductTests.cs
    DiscountTests.cs
ShoppingCart.sln
.github/workflows/dotnet.yml
.env.example

The intentional failures help validate how each framework’s failed tests appear in Testream/Jira.

Quick start: .NET to Jira reporting

1. Create your Testream project and API key

  1. Sign in at testream.app.
  2. Create a project.
  3. Copy your API key.

2. Restore dependencies

dotnet restore

Requires .NET 8 SDK+.

3. Set API key

For local uploads:

export TESTREAM_API_KEY=<your key>

For CI uploads, add it as a GitHub Actions secret.

4. Run tests locally

dotnet test ./ShoppingCart.sln

5. Upload one framework run (example: xUnit)

npx @testream/dotnet-reporter \
  -k "$TESTREAM_API_KEY" \
  --project tests/ShoppingCart.XUnit.Tests/ShoppingCart.XUnit.Tests.csproj \
  --test-environment local \
  --app-name dotnet-jira-reporter-example \
  --app-version 1.0.0 \
  --test-type xunit \
  --fail-on-error

Reporter configuration (@testream/dotnet-reporter)

This repo uses the CLI uploader instead of an in-process test framework reporter.

Key behavior:

  • Works per project (--project) so each framework can be uploaded independently.
  • Uses explicit app/run metadata (--app-name, --app-version, --test-environment, --test-type).
  • --fail-on-error is enabled in CI.
  • CI metadata (--branch, --commit-sha, --repository-url, --build-number, --build-url) is auto-detected.

Reporter docs: https://docs.testream.app/reporters/dotnet

GitHub Actions setup

The workflow at .github/workflows/dotnet.yml runs on push, pull request, and manual dispatch.

Add this repository secret:

Settings -> Secrets and variables -> Actions -> New repository secret

Name Value
TESTREAM_API_KEY Your Testream API key

Each framework is uploaded in its own step:

  1. xUnit upload step
  2. NUnit upload step
  3. MSTest upload step

How results appear in Jira

After connecting Testream to Jira, you get:

  • Dashboard summaries across framework runs
  • Failure diagnostics with stack traces and assertion details
  • Trend analytics across commits/releases
  • Jira issue creation directly from failed tests

Troubleshooting

Upload command fails locally

  • Verify Node.js and .NET SDK are installed.
  • Verify TESTREAM_API_KEY is set in your shell.

CI uploads missing

  • Confirm TESTREAM_API_KEY exists in repository secrets.
  • Confirm workflow has access to secrets in the run context.

Runs execute but no Jira data appears

  • Verify the Testream project is connected to the intended Jira workspace.

FAQ

Can I use only one framework in this repo?

Yes. You can keep only xUnit, NUnit, or MSTest and remove the other steps.

Why include failing tests?

To demonstrate real failure triage across the three .NET test frameworks.

Is this production-ready?

It is an example repository with production-style CI and upload wiring intended for adaptation.

.NET Jira reporting alternatives (quick view)

Approach Benefit Tradeoff
Store TRX/JUnit files as artifacts Basic traceability Limited Jira-native analytics
Build custom uploader Flexible Higher maintenance complexity
Testream .NET reporter (this repo) Native Jira-focused reporting across frameworks Requires Testream setup

Related links