test(evaluation): add unit tests for _eval_set_results_manager_utils#6205
Open
Koushik-Salammagari wants to merge 1 commit into
Open
Conversation
Adds unit-test coverage for the previously untested _eval_set_results_manager_utils module, covering: - _sanitize_eval_set_result_name: slash replacement and no-op cases. - create_eval_set_result: id/timestamp encoding and name sanitization. - parse_eval_set_result_json: standard, bytes, camelCase-aliased, and legacy double-encoded JSON, plus error paths for malformed input.
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.
Link to Issue or Description of Change
Description of the change (no existing issue):
Problem:
The
google.adk.evaluation._eval_set_results_manager_utilsmodule had nodedicated unit-test coverage. It contains non-trivial logic that is easy to
regress, most notably
parse_eval_set_result_json, which has abackward-compatibility fallback for legacy double-encoded result files (where
the outer JSON is a string containing the inner JSON object).
Solution:
Add a focused unit-test module that covers all three functions and their edge
cases. No production code is changed — this is a test-only PR that locks in the
current behavior.
Coverage added:
_sanitize_eval_set_result_name— slash replacement, multiple slashes, andno-op cases.
create_eval_set_result—{app_name}_{eval_set_id}_{timestamp}idencoding, that the timestamp matches
creation_timestamp, name sanitization,and empty
eval_case_results.parse_eval_set_result_json— standard JSON string,bytesinput,camelCase-aliased JSON, the legacy double-encoded format, and error paths for
a JSON object missing required fields and for non-JSON input.
Testing Plan
Unit Tests:
Manual End-to-End (E2E) Tests:
Not applicable — this is a test-only change with no runtime/user-facing impact.
Checklist