test: altimate tools — impact analysis DAG traversal and training import parsing#384
Conversation
…ort markdown parsing New tests for two recently added tools (impact_analysis, training_import) that had zero test coverage. These tools are user-facing and incorrect behavior leads to wrong blast radius assessments or silent data loss when importing team standards. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> https://claude.ai/code/session_01H7d93hQP5qAwYhLgRdkqhV
…stant import - Add severity boundary tests at exact thresholds (3→LOW, 4→MEDIUM, 10→MEDIUM, 11→HIGH) - Fix blast radius test to verify model_count drives denominator, not models.length - Import TRAINING_MAX_PATTERNS_PER_KIND instead of hardcoding 48 - Document that parseMarkdownSections includes empty sections (potential future fix) - Tighten empty-section assertion from toBeGreaterThanOrEqual to exact toBe https://claude.ai/code/session_01H7d93hQP5qAwYhLgRdkqhV
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
What does this PR do?
Adds 20 new tests for two recently added tools (
impact_analysis,training_import) from PR #350 that shipped with zero test coverage. Both tools are user-facing and handle complex input parsing where bugs could cause wrong decisions or silent data loss.1.
ImpactAnalysisTool—src/altimate/tools/impact-analysis.ts(10 new tests)This tool analyzes downstream impact of dbt model/column changes across the DAG. Zero tests existed despite containing a recursive DAG traversal algorithm (
findDownstream) and severity classification logic. New coverage includes:depends_onreferences (e.g.project.stg_orders→stg_orders)2.
TrainingImportTool—src/altimate/tools/training-import.ts(10 new tests)This tool imports training entries from markdown documents (style guides, glossaries). Zero tests existed despite a markdown parser (
parseMarkdownSections) and capacity enforcement logic. New coverage includes:max_entrieslimit enforcementTRAINING_MAX_PATTERNS_PER_KINDTrainingStore.savecalled for each entryType of change
Issue for this PR
N/A — proactive test coverage for tools added in #350
How did you verify your code works?
Both test files use
spyOnto mockDispatcher.call,TrainingStore,TrainingPrompt, andfs.readFile— no external dependencies, no flakiness risk.Checklist
https://claude.ai/code/session_01H7d93hQP5qAwYhLgRdkqhV