Precept.Reporting.Teams
0.11.0
dotnet add package Precept.Reporting.Teams --version 0.11.0
NuGet\Install-Package Precept.Reporting.Teams -Version 0.11.0
<PackageReference Include="Precept.Reporting.Teams" Version="0.11.0" />
<PackageVersion Include="Precept.Reporting.Teams" Version="0.11.0" />
<PackageReference Include="Precept.Reporting.Teams" />
paket add Precept.Reporting.Teams --version 0.11.0
#r "nuget: Precept.Reporting.Teams, 0.11.0"
#:package Precept.Reporting.Teams@0.11.0
#addin nuget:?package=Precept.Reporting.Teams&version=0.11.0
#tool nuget:?package=Precept.Reporting.Teams&version=0.11.0
Precept.Reporting.Teams
Microsoft Teams reporting for Precept: one Adaptive Card per run, posted to an incoming webhook, with the verdict, the counts, the pass rate, and a link to the build that produced them.
dotnet add package Precept.Reporting.Teams
public sealed class Startup : IPreceptStartup
{
public void ConfigureServices(IServiceCollection services, PreceptSettings settings) =>
services.AddPreceptTeamsReporting(teams => teams.Variant = PreceptTeamsCardVariant.Pipeline);
}
{
"Reporting": {
"Teams": {
"Variant": "Pipeline",
"NotifyOn": "Failure",
"Title": "Checkout regression",
"Facts": { "Owner": "Checkout squad" }
}
}
}
The webhook URL is a credential: anyone holding it can post to the channel. Supply it from CI as
the PRECEPT_REPORTING__TEAMS__WEBHOOKURL environment variable rather than committing it. Create it
from the channel's Workflows connector. The payload is the Adaptive Card envelope a workflow
URL expects, not the retired Office 365 connector's MessageCard.
Variants
Variant picks the layout, in code as above, in precept.json, or as
PRECEPT_REPORTING__TEAMS__VARIANT for a single run.
| Variant | Card |
|---|---|
Summary (default) |
Verdict header, the counts as tiles, the pass rate, the environment. No failure messages. |
Compact |
One line: verdict, pass rate, duration, and the button. |
Detailed |
Summary, then the failed tests and their messages, capped by MaxFailuresListed and MaxFailureMessageLength. |
Pipeline |
Summary, then the build: pipeline, build number, branch, commit, who queued it. |
The pipeline facts are read from the agent's own variables (Azure DevOps and GitHub Actions), so
nothing is configured into the test project. Off an agent, the Pipeline variant renders the
summary it is built on rather than a table of blanks. The same detection gives every variant its
button: leave RunUrl unset and the card links to the build that ran the suite.
The card links the run's other reports. Register Precept.Reporting.ReportPortal or
Precept.Reporting.AzureDevOps alongside it and the card gets a button per destination,
Open ReportPortal and Open Azure DevOps. There is nothing to configure, because each of those
reporters posts the address it opened to PreceptRunLinks during the run.
"LinkToOtherReports": false turns the buttons off. See
linking a run's reports to each other.
ImageUrl puts a picture on the card, such as a pipeline status badge or a team logo. It must be
an https address every reader's Teams client can fetch without signing in, because the card
renders in their client and not on the agent. ImagePlacement takes Thumbnail (the default,
beside the heading), Banner (full width) or None.
Cards are posted from a build agent only, so a channel hears about the pipeline's runs and not
about every run somebody starts while writing a scenario. A developer's run posts nothing and asks
for nothing. The reporter is never started, so a missing webhook is not an error there. To post
from your own machine while working on the card, add { "Reporting": { "CiOnly": false } } to
precept.local.json. See CI and local runs for how a run
is recognised as CI.
The card is one HTTP call after the last test, built from the summary Precept already keeps.
Nothing is sent per test. NotifyOn takes Always, Failure or FailureOrFlaky. The last one
is how a green-but-retried run still gets noticed.
Part of Precept, a .NET 10 test framework built on Microsoft.Testing.Platform. Full documentation: reporting · what the Teams card looks like · running a suite on CI · configuration · writing your own reporter
| 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
- Microsoft.Extensions.Configuration (>= 10.0.12)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.12)
- Microsoft.Extensions.Configuration.EnvironmentVariables (>= 10.0.12)
- Microsoft.Extensions.Configuration.Json (>= 10.0.12)
- Microsoft.Extensions.DependencyInjection (>= 10.0.12)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.12)
- Precept.Core (>= 0.11.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.