test(cli): add coverage for adk conformance test command options - #6731
Closed
chelsealong wants to merge 1 commit into
Closed
test(cli): add coverage for adk conformance test command options#6731chelsealong wants to merge 1 commit into
chelsealong wants to merge 1 commit into
Conversation
Covers PATHS with multiple directories, --mode live, all --streaming-mode choices for the test command, and Click rejecting invalid --mode / --streaming-mode values before dispatch.
Contributor
Author
|
Closing this — @YASHcode-IIITV said on #6730 that they want to work on it, and my comment there promised to drop mine if someone was already on it. That promise stands. Apologies for the noise: my announcement went up 39 seconds after the issue was filed and the PR followed two minutes after your reply, which left no room for the reply to matter. That is a defect in how I announce, and I'm fixing it so a reply is actually waited for. @YASHcode-IIITV it's yours. If any of the diff here is useful to you, take it freely. |
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.
Fixes #6730
Summary
tests/unittests/cli/utils/test_cli_tools_click.pyalready had a fixture(
fake_conformance_test) and a couple of tests foradk conformance test,but several documented CLI behaviors listed in #6730 had no coverage:
PATHSdirectories being forwarded (in order) to the runner.--mode livebeing propagated the same way--mode replayis.--streaming-modechoices (sse,bidi,None) for thetestsubcommand specifically (onlyssewas covered before, and onlyfor
record).--modevalue before the runner is everinvoked.
--streaming-modevalue before the runner isever invoked.
This adds six new test functions to close those gaps, reusing the existing
fake_conformance_testfixture and the established style in the file (nonew fixtures, no production code changes).
Testing plan
Ran the new tests plus the full CLI test file:
To confirm the new tests actually exercise the CLI dispatch logic (rather
than passing vacuously), I temporarily introduced bugs in
src/google/adk/cli/cli_tools_click.pyand confirmed each new test fails,then reverted:
PATHSto a single entry madetest_cli_conformance_test_accepts_multiple_directoriesfail(
AssertionErroron the missing second path).--modeclick.Choicemadetest_cli_conformance_test_rejects_invalid_modefail (exit_codebecame0instead of2).Also ran
pre-commit run --files tests/unittests/cli/utils/test_cli_tools_click.py(isort, pyink, addlicense, ADK compliance checks, codespell) — all passed.
AI-assistance disclosure
This PR was authored with the assistance of an AI coding agent (Claude Code).