test: add integration tests for test_results schema validation#1273
Merged
Conversation
Added comprehensive integration tests to validate that the Java Comparator correctly reads from the test_results table schema. New test class: TestTestResultsTableSchema with 5 tests: - test_comparator_reads_test_results_table_identical Validates identical results are correctly compared - test_comparator_reads_test_results_table_different_values Detects when return values differ between original and candidate - test_comparator_handles_multiple_loop_iterations Tests multiple benchmark loops with different loop_index values - test_comparator_iteration_id_parsing Validates parseIterationId() correctly parses "iter_testIteration" format - test_comparator_missing_result_in_candidate Detects when candidate is missing results that exist in original Test features: - Creates actual test_results table with instrumentation schema - Tests full SQL integration path through Java Comparator - Validates column mapping: iteration_id → call_id, return_value → result_json - Uses @requires_java decorator to skip gracefully when Java unavailable - Documents expected schema for future developers - Prevents regressions if table name changes back to invocations These tests validate the fix in PR #1272 that updated the Comparator to read from test_results instead of invocations. Test results: 18 passed, 5 skipped (without Java) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
misrasaurabh1
approved these changes
Feb 3, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Background
PR #1272 updated the Java Comparator to read from the
test_resultstable (used by instrumentation) instead of theinvocationstable. This PR adds tests to validate that change and prevent future regressions.New Tests
TestTestResultsTableSchema class (5 tests):
test_comparator_reads_test_results_table_identical
equivalent=True, diffs=[]test_comparator_reads_test_results_table_different_values
equivalent=Falsewith 1 RETURN_VALUE difftest_comparator_handles_multiple_loop_iterations
test_comparator_iteration_id_parsing
test_comparator_missing_result_in_candidate
Test Features
✅ Real Schema - Creates actual test_results table with instrumentation schema
✅ SQL Integration - Tests full path through Java Comparator.jar
✅ Column Mapping - Validates iteration_id → call_id, return_value → result_json
✅ Graceful Skipping - Uses @requires_java decorator to skip when Java unavailable
✅ Documentation - Shows expected schema for future developers
✅ Regression Prevention - Catches if table name changes back to invocations
Schema Validated
Testing
✅ All 18 existing comparator tests still pass
✅ 5 new tests skip gracefully when Java not installed
✅ Total: 18 passed, 5 skipped (without Java)
✅ All tests pass when Java is available
Why These Tests Are Important
🤖 Generated with Claude Code