Skip to content

test(phase 2): add critical-path test coverage across Domain / Application / Infrastructure layers #341

@Vasar007

Description

@Vasar007

Phase: Phase 2 of Milestone v0.9.8 (Test Coverage & Agent-Testable Feedback Loop).

Goal

Identify the critical paths and business scenarios across Domain, Application, and Infrastructure layers and back them with a deliberate mix of unit, integration, and contract tests — running in the right CI stages and surfacing a coverage report for visibility, without committing to a 100 % gate.

Requirements Addressed

  • TEST-01 — Checked-in document enumerates critical paths across Domain (appraisal logic, model invariants, F# policy / activities), Application (Shell, ShellBuilder, DataflowPipeline, Executors), and Infrastructure (DB + TMDb / OMDb / Steam adapters) layers and maps each path to its covering tests.
  • TEST-02 — Unit tests cover Domain-layer logic gaps surfaced by the TEST-01 inventory.
  • TEST-03 — Application-layer tests cover orchestration paths (Shell / ShellBuilder / DataflowPipeline composition, Executors wiring).
  • TEST-04 — Infrastructure / integration tests run against a real DB (Testcontainers) and exercise TMDb / OMDb / Steam adapters via a real contract or recorded fixture.
  • TEST-05 — CI build distinguishes unit / integration / contract stages, runs them in the right order, and stops silently skipping the F# ProjectV.ContentDirectories.Tests project.
  • TEST-06 — Coverage report is produced on every CI run and reachable from the build summary (artifact); no hard coverage gate enforced — visibility only.

Scope

This phase adds critical-path test coverage as a single long-lived branch that merges to master via one PR. The implementation lands in the following committed surfaces:

  • Test projects under Sources/Tests/ProjectV.Tests.Shared (base classes, generators, mock builders, fixtures: TestWebApplicationFactory, TestJwtHelper, TestTelegramBotClientBuilder, FakeHttpMessageHandler, NLog initializer, TestDbHelper / DbCollection), plus per-area test projects for Models, Appraisers, Core, Crawlers, DataPipeline, Executors, InputProcessing, OutputProcessing, Tmdb/Omdb/SteamService (contract via WireMock.Net), DataAccessLayer (integration via Testcontainers Postgres), CommunicationWebService (JWT integration via WebApplicationFactory), and TelegramBotWebService (webhook + polling integration).
  • CI rewrite in .github/workflows/build.yml — four named test stages on ubuntu-latest (Test (Unit) / Test (Integration) / Test (Contract) / Test (F#)) plus Test (Non-Docker) on windows-latest, with Coverlet XPlat Code Coverage collection on every C# stage and ReportGenerator merge → coverage artifact + GitHub Step Summary section.
  • Initial EF Core migrations under Sources/Libraries/ProjectV.DataAccessLayer/Migrations/ to back the DAL integration tests.
  • Critical-path inventory doc at Docs/Testing/Coverage/test-coverage.md + scenarios overview docs under Docs/Testing/Scenarios/.
  • Recorded HTTP fixtures under Sources/Tests/Fixtures/{Tmdb,Omdb,Steam}/ (7 JSON files).

Approximate size: 124 files changed, +10880 / −99 (52 commits merged via PR #342).

Out of Scope

Tracking

  • PR linked from this issue once opened.
  • Closing summary will follow merge.

Metadata

Metadata

Assignees

Labels

area: TestsRelated to the teststype: Code MaintenanceNew feature/requirement which is targeting on improve architecture, realization and code style

Projects

Status

To do

Relationships

None yet

Development

No branches or pull requests

Issue actions