-
Notifications
You must be signed in to change notification settings - Fork 18
Function optimizer refactor #10
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
…_passes Test perf only after behavior passes
…x' into function-optimizer-refactor
added E2E testing for my bug fix here If you don't mind, one thing you should look into, is that when whenever we CTRL+C, on main it properly cleans up test file paths, with these changes, no cleanup is done, we don't want to leave around test files due to a crash. |
still having issues when running on codebases, even though e2e tests pass. will check further |
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.
i hope you've tested this well.
for test_file in function_optimizer.test_files.get_by_type(TestType.GENERATED_REGRESSION).test_files: | ||
test_file.instrumented_behavior_file_path.unlink(missing_ok=True) | ||
test_file.benchmarking_file_path.unlink(missing_ok=True) | ||
for test_file in function_optimizer.test_files.get_by_type(TestType.EXISTING_UNIT_TEST).test_files: | ||
test_file.instrumented_behavior_file_path.unlink(missing_ok=True) | ||
test_file.benchmarking_file_path.unlink(missing_ok=True) | ||
for test_file in function_optimizer.test_files.get_by_type(TestType.CONCOLIC_COVERAGE_TEST).test_files: | ||
test_file.instrumented_behavior_file_path.unlink(missing_ok=True) | ||
if function_optimizer.test_cfg.concolic_test_root_dir: | ||
shutil.rmtree(function_optimizer.test_cfg.concolic_test_root_dir, ignore_errors=True) |
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.
nitpick: we have cleanup_paths within codeutils, let's use it for this, thought it has to be updated to handle directories
for generated_test_path in generated_test_paths: | ||
generated_test_path.unlink(missing_ok=True) | ||
for generated_perf_test_path in generated_perf_test_paths: | ||
generated_perf_test_path.unlink(missing_ok=True) | ||
for test_paths in instrumented_unittests_created_for_function: | ||
test_paths.unlink(missing_ok=True) | ||
for fn in function_to_concolic_tests: | ||
for test in function_to_concolic_tests[fn]: | ||
if not test.tests_in_file.test_file.parent.exists(): | ||
logger.warning( | ||
f"Concolic test directory {test.tests_in_file.test_file.parent} does not exist so could not be deleted." | ||
) | ||
shutil.rmtree(test.tests_in_file.test_file.parent, ignore_errors=True) | ||
break # need to delete only one test directory | ||
|
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.
same as above.
# Conflicts: # codeflash/optimization/optimizer.py
No description provided.