-
Notifications
You must be signed in to change notification settings - Fork 22
[LSP] log the errors from the failed behavior test results (CF-757) #830
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
|
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:
|
| ) | ||
|
|
||
| try: | ||
| benchmarking_results, _ = self.run_and_parse_tests( |
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.
_ is needed
Co-authored-by: codeflash-ai[bot] <148906541+codeflash-ai[bot]@users.noreply.github.com>
|
This PR is now faster! 🚀 mohammed ahmed accepted my code suggestion above. |
| did_pass_all_tests = all(result.did_pass for result in behavioral_results) | ||
| if not did_pass_all_tests: | ||
| return Failure("Tests failed to pass for the original code.") |
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.
we're not quite good with our tests to where this is going to work smoothly, currently we have tests that fail frequently
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.
so you are saying if the coverage wasn't enough, and some tests failed,
optimization didn't fail necessary because of failed tests? and what do you suggest instead ? @KRRT7
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.
yeah that's correct, if we don't have good tests then the optimizations will fail, let's merge this in and I'll work on this
| def extract_unique_errors(pytest_output: str) -> set[str]: | ||
| unique_errors = set() | ||
|
|
||
| # Regex pattern to match error lines: | ||
| # - Start with 'E' followed by optional whitespace | ||
| # - Capture the actual error message | ||
| pattern = r"^E\s+(.*)$" |
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.
codeflash should've found an optimization here
User description
PR Type
Enhancement
Description
Log unique pytest error lines to LSP
Add error extraction utility function
Improve baseline failure messaging
Adjust performance tests return handling
Diagram Walkthrough
File Walkthrough
code_utils.py
Utility to extract unique pytest error linescodeflash/code_utils/code_utils.py
extract_unique_errors(pytest_output)Efunction_optimizer.py
Log behavior test errors and refine test flowcodeflash/optimization/function_optimizer.py
extract_unique_errorsfor LSP logginglsp_logwhen behavior tests fail