Files
gridpilot.gg/plans/test_gap_analysis.md
Marc Mintel 9bb6b228f1
Some checks failed
CI / lint-typecheck (pull_request) Failing after 4m50s
CI / tests (pull_request) Has been skipped
CI / contract-tests (pull_request) Has been skipped
CI / e2e-tests (pull_request) Has been skipped
CI / comment-pr (pull_request) Has been skipped
CI / commit-types (pull_request) Has been skipped
integration tests
2026-01-23 23:46:03 +01:00

3.8 KiB

Test Coverage Analysis & Gap Report

1. Executive Summary

We have compared the existing E2E and Integration tests against the core concepts defined in docs/concept/ and the testing principles in docs/TESTING_LAYERS.md.

While the functional coverage is high, there are critical gaps in Integration Testing specifically regarding external boundaries (iRacing API) and specific infrastructure-heavy business logic (Rating Engine).

2. Concept vs. Test Mapping

Concept Area E2E Coverage Integration Coverage Status
League Management leagues/ leagues/ Covered
Season/Schedule leagues/league-schedule.spec.ts leagues/schedule/ Covered
Results Import races/race-results.spec.ts races/results/ ⚠️ Missing iRacing API Integration
Complaints/Penalties leagues/league-stewarding.spec.ts races/stewarding/ Covered
Team Competition teams/ teams/ Covered
Driver Profile/Stats drivers/ drivers/profile/ Covered
Rating System None None Missing
Social/Messaging None None Missing

3. Identified Gaps in Integration Tests

According to docs/TESTING_LAYERS.md, integration tests should protect environmental correctness (DB, external APIs, Auth).

🚨 Critical Gaps (Infrastructure/Boundaries)

  1. iRacing API Integration:
    • Concept: docs/concept/ADMINS.md (Automatic Results Import).
    • Gap: We have tests for displaying results, but no integration tests verifying the actual handshake and parsing logic with the iRacing API boundary.
  2. Rating Engine Persistence:
    • Concept: docs/concept/RATING.md (GridPilot Rating).
    • Gap: The rating system involves complex calculations that must be persisted correctly. We lack integration tests for the RatingService interacting with the DB.
  3. Auth/Identity Provider:
    • Concept: docs/concept/CONCEPT.md (Safety, Security & Trust).
    • Gap: No integration tests for the Auth boundary (e.g., JWT validation, session persistence).

🛠 Functional Gaps (Business Logic Integration)

  1. Social/Messaging:
    • Concept: docs/concept/SOCIAL.md (Messaging, Notifications).
    • Gap: No integration tests for message persistence or notification delivery (queues).
  2. Constructors-Style Scoring:
    • Concept: docs/concept/RACING.md (Constructors-Style Points).
    • Gap: While we have StandingsCalculation.test.ts, we need specific integration tests for complex multi-driver team scoring scenarios against the DB.

4. Proposed Action Plan

  1. Implement iRacing API Contract/Integration Tests: Verify the parsing of iRacing result payloads.
  2. Add Rating Persistence Tests: Ensure GridPilot Rating updates correctly in the DB after race results are processed.
  3. Add Social/Notification Integration: Test the persistence of messages and the triggering of notifications.
  4. Auth Integration: Verify the system-level Auth flow as per the "Trust" requirement.

Uncle Bob's Note: Remember, the closer a test is to the code, the more of them you should have. But for the system to be robust, the boundaries must be ironclad.