From 654812525d14614ccd1a26d01814702605e83d42 Mon Sep 17 00:00:00 2001 From: electricessence <5899455+electricessence@users.noreply.github.com> Date: Tue, 1 Dec 2026 06:08:06 -0800 Subject: [PATCH] Tests: run the suites on net11.0 only The library still builds and ships net10.0; its tests ran the same source a second time on the older runtime, which slowed every run and the analyzer checks. - The Core and generator test projects target net11.0 alone. The CI matrix keeps net11.0 in Release and in Debug. - The package consumer tests run on net472 and net11.0. - Kept on net10.0: the LegacyCompiler tests, where net10.0 is the C# 12 compiler leg (it binds the overloads differently from C# 13), and the generator's model library, which the Benchmarks project builds for both runtimes. - Comments and the "what's new" page say where the tests now run. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/tests.yml | 9 +++------ .../FromBindingTests.cs | 2 +- .../NullRuleMatrixTests.cs | 4 ++-- .../Open.Database.Extensions.Core.Tests.csproj | 2 +- .../RequiredMemberTests.cs | 2 +- .../Open.Database.Extensions.Generator.Tests.csproj | 2 +- ...Open.Database.Extensions.PackageConsumer.Tests.csproj | 2 +- docsite/articles/whats-new-11.md | 2 +- 8 files changed, 11 insertions(+), 14 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6d4f659b..2e70c6e0 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,7 +1,7 @@ name: Tests # Runs the Core test suite on every pull request and every push to master, and checks the packages for known vulnerabilities. -# The suite runs on net10.0 and net11.0 in Release, and on net11.0 in Debug (Debug.Assert is live there). +# The suite runs on net11.0 in Release and in Debug (Debug.Assert is live there). net10.0 is still built and shipped; its tests run only where it differs (the LegacyCompiler job). # A separate job runs the LegacyCompiler tests, which compile the public call shapes with older C# language versions. # Another runs the source generator's tests and the package consumer tests (see its steps). # Another job builds the Benchmarks project (it is not in the solution), so a change to the public API cannot leave its call sites behind. @@ -40,9 +40,6 @@ jobs: fail-fast: false matrix: include: - - name: net10.0-Release - tfm: net10.0 - configuration: Release - name: net11.0-Release tfm: net11.0 configuration: Release @@ -146,14 +143,14 @@ jobs: & $exe info MSSQLLocalDB # The generator runs as an analyzer of the test project and intercepts its Map() calls on the models of another assembly; - # each test compares those rows, or that exception, with the runtime map's on the same data. No -f: net10.0 and net11.0. + # each test compares those rows, or that exception, with the runtime map's on the same data. One target framework: net11.0. - name: Run the generator tests env: ODX_REQUIRE_SQL: 1 run: dotnet test Tests/Open.Database.Extensions.Generator.Tests -c Release --logger "trx;LogFilePrefix=generator" --results-directory TestResults/generator # What a NuGet user gets: the packages are packed, and a project that references only them is built and run with the generator on, - # arriving through MSSqlClient alone, switched off, and with C# 12. It runs on net472, net10.0 and net11.0, against LocalDB and SQLite. + # arriving through MSSqlClient alone, switched off, and with C# 12. It runs on net472 and net11.0, against LocalDB and SQLite. - name: Run the package consumer tests env: ODX_REQUIRE_SQL: 1 diff --git a/Tests/Open.Database.Extensions.Core.Tests/FromBindingTests.cs b/Tests/Open.Database.Extensions.Core.Tests/FromBindingTests.cs index 1570d3f6..00109dde 100644 --- a/Tests/Open.Database.Extensions.Core.Tests/FromBindingTests.cs +++ b/Tests/Open.Database.Extensions.Core.Tests/FromBindingTests.cs @@ -7,7 +7,7 @@ namespace Open.Database.Extensions.Tests; // The call shapes of RowMap.From, against the overload set of the pairs form (shipped) and the factory form: // each shape compiles (an ambiguity, CS0121, would break the build), and what it does shows which overload bound: // the pairs form returns Default for no pairs and otherwise builds the model through its constructor, a factory form builds the row by the function (it adds 100 to the id). -// This project compiles at the SDK's default language version (C# 14 on net10.0); the language versions before it are LegacyCompiler.Tests (C# 12 on net10.0), +// This project compiles at the SDK's default language version (on net11.0); the language versions before it are LegacyCompiler.Tests (C# 12 on net10.0), // and C# 13 was checked by a scratch probe of the same overload set, with and without the attribute (the A1 task output). [ExcludeFromCodeCoverage] public static class FromBindingTests diff --git a/Tests/Open.Database.Extensions.Core.Tests/NullRuleMatrixTests.cs b/Tests/Open.Database.Extensions.Core.Tests/NullRuleMatrixTests.cs index 4df6b803..c9d84700 100644 --- a/Tests/Open.Database.Extensions.Core.Tests/NullRuleMatrixTests.cs +++ b/Tests/Open.Database.Extensions.Core.Tests/NullRuleMatrixTests.cs @@ -11,7 +11,7 @@ namespace Open.Database.Extensions.Tests; // - a reference declared non-nullable (`string`): a property keeps its initializer (null when it has none), a constructor parameter gets its fallback. // The matrix is {property, constructor parameter} x {the kinds of member} x {NULL cell, real cell} x {a typed reader, a reader reporting object, buffered object[] rows}. // The reader of the compiler's annotations is internal to the library, so its agreement with the runtime's own NullabilityInfoContext is checked by what it does: a NULL keeps the member exactly -// when NullabilityInfoContext says its write state is NotNull. The Core test project targets net10.0 only, where NullabilityInfoContext exists; the library reads the metadata by hand on every target. +// when NullabilityInfoContext says its write state is NotNull. The Core test project targets net11.0 only, where NullabilityInfoContext exists; the library reads the metadata by hand on every target. [ExcludeFromCodeCoverage] public static class NullRuleMatrixTests { @@ -156,7 +156,7 @@ public static void ANullCell_FollowsTheDeclaredType_AndARealCellIsAlwaysUsed(str Assert.Equal(isNull ? c.OnNull : c.OnValue, c.Read(route, isNull)); } - // ---- the reader agrees with the runtime's own reading of the annotations (net10.0: NullabilityInfoContext) ---- + // ---- the reader agrees with the runtime's own reading of the annotations (net11.0: NullabilityInfoContext) ---- static NullabilityState WriteState(PropertyInfo property) => new NullabilityInfoContext().Create(property).WriteState; diff --git a/Tests/Open.Database.Extensions.Core.Tests/Open.Database.Extensions.Core.Tests.csproj b/Tests/Open.Database.Extensions.Core.Tests/Open.Database.Extensions.Core.Tests.csproj index 88d1b7a3..23ab8169 100644 --- a/Tests/Open.Database.Extensions.Core.Tests/Open.Database.Extensions.Core.Tests.csproj +++ b/Tests/Open.Database.Extensions.Core.Tests/Open.Database.Extensions.Core.Tests.csproj @@ -1,7 +1,7 @@  - net10.0;net11.0 + net11.0 Exe false diff --git a/Tests/Open.Database.Extensions.Core.Tests/RequiredMemberTests.cs b/Tests/Open.Database.Extensions.Core.Tests/RequiredMemberTests.cs index d3a9e9ad..a6e3e16d 100644 --- a/Tests/Open.Database.Extensions.Core.Tests/RequiredMemberTests.cs +++ b/Tests/Open.Database.Extensions.Core.Tests/RequiredMemberTests.cs @@ -334,7 +334,7 @@ public static void WhenTheConstructorSetsRequiredMembers_ARequiredFieldIsNotAnEr } // ---- the attributes are matched by FULL NAME: a copy declared by a consumer counts, and the library names no type netstandard lacks ---- - // The test project is net10.0, whose framework has both attributes, so these models are built at run time with attributes of the same full names that are NOT the framework's types + // The test project is net11.0, whose framework has both attributes, so these models are built at run time with attributes of the same full names that are NOT the framework's types // (declared in a dynamic assembly), the way a consumer's polyfill on netstandard2.0 would be. const string RequiredName = "System.Runtime.CompilerServices.RequiredMemberAttribute"; diff --git a/Tests/Open.Database.Extensions.Generator.Tests/Open.Database.Extensions.Generator.Tests.csproj b/Tests/Open.Database.Extensions.Generator.Tests/Open.Database.Extensions.Generator.Tests.csproj index f618994f..ade4f890 100644 --- a/Tests/Open.Database.Extensions.Generator.Tests/Open.Database.Extensions.Generator.Tests.csproj +++ b/Tests/Open.Database.Extensions.Generator.Tests/Open.Database.Extensions.Generator.Tests.csproj @@ -7,7 +7,7 @@ Core's own test projects are not changed. --> - net10.0;net11.0 + net11.0 Exe false diff --git a/Tests/Open.Database.Extensions.PackageConsumer.Tests/Open.Database.Extensions.PackageConsumer.Tests.csproj b/Tests/Open.Database.Extensions.PackageConsumer.Tests/Open.Database.Extensions.PackageConsumer.Tests.csproj index 9c22cd9b..ae4024a7 100644 --- a/Tests/Open.Database.Extensions.PackageConsumer.Tests/Open.Database.Extensions.PackageConsumer.Tests.csproj +++ b/Tests/Open.Database.Extensions.PackageConsumer.Tests/Open.Database.Extensions.PackageConsumer.Tests.csproj @@ -11,7 +11,7 @@ generator off. --> - net472;net10.0;net11.0 + net472;net11.0 Exe false diff --git a/docsite/articles/whats-new-11.md b/docsite/articles/whats-new-11.md index 32c7156d..70762c54 100644 --- a/docsite/articles/whats-new-11.md +++ b/docsite/articles/whats-new-11.md @@ -168,4 +168,4 @@ Every mapped overload takes one `RowMap? map` where 10.x took key/value pairs - The synchronous `ToTargetBlock` overloads post each row without waiting: when the target is complete, or bounded and full, reading stops without an error, and only the number the call returns (the rows read and handed over) shows the shortfall. Use the `Async` overload to feed a bounded target. - `AddParams(source)` sends every public member of `source` that the procedure declares, so pass an object you trust, and add a value that only the server may decide with `AddParam("name", value)`. - The unit tests run on in-memory providers, the documentation samples on SQLite, and the benchmarks on the in-memory provider, SQLite and SQL Server LocalDB. Feedback from other providers and workloads is welcome. -- The tests of the mapper, the pipelines and the commands run on net10.0 and net11.0. The netstandard2.0, netstandard2.1 and net472 builds share the code through `#if` switches; a small test project runs the `AddParam` overloads on net472, net8.0, net10.0 and net11.0 under older language versions. +- The tests of the mapper, the pipelines and the commands run on net11.0. The net10.0, netstandard2.0, netstandard2.1 and net472 builds share the code through `#if` switches; a small test project runs the `AddParam` overloads on net472, net8.0, net10.0 and net11.0 under older language versions.