-
Notifications
You must be signed in to change notification settings - Fork 22
[FIX] Extract the required module names inside the read-writable context (CF-862) #935
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
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
…-global-definitions-deps
…h-ai/codeflash into fix/ctx-global-definitions-deps
tests/test_code_context_extractor.py
Outdated
|
|
||
| # In this scenario, the testgen code context is too long, so we abort. | ||
| with pytest.raises(ValueError, match="Testgen code context has exceeded token limit, cannot proceed"): | ||
| # In this scenario, the read-writable code context is too long because the __init_ function is reftencing the global x variable not the class attribute (x), so we abort. |
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.
typo
⚡️ Codeflash found optimizations for this PR📄 15% (0.15x) speedup for
|
|
@mohammedahmed18 wait where did you get the codeflash optimization? |
|
@aseembits93 from the extension by the git commit hook |
|
@mohammedahmed18 maybe we should add some identifier so we know when the optimizations are done via the VSC extension? |
this resolves two main issues:
1- the global definitions are not extracted inside the read-writable code context resulting frequently into mock variables when generating the tests which led to a failed optimization
2- when deciding for each function dependencies we conflict the class attributes with module-level variables if they have the same name, for example
it will say that MY_CLASS depends on the global definition
xwhich is not correct