Rig.TUnit.Ci 0.1.0-beta.2

This is a prerelease version of Rig.TUnit.Ci.
dotnet add package Rig.TUnit.Ci --version 0.1.0-beta.2
                    
NuGet\Install-Package Rig.TUnit.Ci -Version 0.1.0-beta.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Rig.TUnit.Ci" Version="0.1.0-beta.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Rig.TUnit.Ci" Version="0.1.0-beta.2" />
                    
Directory.Packages.props
<PackageReference Include="Rig.TUnit.Ci" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Rig.TUnit.Ci --version 0.1.0-beta.2
                    
#r "nuget: Rig.TUnit.Ci, 0.1.0-beta.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Rig.TUnit.Ci@0.1.0-beta.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Rig.TUnit.Ci&version=0.1.0-beta.2&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Rig.TUnit.Ci&version=0.1.0-beta.2&prerelease
                    
Install as a Cake Tool

Rig.TUnit.Ci

CI-aware enrichers that auto-annotate test output with build metadata (commit SHA, PR number, matrix cell).

What this package is

A small set of enrichers that detect the ambient CI environment (GitHub Actions, Azure DevOps, local) and enrich every ILogger scope, Activity tag, and TRX metadata entry with BUILD_ID, COMMIT_SHA, PR_NUMBER, and MATRIX_CELL so post-failure triage from an artefact is always possible without pawing through raw workflow logs.

It is the "glue" that makes coverage reports, TRX files, and captured logs cross-correlatable on a failed run.

When to use it

  • Any test project that runs in CI and produces artefacts (TRX, cobertura, benchmark JSON) that need to be traceable back to their PR.
  • Integration projects where you want Activity tags to include ci.commit_sha so distributed traces survive the trip through Seq/OTLP.
  • Not for: pure domain-unit projects that never run in CI.

Prerequisites

  • .NET 10 SDK
  • A test project already using Microsoft.Extensions.Logging or OpenTelemetry ActivitySource instrumentation.

Quick start

using Rig.TUnit.Ci.Enrichers;

var scope = CiHelpers.BeginCiScope();
// Every ILogger call inside this scope now has ci.commit_sha / ci.pr_number
// properties attached via ambient enrichment.
scope.Dispose();

Options

§6 — N/A: environment-variable driven (GITHUB_SHA, GITHUB_RUN_ID,

GITHUB_PR_NUMBER, MATRIX_CELL); no FixtureOptions class because there is nothing to configure beyond the ambient CI vars.

Fixture + helper APIs

  • Rig.TUnit.Ci.Enrichers.CiHelpers — detect + enrich entry point
  • CiHelpers.BeginCiScope() — push an ambient scope for tests

Per-test isolation

No per-test state; enrichers read environment variables once per process. Safe across [NotInParallel] and [NotInParallel(Order = N)].

Parallelism + performance

Zero measurable overhead — first call caches the detected CI environment in a static readonly record; subsequent calls are property reads.

Troubleshooting

  • No enrichment locally — expected; locally the enricher reports ci.environment=local. Set GITHUB_SHA etc. manually to force a specific shape for reproduction.
  • Missing PR number on push-event builds — GitHub Actions only exposes GITHUB_REF as refs/heads/<branch> for push events; pr_number will be null and downstream enrichers must tolerate that.

See docs/troubleshooting.md.

Provider quirks + edge cases

  • Azure DevOps uses BUILD_BUILDID / SYSTEM_PULLREQUEST_PULLREQUESTID — the enricher normalises to the GitHub shape.
  • Matrix jobsMATRIX_CELL is not a standard variable; the ci.yml workflow explicitly exports it as MATRIX_CELL=<cell-name> for each integration job so traces remain per-cell distinguishable.

Benchmarks

See CiBenchmarks.cs and the latest entries under benchmarks/baseline-005.json. No hot paths — this is I/O-free property access.

License

MIT. See LICENSE.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Rig.TUnit.Ci:

Package Downloads
Rig.TUnit.All

Meta-package containing every Rig.TUnit.* package. DISCOURAGED — prefer per-feature or per-stack meta-packages (Rig.TUnit, Rig.TUnit.Microservices).

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.0-beta.2 55 4/27/2026
0.0.0-alpha.0.14 52 4/26/2026