You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Checked out branch fix/java/asserts, built the codeflash-java-runtime JAR, and ran E2E Java optimizations against the default test project (code_to_optimize/java/).
Steps
Built codeflash-java-runtime JAR: mvn clean package -q -DskipTests — passed
Built Java test project: mvn clean install — passed (after removing stale instrumented files from prior runs)
Crashed on function 5 (StringUtils.countOccurrences) with InvalidJavaSyntaxError — this is a pre-existing issue in Java context extraction, not related to this PR
Issues Found
3 failing unit tests in test_instrumentation.py
The following tests fail because the PR updated the expected outputs for instrument_existing_test to include assertion transformation (Object _cf_result1 = calc.add(2, 2) instead of assertEquals(4, calc.add(2, 2))), but the actual instrument_existing_test function was not updated to call transform_java_assertions.
Root cause: The PR changed instrument_generated_java_test (line ~817) to always call transform_java_assertions, but instrument_existing_test (line ~314) was not updated with the same call. The test expectations were updated to assume assertions would be transformed in existing tests too, but the implementation doesn't match.
Fix needed: Either:
(a) Add transform_java_assertions call inside instrument_existing_test to match the updated test expectations, or
(b) Revert the test expectation changes for the 3 failing tests
E2E optimization: Passed with observations
Fibonacci tests were processed correctly (behavior and performance instrumentation worked)
StringUtils.capitalizeWords optimization completed end-to-end — 332% speedup, all correctness tests passed, marked as success
2116 test cases were skipped during result parsing — these were existing test FibonacciTest and StringUtilsTest cases that couldn't be resolved against the registered instrumented files. This appears to be an existing behavior, not a regression from this PR.
Crash on countOccurrences: InvalidJavaSyntaxError due to missing closing brace in extracted Java code — pre-existing context extraction bug, not related to this PR.
Summary
Check
Status
JAR build
✅ Pass
Java project build/tests
✅ Pass
Unit tests (assertion removal + new test file)
✅ 191 passed
Unit tests (instrumentation)
❌ 3 failed — instrument_existing_test not updated
E2E optimization (Fibonacci pipeline)
✅ Pass
E2E optimization (StringUtils.capitalizeWords)
✅ Pass — 332% speedup
E2E crash (countOccurrences)
⚠️ Pre-existing bug, not PR-related
Verdict: The core assertion removal logic and generated test instrumentation work correctly. The 3 failing instrumentation tests need to be fixed before merge — either by adding transform_java_assertions to instrument_existing_test or by reverting the test expectations.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.