From 0ed7a04c60e2f4f0616262eae7a3e9cba6ad9877 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valentin=20Breu=C3=9F?= Date: Sun, 18 Oct 2026 18:37:21 +0200 Subject: [PATCH] ci: run the example tests in the pipeline `Mockolate.ExampleTests` covers realistic usage (file system, Azure SDK clients) but was not part of the `UnitTests` target, so a change that broke these examples still passed CI. ## Changes - **Pipeline**: `UnitTests` runs `Mockolate.ExampleTests` on all its target frameworks (net10.0, net8.0 and net48 on Windows), with a TRX and a Cobertura coverage file per framework like the other unit test projects. - **Docs**: `Docs/agents/workflows.md` no longer says that CI skips the example tests and lists them in the `UnitTests` target. ## Verification - `./build.ps1 CodeCoverage` runs the example tests (19 on net10.0, 19 on net8.0, 14 on net48, all passing) and writes `Mockolate.ExampleTests_.trx` and `.cobertura.xml` into `TestResults`. --- Docs/agents/workflows.md | 4 ++-- Pipeline/Build.UnitTest.cs | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Docs/agents/workflows.md b/Docs/agents/workflows.md index ce0782bb..1dc12bd0 100644 --- a/Docs/agents/workflows.md +++ b/Docs/agents/workflows.md @@ -45,7 +45,7 @@ A newer language feature can compile for `net10.0` and fail for `net48`; build o | `Source/Mockolate` | `Mockolate.Tests`, `Mockolate.Internal.Tests`, `Mockolate.Api.Tests` | | `Source/Mockolate.SourceGenerators` | `Mockolate.SourceGenerators.Tests`, `Mockolate.Tests` (it compiles the generated mocks) | | `Source/Mockolate.Analyzers*` | `Mockolate.Analyzers.Tests` | -| Usage examples | `Mockolate.ExampleTests` (not part of the `UnitTests` target, so CI does not run it) | +| Usage examples | `Mockolate.ExampleTests` | | `Pipeline/BenchmarkReport.cs` | `Build.Tests` | ## Snapshots @@ -116,7 +116,7 @@ Reports go to `Artifacts/Stryker`, together with the Markdown body of the PR com | Target | Purpose | |---|---| | `Compile` | Restore and build the solution with the GitVersion-derived version | -| `UnitTests` | Run `Build.Tests`, `Mockolate.Tests`, `Mockolate.Internal.Tests`, `Mockolate.Analyzers.Tests` and `Mockolate.SourceGenerators.Tests` for each framework (`net48` only on Windows), with a TRX and a Cobertura coverage file per project and framework in `TestResults` | +| `UnitTests` | Run `Build.Tests`, `Mockolate.Tests`, `Mockolate.Internal.Tests`, `Mockolate.Analyzers.Tests`, `Mockolate.SourceGenerators.Tests` and `Mockolate.ExampleTests` for each framework (`net48` only on Windows), with a TRX and a Cobertura coverage file per project and framework in `TestResults` | | `CodeCoverage` | `UnitTests` plus a ReportGenerator SonarQube report in `TestResults/reports` | | `ApiChecks` | Run `Mockolate.Api.Tests` | | `CodeAnalysis` | SonarCloud analysis (needs `SonarToken`) | diff --git a/Pipeline/Build.UnitTest.cs b/Pipeline/Build.UnitTest.cs index f5ea539e..7c45d534 100644 --- a/Pipeline/Build.UnitTest.cs +++ b/Pipeline/Build.UnitTest.cs @@ -21,6 +21,7 @@ partial class Build Solution.Tests.Mockolate_Internal_Tests, Solution.Tests.Mockolate_Analyzers_Tests, Solution.Tests.Mockolate_SourceGenerators_Tests, + Solution.Tests.Mockolate_ExampleTests, ]; Target DotNetUnitTests => _ => _