altimate-code icon indicating copy to clipboard operation
altimate-code copied to clipboard

chore: consolidate redundant tracing test files (~5,000 LOC savings)

Open anandgupta42 opened this issue 8 months ago • 0 comments

Summary

The tracing test suite has 11 test files with 70-80% overlap (318 tests, ~9,000 lines). These were created through iterative development cycles without deduplication and can be consolidated to ~5 files, saving ~5,000 lines and reducing test runtime.

Redundant Files Identified

Adversarial/Robustness Tests (5 files → 1-2 files)

  • tracing-adversarial.test.ts (39 tests, 973 lines)
  • tracing-adversarial-2.test.ts (32 tests, 843 lines)
  • tracing-adversarial-final.test.ts (21 tests, 633 lines)
  • tracing-adversarial-snapshot.test.ts (21 tests, 652 lines)
  • tracing-thorough.test.ts (41 tests, 692 lines)

All 5 test the same patterns: null/undefined handling, malformed values, extreme scale, concurrent access, sessionId edge cases, exporter robustness.

Audit Tests (2 files → 1 file)

  • tracing-final-audit.test.ts (43 tests, 802 lines)
  • tracing-thorough.test.ts (41 tests, 692 lines)

Nearly identical — both are "line-by-line code audit findings" with the same test patterns.

E2E/Integration Tests (2 files → 1 file)

  • tracing-e2e.test.ts (17 tests, 780 lines)
  • tracing-integration.test.ts (15 tests, 691 lines)

40-50% thematic overlap (both test full write→read→export pipeline).

Expected Impact

  • Files removed: 5-6
  • Lines saved: ~5,000 LOC
  • Runtime reduction: 30-50% on tracing tests
  • Coverage loss: Zero (consolidation only)

Context

Identified during the test flakiness/speed audit in the PR that fixed flaky tests and sped up the slow test suite.

anandgupta42 avatar Mar 18 '26 05:03 anandgupta42