Rig.TUnit.Ci
0.1.0-beta.2
dotnet add package Rig.TUnit.Ci --version 0.1.0-beta.2
NuGet\Install-Package Rig.TUnit.Ci -Version 0.1.0-beta.2
<PackageReference Include="Rig.TUnit.Ci" Version="0.1.0-beta.2" />
<PackageVersion Include="Rig.TUnit.Ci" Version="0.1.0-beta.2" />
<PackageReference Include="Rig.TUnit.Ci" />
paket add Rig.TUnit.Ci --version 0.1.0-beta.2
#r "nuget: Rig.TUnit.Ci, 0.1.0-beta.2"
#:package Rig.TUnit.Ci@0.1.0-beta.2
#addin nuget:?package=Rig.TUnit.Ci&version=0.1.0-beta.2&prerelease
#tool nuget:?package=Rig.TUnit.Ci&version=0.1.0-beta.2&prerelease
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
Activitytags to includeci.commit_shaso 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.Loggingor OpenTelemetryActivitySourceinstrumentation.
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 pointCiHelpers.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. SetGITHUB_SHAetc. manually to force a specific shape for reproduction. - Missing PR number on push-event builds — GitHub Actions only exposes
GITHUB_REFasrefs/heads/<branch>for push events;pr_numberwill benulland downstream enrichers must tolerate that.
Provider quirks + edge cases
- Azure DevOps uses
BUILD_BUILDID/SYSTEM_PULLREQUEST_PULLREQUESTID— the enricher normalises to the GitHub shape. - Matrix jobs —
MATRIX_CELLis not a standard variable; theci.ymlworkflow explicitly exports it asMATRIX_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.
Related docs
License
MIT. See LICENSE.
| Product | Versions 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. |
-
net10.0
- Bogus (>= 35.6.1)
- Microsoft.Extensions.Configuration (>= 10.0.0)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.0)
- Microsoft.Extensions.Options (>= 10.0.0)
- Rig.TUnit.Core (>= 0.1.0-beta.2)
- TUnit.Core (>= 1.34.5)
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 |