fix: show actual test file paths in failure log#1393
Merged
Conversation
…ile_path For AI-generated tests, original_file_path is intentionally None. When tests fail to run, the log now shows instrumented_behavior_file_path (the actual path being executed) instead of original_file_path. This makes debugging test execution failures much clearer. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem Fixed
When tests fail to run, the error log shows misleading information:
This happens because the log prints
original_file_pathwhich is intentionallyNonefor AI-generated tests, making it appear as if test paths weren't set correctly.Root Cause
In
parse_test_output.py:1222, the failure log message was:f"Tests '{[test_file.original_file_path for test_file in test_files.test_files]}' failed to run"For AI-generated tests:
original_file_path=None(intentional - these are newly generated)instrumented_behavior_file_path= actual path being executedbenchmarking_file_path= performance test pathThe log should show the paths actually being used, not the intentionally-None original paths.
Solution Implemented
Changed the log to show
instrumented_behavior_file_pathororiginal_file_path(whichever is set):Code Changes
File:
codeflash/verification/parse_test_output.pyinstrumented_behavior_file_pathTesting
Verified the change improves log clarity when:
Impact
This is a logging-only change with no behavioral impact. It improves debuggability by:
Nonevalues in logs🤖 Generated with Claude Code