Skip to content

Bootstrap Dashboard.Tests project source (plan 3)#1001

Merged
erikdarlingdata merged 1 commit into
devfrom
feature/dashboard-tests-bootstrap
May 27, 2026
Merged

Bootstrap Dashboard.Tests project source (plan 3)#1001
erikdarlingdata merged 1 commit into
devfrom
feature/dashboard-tests-bootstrap

Conversation

@erikdarlingdata
Copy link
Copy Markdown
Owner

Summary

Populates the previously scaffold-only Dashboard.Tests/ folder with the pure-algorithm subset of Lite.Tests — every test that exercises shared analysis code without a DuckDB or SQL Server dependency. Three ported files, 18 cases, ~1s wall time.

What changed

  • New Dashboard.Tests/Dashboard.Tests.csproj — mirrors Lite.Tests/Lite.Tests.csproj byte-for-byte modulo the project reference (net10.0-windows, xunit.v3 3.2.2, Microsoft.NET.Test.Sdk 18.5.1, same NoWarn set, UseWPF=true).
  • New Dashboard.Tests/FactScorerTests.cs — 12 cases: 10 ApplyThresholdFormula [InlineData] rows, Score_UnknownWaitType_GetsSeverityZero, Amplifier_SeverityCappedAt2.
  • New Dashboard.Tests/InferenceEngineTests.cs — 3 cases: Graph_NoEdgesForUnknownFact, Graph_CxPacketEdgeFires_WhenSosIsHigh, Graph_CxPacketEdgeDoesNotFire_WhenSosIsLow.
  • New Dashboard.Tests/BaselineBucketTests.cs — 3 cases on BaselineBucket.EffectiveStdDev (proportional floor, zero-activity, pass-through). Renamed from Lite's BaselineProviderTests because only the value-type cases port; the provider-level DuckDB cases are deferred. using DuckDB.NET.Data; stripped.
  • Modified Dashboard/Dashboard.csproj — adds <InternalsVisibleTo Include="Dashboard.Tests" />. FactScorer.ApplyThresholdFormula is internal static, so the Theory port would not compile without this.
  • Modified PerformanceMonitor.sln — adds Dashboard.Tests project block + per-config Debug/Release build mappings under a fresh GUID.

Test bodies, [InlineData] rows, and assertions are byte-identical to the Lite originals — the shared algorithms are byte-identical between Lite and Dashboard, so the ported tests pass without behavior change.

Out of scope (intentionally deferred)

  • BlockingChainReconstructorTestsDashboard/Analysis/BlockingChainReconstructor.cs is on dev, but Lite's matching test file lives only on the unmerged Lite Stage 3 worktree. The parity port rides in the same PR that brings Lite Stage 3's reconstructor tests to dev, not this bootstrap — keeping Lite and Dashboard symmetrical.
  • All SQL-touching portsSqlServerFactCollector, SqlServerFindingStore, SqlServerAnomalyDetector, the database paths of SqlServerBaselineProvider, full AnalysisService/Scenario pipelines. The plan documents these under §10 and recommends TestContainers as the fixture surface; that decision is its own PR.
  • FinOpsHealthCalculator / HighImpactScorer parity — Dashboard FinOps has no pure scoring class to mirror Lite's; structurally different surface, gets bespoke tests later.
  • UI / WPF tests — separate concern; UseWPF=true in the test project is for type loading only.

Test plan

  • dotnet build Dashboard.Tests/Dashboard.Tests.csproj -c Debug — 0 warnings, 0 errors.
  • dotnet test Dashboard.Tests/Dashboard.Tests.csproj18 passed, 0 failed, 0 skipped (~1s).
  • dotnet build PerformanceMonitor.sln -c Debug — full-solution build clean, 0 warnings, 0 errors.
  • dotnet test Lite.Tests/Lite.Tests.csproj — Lite.Tests still passes (260/260), confirming tests were COPIED + renamed, not moved.
  • code-reviewer agent review — clean, no findings.

Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com

Populates the previously scaffold-only Dashboard.Tests folder with the
pure-algorithm subset of Lite.Tests — the slice that exercises shared
analysis code with no DuckDB or SQL Server dependency. SQL-touching
tests (collectors, finding stores, anomaly detector, baseline provider
DB paths) are deferred to a follow-up workstream that picks a fixture
strategy (TestContainers recommended in the plan).

Files added:
- Dashboard.Tests/Dashboard.Tests.csproj — mirrors Lite.Tests.csproj
  (net10.0-windows, xunit.v3 3.2.2, ProjectReference to Dashboard.csproj)
- Dashboard.Tests/FactScorerTests.cs — 12 cases
  (10 ApplyThresholdFormula InlineData rows, Score_UnknownWaitType,
  Amplifier_SeverityCappedAt2)
- Dashboard.Tests/InferenceEngineTests.cs — 3 cases
  (RelationshipGraph.GetActiveEdges edge predicates)
- Dashboard.Tests/BaselineBucketTests.cs — 3 cases
  (BaselineBucket.EffectiveStdDev floor / zero-activity / pass-through;
   renamed from Lite's BaselineProviderTests because only the value-type
   tests are ported)

Files modified:
- Dashboard/Dashboard.csproj — adds <InternalsVisibleTo Include="Dashboard.Tests" />
  so the ported ApplyThresholdFormula_ReturnsExpected Theory can call
  the internal static method.
- PerformanceMonitor.sln — adds Dashboard.Tests project block and
  per-config build mappings.

Deferred:
- BlockingChainReconstructorTests — Dashboard side is on dev, but
  Lite's matching test file is still on the unmerged Lite Stage 3
  worktree. The parity port rides in the same PR that brings Lite
  Stage 3's reconstructor tests to dev, not this bootstrap.
- All SQL-touching ports (FactCollector, FindingStore, AnomalyDetector,
  SqlServerBaselineProvider DB paths, full AnalysisService/Scenario
  pipelines). Tracked under §10 of the plan.

Verification:
- dotnet build Dashboard.Tests/Dashboard.Tests.csproj -c Debug:
  0 warnings, 0 errors.
- dotnet test Dashboard.Tests/Dashboard.Tests.csproj:
  18 passed, 0 failed, 0 skipped (~1s).
- dotnet build PerformanceMonitor.sln -c Debug:
  0 warnings, 0 errors.
- Lite.Tests unchanged: 260 passed, 0 failed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@erikdarlingdata erikdarlingdata merged commit 190bb1b into dev May 27, 2026
2 checks passed
@erikdarlingdata erikdarlingdata deleted the feature/dashboard-tests-bootstrap branch May 27, 2026 02:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant