Fix: Include generated tests in PR summaries#1972
Fix: Include generated tests in PR summaries#1972mohammedahmed18 wants to merge 2 commits intomainfrom
Conversation
**Bug:** Generated tests (with original_file_path=None) were excluded from PR summaries because the instrumented_to_original mapping only included tests with non-null original_file_path values. **Root Cause:** - Generated tests are created with original_file_path=None (function_optimizer.py:726) - PR creation code (create_pr.py:64) only built mappings for tests with original_file_path - Generated tests failed the "abs_path not in non_generated_tests" check (line 172) - Result: All generated test performance data silently dropped from PRs **Fix:** 1. Map generated tests to themselves in instrumented_to_original (lines 80-95) 2. Add generated tests to non_generated_tests set (lines 109-120) **Testing:** - Added unit test: test_instrumented_to_original_mapping_includes_generated_tests - Test verifies generated tests are included in mapping and mapped to themselves - All existing tests continue to pass **Trace IDs exhibiting bug:** 18b76e34, 1dc8fe2b, 49ee25f5, 566a701c, 62edaee5, 7ace9fad, df06c2dd, e913dcef, fa28833c Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
Codeflash Bot seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
|
Claude finished @mohammedahmed18's task in 3m 29s —— View job PR Review Summary
Prek Checksruff-format: Two mypy: The test file imported Both fixes pushed as commit Code ReviewDouble iteration over
Test duplicates production logic — No bugs or breaking changes found. The core fix (mapping generated tests to themselves and including them in Duplicate DetectionNo duplicates detected — the new logic is specific to Optimization PRsPR #1954 ( | |
TestType is defined in test_type module and only re-imported in models.py, so mypy strict mode requires importing it directly from the source. Co-authored-by: mohammed ahmed <undefined@users.noreply.github.com>
Problem
Generated tests with
original_file_path=Nonewere excluded from PR summaries, causing generated test performance data to be silently dropped.Root Cause
In
codeflash/result/create_pr.py:if registry_tf.original_file_path:check excluded generated tests from theinstrumented_to_originalmappingabs_path not in non_generated_testscheckEvidence from logs:
Affected trace IDs: 18b76e34, 1dc8fe2b, 49ee25f5, 566a701c, 62edaee5, 7ace9fad, df06c2dd, e913dcef, fa28833c
Solution
original_file_path=None, mapinstrumented_path → instrumented_pathinstead of skipping themTesting
test_instrumented_to_original_mapping_includes_generated_testsImpact
🤖 Generated with Claude Code