From e7d92509fdeba7a1567615bc009ca075fc3b775e Mon Sep 17 00:00:00 2001 From: "Jeremy D. Miller" Date: Wed, 29 Jul 2026 06:20:01 -0500 Subject: [PATCH] ci: run the three test suites that never ran JasperFx.SourceGenerator.Tests (19), JasperFx.Events.SourceGenerator.Tests (26) and JasperFx.Aspire.Tests (51) are all in the solution, so `compile` built them and a compile break would fail CI -- but they were in no Nuke test target and no workflow step, so 96 tests never actually executed. A source generator could emit wrong code, or the Aspire integration could regress, without anything going red. Adds TestSourceGenerators (both generator suites) and TestAspire, hangs them off the aggregate Test target, and gives each a workflow step using the same `if: success() || failure()` pattern as the existing suites so one failure does not mask the rest. Framework coverage follows each project rather than the repo default: the two generator test suites pin net9.0 to match the netstandard2.0 generators they host, and the Aspire suite is net10.0-only like JasperFx.Aspire itself. All 96 pass. Co-Authored-By: Claude Opus 5 (1M context) --- .github/workflows/dotnet.yml | 13 +++++++++++++ .nuke/build.schema.json | 4 +++- build/Build.cs | 36 +++++++++++++++++++++++++++++++++++- 3 files changed, 51 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index feafd8a..c232aa7 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -87,6 +87,19 @@ jobs: run: ./build.sh test-event-store shell: bash + # Covers both Roslyn source generator suites. These built in CI all along (they are in the + # solution, so `compile` catches compile breaks) but nothing ever ran them, so a generator + # could emit wrong code without failing the build. + - name: test-source-generators + if: ${{ success() || failure() }} + run: ./build.sh test-source-generators + shell: bash + + - name: test-aspire + if: ${{ success() || failure() }} + run: ./build.sh test-aspire + shell: bash + # End-to-end CLI smoke tests, including `codegen preview --language fsharp`: proves the F# flag # is wired through the CLI and the F# emit path runs without throwing. It does NOT prove the # output compiles -- `preview` only prints, and GeneratorTarget feeds codegen a raw C# CodeFrame diff --git a/.nuke/build.schema.json b/.nuke/build.schema.json index 2116a17..26ae72c 100644 --- a/.nuke/build.schema.json +++ b/.nuke/build.schema.json @@ -32,12 +32,14 @@ "SmokeTestAot", "SmokeTestCommands", "Test", + "TestAspire", "TestCodegen", "TestCodegenFSharp", "TestCommandLine", "TestCore", "TestEvents", - "TestEventStore" + "TestEventStore", + "TestSourceGenerators" ] }, "Verbosity": { diff --git a/build/Build.cs b/build/Build.cs index f908823..5e482de 100644 --- a/build/Build.cs +++ b/build/Build.cs @@ -50,7 +50,7 @@ partial class Build : NukeBuild .EnableNoRestore()); }); - Target Test => _ => _.DependsOn(TestCore, TestCodegen, TestCodegenFSharp, TestCommandLine, TestEvents, TestEventStore, SmokeTestAot); + Target Test => _ => _.DependsOn(TestCore, TestCodegen, TestCodegenFSharp, TestCommandLine, TestEvents, TestEventStore, TestSourceGenerators, TestAspire, SmokeTestAot); Target TestCore => _ => _ .DependsOn(Compile) @@ -126,6 +126,40 @@ partial class Build : NukeBuild .EnableNoRestore()); }); + // Both source generator suites. These are in the solution (so `compile` builds them, and they + // break the build if they stop compiling) but were in no test target, meaning 45 tests covering + // the two Roslyn generators built and never ran. Single-framework by project: both test + // projects pin TargetFramework=net9.0 to match the netstandard2.0 generators they host. + Target TestSourceGenerators => _ => _ + .DependsOn(Compile) + .Executes(() => + { + DotNetTest(c => c + .SetProjectFile(Solution.src.JasperFx_SourceGenerator_Tests) + .SetConfiguration(Configuration) + .EnableNoBuild() + .EnableNoRestore()); + + DotNetTest(c => c + .SetProjectFile(Solution.src.JasperFx_Events_SourceGenerator_Tests) + .SetConfiguration(Configuration) + .EnableNoBuild() + .EnableNoRestore()); + }); + + // Aspire integration surface. net10.0-only, matching JasperFx.Aspire itself (Aspire 13 is + // net10-first). Was likewise in the solution but in no test target. + Target TestAspire => _ => _ + .DependsOn(Compile) + .Executes(() => + { + DotNetTest(c => c + .SetProjectFile(Solution.src.JasperFx_Aspire_Tests) + .SetConfiguration(Configuration) + .EnableNoBuild() + .EnableNoRestore()); + }); + Target SmokeTestCommands => _ => _.DependsOn(Compile) .Executes(() => {