Commit graph

3 commits

Author SHA1 Message Date
Kevin Turcios
eceac13fc3 Merge remote-tracking branch 'origin/main' into omni-java
# Conflicts:
#	.claude/rules/architecture.md
#	.claude/rules/code-style.md
#	.github/workflows/claude.yml
#	.github/workflows/duplicate-code-detector.yml
#	codeflash/api/aiservice.py
#	codeflash/cli_cmds/console.py
#	codeflash/cli_cmds/logging_config.py
#	codeflash/code_utils/deduplicate_code.py
#	codeflash/discovery/discover_unit_tests.py
#	codeflash/languages/base.py
#	codeflash/languages/code_replacer.py
#	codeflash/languages/javascript/mocha_runner.py
#	codeflash/languages/javascript/support.py
#	codeflash/languages/python/support.py
#	codeflash/optimization/function_optimizer.py
#	codeflash/verification/parse_test_output.py
#	codeflash/verification/verification_utils.py
#	codeflash/verification/verifier.py
#	packages/codeflash/package-lock.json
#	packages/codeflash/package.json
#	tests/languages/javascript/test_support_dispatch.py
#	tests/test_codeflash_capture.py
#	tests/test_languages/test_javascript_test_runner.py
#	tests/test_multi_file_code_replacement.py
2026-03-04 01:52:32 -05:00
Kevin Turcios
f7fd593de3 fix: resolve remaining test failures after main sync
- Fix min/max_outer_loops → pytest_min/max_loops in Java test_run_and_parse
- Update test_replacement.py for new replace_function_definitions_for_language API
- Update JavaSupport.discover_functions signature to match protocol
- Migrate _get_java_sources_root/_fix_java_test_paths to JavaFunctionOptimizer
- Fix test_java_tests_project_rootdir to use set_current_language
2026-03-02 15:47:23 -05:00
Mohamed Ashraf
a582fa6ea8 fix: set tests_project_rootdir to tests_root for Java projects
Bug #2: Test file name mapping returns null for Java tests

Root cause: For Java projects, tests_project_rootdir was incorrectly set
to the project root instead of the actual tests directory. This caused
test file resolution to fail in parse_test_xml when parsing JUnit XML
from Maven Surefire, which doesn't include file attributes.

JavaScript already had this fix (line 654), but Java was missing it.

Fix: Add Java to the language check that sets tests_project_rootdir
equal to tests_root, ensuring instrumented test files can be found at
src/test/java/com/example/Test__perfinstrumented.java

Changes:
- Added is_java import to discover_unit_tests.py
- Added Java check: if is_java(): cfg.tests_project_rootdir = cfg.tests_root
- Added comprehensive test coverage with 2 test cases

Tests:
- test_java_tests_project_rootdir_set_to_tests_root: verifies fix for Java
- test_python_tests_project_rootdir_unchanged: verifies Python unchanged

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-04 00:04:23 +00:00