Move shared fixtures and parity utilities to TestUtilities project

- git mv JetStreamApiFixture, JetStreamClusterFixture, LeafFixture,
  Parity utilities, and TestData from NATS.Server.Tests to
  NATS.Server.TestUtilities
- Update namespaces to NATS.Server.TestUtilities (and .Parity sub-ns)
- Make fixture classes public for cross-project access
- Add PollHelper to replace Task.Delay polling with SemaphoreSlim waits
- Refactor all fixture polling loops to use PollHelper
- Add 'using NATS.Server.TestUtilities;' to ~75 consuming test files
- Rename local fixture duplicates (MetaGroupTestFixture,
  LeafProtocolTestFixture) to avoid shadowing shared fixtures
- Remove TestData entry from NATS.Server.Tests.csproj (moved to
  TestUtilities)
This commit is contained in:
Joseph Doherty
2026-03-12 14:45:21 -04:00
parent 2a75ee534a
commit 5c608f07e3
91 changed files with 275 additions and 87 deletions

View File

@@ -1,3 +1,5 @@
using NATS.Server.TestUtilities.Parity;
namespace NATS.Server.Tests;
public class DifferencesParityClosureTests
@@ -5,7 +7,7 @@ public class DifferencesParityClosureTests
[Fact]
public void Differences_md_has_no_remaining_baseline_n_or_stub_rows_in_tracked_scope()
{
var report = Parity.ParityRowInspector.Load("differences.md");
var report = NATS.Server.TestUtilities.Parity.ParityRowInspector.Load("differences.md");
report.UnresolvedRows.ShouldBeEmpty(string.Join(
Environment.NewLine,
report.UnresolvedRows.Select(r => $"{r.Section} :: {r.SubSection} :: {r.Feature} [{r.DotNetStatus}]")));
@@ -14,7 +16,7 @@ public class DifferencesParityClosureTests
[Fact]
public void Jetstream_truth_matrix_has_no_row_level_drift()
{
var report = Parity.JetStreamParityTruthMatrix.Load(
var report = NATS.Server.TestUtilities.Parity.JetStreamParityTruthMatrix.Load(
"differences.md",
"docs/plans/2026-02-23-jetstream-remaining-parity-map.md");
@@ -26,7 +28,7 @@ public class DifferencesParityClosureTests
[Fact]
public void Differences_and_strict_capability_maps_have_no_claims_without_behavior_and_test_evidence()
{
var inventory = Parity.NatsCapabilityInventory.Load("docs/plans/2026-02-23-nats-strict-full-go-parity-map.md");
var inventory = NATS.Server.TestUtilities.Parity.NatsCapabilityInventory.Load("docs/plans/2026-02-23-nats-strict-full-go-parity-map.md");
var incomplete = inventory.Rows
.Where(r => !string.Equals(r.Behavior, "done", StringComparison.OrdinalIgnoreCase)
|| !string.Equals(r.Tests, "done", StringComparison.OrdinalIgnoreCase)