Precept.Reporting.ReportPortal
ReportPortal reporting for Precept: a launch per run, a suite per feature, a test item per scenario, with logs and captured files attached.
dotnet add package Precept.Reporting.ReportPortal
public sealed class Startup : IPreceptStartup
{
public void ConfigureServices(IServiceCollection services, PreceptSettings settings) =>
services.AddPreceptReportPortalReporting();
}
{
"Reporting": {
"ReportPortal": {
"Endpoint": "https://reportportal.example.com",
"Project": "example_regression",
"LaunchName": "Checkout regression",
"Attributes": { "suite": "regression" }
}
}
}
Supply the API key from CI as the PRECEPT_REPORTING__REPORTPORTAL__APIKEY environment variable.
Never commit it: a key in precept.json is a key anyone with the repository can post launches
with.
Launches are opened from a build agent only. A developer's run reports nothing and asks for
nothing. The reporter is never started, so a missing API key is not an error there. To report from
your own machine, add { "Reporting": { "CiOnly": false } } to precept.local.json. See
CI and local runs for how a run is recognised as CI.
What ReportPortal receives:
- Each
.featurebecomes a suite, named and described by its feature title and narrative rather than by the generated class. Each scenario becomes a test item tagged with its Gherkin tags. - Whatever the test logged goes up as log entries, and a failure as an error with its stack trace.
- The files a failing test captured (screenshots, traces, request logs) are attached to the item.
Only a failing test's files are attached unless
AttachOnSuccesssays otherwise, and only files up toMaxAttachmentBytes, 8 MB by default. A larger file is skipped without an error, and a Playwright trace often exceeds that. See what gets attached. - Skipped tests are closed as
NOT_ISSUE, so nobody has to triage a test that was never meant to run. - A scenario that passed after a retry is one test item carrying its attempt count, not a chain of items.
Set "LaunchMode": "DEBUG" alongside "CiOnly": false to keep launches from a developer's
machine out of the project's statistics.
On an Azure DevOps agent, the launch description carries a link back to the build, taken from the
variables the agent already sets. The link the other way is automatic too: the launch's page is
posted to the run's PreceptRunLinks, so a run that also reports to Teams gets an
Open ReportPortal button on its card. See
linking a run's reports to each other.
Reporting runs on a queue of its own, so a slow ReportPortal deployment costs the run nothing until
the very end, where it gets Reporting:ShutdownTimeoutSeconds to finish sending.
Part of Precept, a .NET 10 test framework built on Microsoft.Testing.Platform. Full documentation: reporting · running a suite on CI · configuration · artifacts