-
Notifications
You must be signed in to change notification settings - Fork 22
[FIX] Correctly resolve test files paths when adding runtime comments #831
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
[FIX] Correctly resolve test files paths when adding runtime comments #831
Conversation
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. |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
) | ||
abs_path = str(Path(inv_id.test_module_path.replace(".", os.sep)).with_suffix(".py").resolve().with_suffix("")) | ||
abs_path = tests_project_rootdir / Path(inv_id.test_module_path.replace(".", os.sep)).with_suffix(".py") | ||
abs_path = str(abs_path.resolve().with_suffix("")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might want to test with different test dirs, some which are a subdirectory of the module root some which are not. I remember i was using the test_dir early on but it didn't work for all scenarioes @mohammedahmed18
@mohammedahmed18 branch conflicts after pygls migration |
PR Type
Bug fix, Enhancement
this will fix the bug where runtime comments not shown in worktree mode

Description
Correct test path resolution for comments
Pass tests rootdir into runtime mapping
Simplify optimizer file/path initialization
Diagram Walkthrough
File Walkthrough
edit_generated_tests.py
Resolve test paths using provided tests rootdir
codeflash/code_utils/edit_generated_tests.py
beta.py
Simplify optimizer path setup in LSP init
codeflash/lsp/beta.py
function_optimizer.py
Provide tests rootdir to comment annotator
codeflash/optimization/function_optimizer.py
add_runtime_comments_to_generated_tests.