Skip to content

Comments

fix: resolve test file paths in discover_tests_pytest to fix path com…#1605

Merged
KRRT7 merged 3 commits intomainfrom
fix-tracer-replay-discovery
Feb 20, 2026
Merged

fix: resolve test file paths in discover_tests_pytest to fix path com…#1605
KRRT7 merged 3 commits intomainfrom
fix-tracer-replay-discovery

Conversation

@KRRT7
Copy link
Collaborator

@KRRT7 KRRT7 commented Feb 20, 2026

…parison

@codeflash-ai
Copy link
Contributor

codeflash-ai bot commented Feb 20, 2026

⚡️ Codeflash found optimizations for this PR

📄 138% (1.38x) speedup for add_runtime_comments in codeflash/languages/javascript/edit_tests.py

⏱️ Runtime : 11.3 milliseconds 4.74 milliseconds (best of 250 runs)

A dependent PR with the suggested changes has been created. Please review:

If you approve, it will be merged into this PR (branch fix-tracer-replay-discovery).

Static Badge

@KRRT7 KRRT7 force-pushed the fix-tracer-replay-discovery branch from 86fa982 to 6f9648d Compare February 20, 2026 13:42
@codeflash-ai codeflash-ai deleted a comment from claude bot Feb 20, 2026
@KRRT7 KRRT7 force-pushed the fix-tracer-replay-discovery branch from 6f9648d to a02e8a3 Compare February 20, 2026 13:45
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@KRRT7 KRRT7 marked this pull request as ready for review February 20, 2026 14:15
@codeflash-ai codeflash-ai deleted a comment from claude bot Feb 20, 2026
@KRRT7 KRRT7 merged commit 8d25bcc into main Feb 20, 2026
27 of 30 checks passed
@KRRT7 KRRT7 deleted the fix-tracer-replay-discovery branch February 20, 2026 14:16
@claude
Copy link
Contributor

claude bot commented Feb 20, 2026

PR Review Summary

Prek Checks

✅ All checks passed — no formatting or linting issues found.

Mypy

✅ No new type errors introduced by this PR. Pre-existing errors in unchanged code are unrelated.

Code Review

✅ No critical bugs, security vulnerabilities, or breaking API changes found.

Changes reviewed:

  • discover_unit_tests.py: Path comparison fix — resolves both discover_only_these_tests and test["test_file"] paths before comparison. This correctly fixes the path mismatch issue.
  • time_utils.py: format_runtime_comment extracted from JS-specific edit_tests.py into shared utility with configurable comment_prefix parameter (# default for Python, // for JS).
  • edit_tests.py: Clean removal of duplicated function, now imports from time_utils.
  • code_replacer.py: Removal of OptimFunctionCollector and OptimFunctionReplacer classes — confirmed no remaining references in codebase.
  • cli.py: _handle_show_config now reads actual config file when available, falls back to auto-detection otherwise.
  • test_code_replacement.py: Removed tests for deleted OptimFunctionCollector class.

Test Coverage

File Main PR Change
codeflash/cli_cmds/cli.py 39% 43% +4% ✅
codeflash/code_utils/time_utils.py 99% 95% -4% ⚠️
codeflash/discovery/discover_unit_tests.py 74% 75% +1% ✅
codeflash/languages/javascript/edit_tests.py N/A N/A
codeflash/languages/python/static_analysis/code_replacer.py 76% 84% +8% ✅
tests/test_code_replacement.py 96% 95% -1%
Overall 78% 79% +1%

Notes:

  • time_utils.py coverage dropped from 99% → 95% because the new format_runtime_comment function (5 statements) is not exercised by any Python test. It is only called from edit_tests.py (JavaScript support), which has no test coverage. Consider adding a unit test for format_runtime_comment.
  • code_replacer.py coverage improved (+8%) due to removal of 143 lines of dead code.
  • edit_tests.py (JavaScript) has no test coverage on either branch.
  • 8 test failures in test_tracer.py are pre-existing on main — not related to this PR.

Last updated: 2026-02-20

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants