codeflash-agent/packages/codeflash-python/tests
Kevin Turcios eb6a0be717 feat: add dual-clock instrumentation (wall + CPU time) and remove dead binary parser
Measure both wall-clock time (perf_counter_ns) and CPU thread time
(thread_time_ns) in instrumented test code. cpu_runtime is now a required
int field on FunctionTestInvocation, stored in the SQLite test_results
table as a 10th column.

Also fixes the sleeptime.py bug (10e9 → 1e9 divisor) and removes the
binary pickle parser (parse_test_return_values_bin) since no writer
exists in the current codebase — SQLite is the sole data capture path.
2026-04-24 02:21:22 -05:00
..
code_to_optimize feat: add dual-clock instrumentation (wall + CPU time) and remove dead binary parser 2026-04-24 02:21:22 -05:00
e2e Fix CI: mypy errors, ruff formatting, switch to prek (#22) 2026-04-15 02:52:47 -05:00
conftest.py Merge main-teammate branch 2026-04-03 17:36:50 -05:00
pyproject.toml Merge main-teammate branch 2026-04-03 17:36:50 -05:00
test_add_needed_imports_from_module.py Merge main-teammate branch 2026-04-03 17:36:50 -05:00
test_add_runtime_comments.py feat: add dual-clock instrumentation (wall + CPU time) and remove dead binary parser 2026-04-24 02:21:22 -05:00
test_api_config.py Merge main-teammate branch 2026-04-03 17:36:50 -05:00
test_api_session.py Merge main-teammate branch 2026-04-03 17:36:50 -05:00
test_async_concurrency_decorator.py squash 2026-04-13 14:12:17 -05:00
test_async_function_discovery.py Merge main-teammate branch 2026-04-03 17:36:50 -05:00
test_async_run_and_parse_tests.py Merge main-teammate branch 2026-04-03 17:36:50 -05:00
test_async_wrapper_sqlite_validation.py Merge main-teammate branch 2026-04-03 17:36:50 -05:00
test_baseline.py feat: add dual-clock instrumentation (wall + CPU time) and remove dead binary parser 2026-04-24 02:21:22 -05:00
test_benchmark_merge_test_results.py feat: add dual-clock instrumentation (wall + CPU time) and remove dead binary parser 2026-04-24 02:21:22 -05:00
test_benchmark_worker.py Add unit tests for _benchmark_worker subprocess script 2026-04-23 02:31:38 -05:00
test_benchmarking.py Merge main-teammate branch 2026-04-03 17:36:50 -05:00
test_call_graph.py Merge main-teammate branch 2026-04-03 17:36:50 -05:00
test_candidate_eval.py feat: add dual-clock instrumentation (wall + CPU time) and remove dead binary parser 2026-04-24 02:21:22 -05:00
test_candidate_gen.py Add unit tests for _candidate_gen (generate, repair, refinement) 2026-04-23 02:23:52 -05:00
test_cleanup_instrumented_files.py Merge main-teammate branch 2026-04-03 17:36:50 -05:00
test_code_context_extractor.py fix: deduplicate code across codeflash-core and codeflash-python 2026-04-23 22:39:50 -05:00
test_code_deduplication.py Merge main-teammate branch 2026-04-03 17:36:50 -05:00
test_code_extractor_none_aliases_exact.py Merge main-teammate branch 2026-04-03 17:36:50 -05:00
test_code_replacement.py Merge main-teammate branch 2026-04-03 17:36:50 -05:00
test_code_replacer_matching.py Merge main-teammate branch 2026-04-03 17:36:50 -05:00
test_code_utils.py squash 2026-04-13 14:12:17 -05:00
test_code_utils_config.py Merge main-teammate branch 2026-04-03 17:36:50 -05:00
test_codeflash_capture.py squash 2026-04-13 14:12:17 -05:00
test_codeflash_checkpoint.py Merge main-teammate branch 2026-04-03 17:36:50 -05:00
test_codeflash_trace_decorator.py Merge main-teammate branch 2026-04-03 17:36:50 -05:00
test_comparator.py feat: add dual-clock instrumentation (wall + CPU time) and remove dead binary parser 2026-04-24 02:21:22 -05:00
test_concolic.py Merge main-teammate branch 2026-04-03 17:36:50 -05:00
test_coverage.py Merge main-teammate branch 2026-04-03 17:36:50 -05:00
test_cpu_runtime.py feat: add dual-clock instrumentation (wall + CPU time) and remove dead binary parser 2026-04-24 02:21:22 -05:00
test_create_pr.py Add unit tests for _create_pr (PR creation, suggestion, error paths) 2026-04-23 02:24:01 -05:00
test_critic.py feat: add dual-clock instrumentation (wall + CPU time) and remove dead binary parser 2026-04-24 02:21:22 -05:00
test_dependencies.py Merge main-teammate branch 2026-04-03 17:36:50 -05:00
test_discovery.py squash 2026-04-13 14:12:17 -05:00
test_discovery_worker.py Add unit tests for _discovery_worker (collection parsing, plugin) 2026-04-23 02:28:23 -05:00
test_early_dedup.py Merge main-teammate branch 2026-04-03 17:36:50 -05:00
test_enrichment.py fix: deduplicate code across codeflash-core and codeflash-python 2026-04-23 22:39:50 -05:00
test_eval_worktree.py fix: resolve all ruff lint errors across repo (#38) 2026-04-23 10:22:42 -05:00
test_existing_tests_source_for.py Merge main-teammate branch 2026-04-03 17:36:50 -05:00
test_extraction.py Merge main-teammate branch 2026-04-03 17:36:50 -05:00
test_fallback.py Merge main-teammate branch 2026-04-03 17:36:50 -05:00
test_file_to_no_of_tests.py feat: add dual-clock instrumentation (wall + CPU time) and remove dead binary parser 2026-04-24 02:21:22 -05:00
test_formatter.py Merge main-teammate branch 2026-04-03 17:36:50 -05:00
test_function_dependencies.py Merge main-teammate branch 2026-04-03 17:36:50 -05:00
test_function_discovery.py squash 2026-04-13 14:12:17 -05:00
test_function_optimizer.py fix: resolve all ruff lint errors across repo (#38) 2026-04-23 10:22:42 -05:00
test_function_ranker.py Merge main-teammate branch 2026-04-03 17:36:50 -05:00
test_function_ranking.py Merge main-teammate branch 2026-04-03 17:36:50 -05:00
test_get_code.py Merge main-teammate branch 2026-04-03 17:36:50 -05:00
test_get_helper_code.py Merge main-teammate branch 2026-04-03 17:36:50 -05:00
test_get_read_only_code.py Merge main-teammate branch 2026-04-03 17:36:50 -05:00
test_get_read_writable_code.py Merge main-teammate branch 2026-04-03 17:36:50 -05:00
test_get_testgen_code.py Merge main-teammate branch 2026-04-03 17:36:50 -05:00
test_helpers.py Merge main-teammate branch 2026-04-03 17:36:50 -05:00
test_humanize_time.py Merge main-teammate branch 2026-04-03 17:36:50 -05:00
test_imports.py Merge main-teammate branch 2026-04-03 17:36:50 -05:00
test_inject_profiling_used_frameworks.py feat: add dual-clock instrumentation (wall + CPU time) and remove dead binary parser 2026-04-24 02:21:22 -05:00
test_instrument_all_and_run.py feat: add dual-clock instrumentation (wall + CPU time) and remove dead binary parser 2026-04-24 02:21:22 -05:00
test_instrument_async_tests.py Merge main-teammate branch 2026-04-03 17:36:50 -05:00
test_instrument_codeflash_capture.py Merge main-teammate branch 2026-04-03 17:36:50 -05:00
test_instrument_codeflash_trace.py Merge main-teammate branch 2026-04-03 17:36:50 -05:00
test_instrument_line_profiler.py Merge main-teammate branch 2026-04-03 17:36:50 -05:00
test_instrument_tests.py feat: add dual-clock instrumentation (wall + CPU time) and remove dead binary parser 2026-04-24 02:21:22 -05:00
test_instrumentation.py Move AI-generated test instrumentation from server-side to client-side 2026-04-21 07:38:48 -05:00
test_instrumentation_run_results_aiservice.py Merge main-teammate branch 2026-04-03 17:36:50 -05:00
test_is_numerical_code.py Merge main-teammate branch 2026-04-03 17:36:50 -05:00
test_line_profiling.py Merge main-teammate branch 2026-04-03 17:36:50 -05:00
test_lru_cache_clear.py Merge main-teammate branch 2026-04-03 17:36:50 -05:00
test_merge_test_results.py feat: add dual-clock instrumentation (wall + CPU time) and remove dead binary parser 2026-04-24 02:21:22 -05:00
test_merge_tests.py Remove unittest framework support from Python test pipeline 2026-04-21 06:41:41 -05:00
test_mock_candidate_replacement.py Merge main-teammate branch 2026-04-03 17:36:50 -05:00
test_model.py Merge main-teammate branch 2026-04-03 17:36:50 -05:00
test_model_test_results.py feat: add dual-clock instrumentation (wall + CPU time) and remove dead binary parser 2026-04-24 02:21:22 -05:00
test_module_prep.py Merge main-teammate branch 2026-04-03 17:36:50 -05:00
test_multi_file_code_replacement.py Merge main-teammate branch 2026-04-03 17:36:50 -05:00
test_normalize_ignore_paths.py Merge main-teammate branch 2026-04-03 17:36:50 -05:00
test_normalizer.py test: add 262 tests for previously untested core modules 2026-04-24 01:36:14 -05:00
test_orchestration.py Merge main-teammate branch 2026-04-03 17:36:50 -05:00
test_orchestrator.py Merge main-teammate branch 2026-04-03 17:36:50 -05:00
test_parallel_eval_integration.py feat: add dual-clock instrumentation (wall + CPU time) and remove dead binary parser 2026-04-24 02:21:22 -05:00
test_parse_pytest_test_failures.py squash 2026-04-13 14:12:17 -05:00
test_parse_results.py feat: add dual-clock instrumentation (wall + CPU time) and remove dead binary parser 2026-04-24 02:21:22 -05:00
test_parse_test_output_regex.py squash 2026-04-13 14:12:17 -05:00
test_pickle_patcher.py Merge main-teammate branch 2026-04-03 17:36:50 -05:00
test_pipeline.py Merge main-teammate branch 2026-04-03 17:36:50 -05:00
test_post_selection.py Fix CI: mypy errors, ruff formatting, switch to prek (#22) 2026-04-15 02:52:47 -05:00
test_pruning.py Merge main-teammate branch 2026-04-03 17:36:50 -05:00
test_pytest_plugin.py Merge main-teammate branch 2026-04-03 17:36:50 -05:00
test_pytest_plugin_deterministic_patches.py Merge main-teammate branch 2026-04-03 17:36:50 -05:00
test_ranking.py Add tests for error handling paths in ranking, refinement, and state 2026-04-23 03:13:23 -05:00
test_ranking_boost.py fix: resolve all ruff lint errors across repo (#38) 2026-04-23 10:22:42 -05:00
test_reference_graph.py Merge main-teammate branch 2026-04-03 17:36:50 -05:00
test_refinement.py Add tests for error handling paths in ranking, refinement, and state 2026-04-23 03:13:23 -05:00
test_remove_functions_from_generated_tests.py Merge main-teammate branch 2026-04-03 17:36:50 -05:00
test_remove_test_functions.py Merge main-teammate branch 2026-04-03 17:36:50 -05:00
test_remove_unused_definitions.py Merge main-teammate branch 2026-04-03 17:36:50 -05:00
test_replacement.py Merge main-teammate branch 2026-04-03 17:36:50 -05:00
test_replay_discovery.py Merge main-teammate branch 2026-04-03 17:36:50 -05:00
test_state.py Add tests for error handling paths in ranking, refinement, and state 2026-04-23 03:13:23 -05:00
test_static_analysis.py Merge main-teammate branch 2026-04-03 17:36:50 -05:00
test_subprocess_runners.py Merge main-teammate branch 2026-04-03 17:36:50 -05:00
test_tabulate.py Add unit tests for vendored _tabulate module 2026-04-23 02:31:38 -05:00
test_test_discovery.py Fix test discovery for src-layout projects with module_root=src 2026-04-21 06:18:27 -05:00
test_test_linking.py Remove unittest framework support from Python test pipeline 2026-04-21 06:41:41 -05:00
test_test_runner.py Fix unawaited coroutine warning in test_default_timeout_is_600 2026-04-23 04:46:32 -05:00
test_testgen.py fix: resolve all ruff lint errors across repo (#38) 2026-04-23 10:22:42 -05:00
test_trace_benchmarks.py Merge main-teammate branch 2026-04-03 17:36:50 -05:00
test_trace_db.py Add unit tests for _trace_db (sanitize, trace queries, run time) 2026-04-23 02:23:56 -05:00
test_tracer.py squash 2026-04-13 14:12:17 -05:00
test_tracing.py squash 2026-04-13 14:12:17 -05:00
test_unit_test_discovery.py Merge main-teammate branch 2026-04-03 17:36:50 -05:00
test_unused_helper_revert.py Merge main-teammate branch 2026-04-03 17:36:50 -05:00
test_validate_python_code.py Merge main-teammate branch 2026-04-03 17:36:50 -05:00
test_verification.py feat: add dual-clock instrumentation (wall + CPU time) and remove dead binary parser 2026-04-24 02:21:22 -05:00
test_version_check.py Merge main-teammate branch 2026-04-03 17:36:50 -05:00