Commit graph

13 commits

Author SHA1 Message Date
Mohamed Ashraf
217544f99e fix: handle multi-line include directives in settings.gradle
The regex for extracting modules from settings.gradle only matched
single-line include statements. Multi-line includes like eureka's
(include 'a',\n 'b',\n 'c') only captured the first module, causing
test_module to be None and breaking multi-module path resolution
(e.g., classfiles lookup for JaCoCo coverage conversion).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-07 15:03:32 +00:00
HeshamHM28
1fde200bc4 fix: improve multi-module Gradle detection for dynamic settings.gradle.kts
- Parse listOf(...) patterns in settings.gradle.kts for projects that
  build include lists dynamically (e.g. OpenRewrite)
- Use word boundary in include regex to avoid matching variable names
  like 'includedProjects'
- Break module voting ties using codeflash.toml module-root config,
  so the function's own module is preferred over cross-module tests

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 11:08:16 +00:00
HeshamHM28
ba36a1f7b2 fix jar file problems 2026-03-18 05:47:56 +02:00
HeshamHM28
6b2a852d79 fix running tests 2026-03-18 05:29:00 +02:00
HeshamHM28
cd0e19396c fix multi_root 2026-03-18 04:24:16 +02:00
HeshamHM28
3aea9397fe Refactor Maven strategy for Codeflash integration
- Added functions to install the Codeflash runtime and manage its dependency in the Maven POM file.
- Implemented JaCoCo plugin addition and configuration for test coverage.
- Enhanced XML parsing for POM files to support both namespaced and non-namespaced formats.
- Updated test cases to reflect changes in dependency management and plugin configuration.
- Removed obsolete runtime jar finding logic and consolidated module detection for both Maven and Gradle projects.
- Improved input validation for test run commands.
2026-03-10 04:14:55 +02:00
misrasaurabh1
9367a86771 fix: remove dead Java path-fixing code from base FunctionOptimizer
The base class had duplicate _get_java_sources_root and _fix_java_test_paths
methods that were overridden by JavaFunctionOptimizer. The base class also
had an is_java() block in generate_and_instrument_tests that used undefined
variables (used_behavior_paths, is_java). Removed all dead code since
JavaFunctionOptimizer.fixup_generated_tests handles this properly.

Also updated JavaFunctionOptimizer._fix_java_test_paths to accept
display_source parameter and use whole-word rename for collision handling.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 01:02:24 -08:00
misrasaurabh1
6ec4db446c Merge remote-tracking branch 'origin/omni-java' into generated-tests-in-pr
# Conflicts:
#	codeflash/languages/java/instrumentation.py
#	codeflash/optimization/function_optimizer.py
#	codeflash/verification/verifier.py
#	codeflash/version.py
#	tests/test_languages/test_java/test_instrumentation.py
#	tests/test_languages/test_java/test_java_test_paths.py
2026-03-04 00:26:46 -08:00
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
misrasaurabh1
6ad0d8b92b fix how tests looks like when PR is created 2026-03-03 14:47:25 -08: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
f4344914d9 feat(06-02): enhance Maven infrastructure with XML parsing, profiles, and custom source dirs
- Replace regex-based module extraction with proper XML parser (_extract_modules_from_pom_content)
- Add Maven profile support via CODEFLASH_MAVEN_PROFILES env var in _run_maven_tests and _compile_tests
- Extend _path_to_class_name with optional custom source directory support
- Add _extract_source_dirs_from_pom to parse custom source/test directories from pom.xml
- Add comprehensive tests for all new functionality (27 new tests)
2026-02-06 13:39:47 +00:00
HeshamHM28
c5c56e764b Fix Java test path duplication when tests_root includes package path 2026-02-03 05:19:48 +02:00