Skip to content

test(cli): add coverage for adk conformance test command options - #6731

Closed
chelsealong wants to merge 1 commit into
google:mainfrom
chelsealong:test-6730-conformance-cli-coverage
Closed

test(cli): add coverage for adk conformance test command options#6731
chelsealong wants to merge 1 commit into
google:mainfrom
chelsealong:test-6730-conformance-cli-coverage

Conversation

@chelsealong

Copy link
Copy Markdown
Contributor

Fixes #6730

Summary

tests/unittests/cli/utils/test_cli_tools_click.py already had a fixture
(fake_conformance_test) and a couple of tests for adk conformance test,
but several documented CLI behaviors listed in #6730 had no coverage:

  • Multiple PATHS directories being forwarded (in order) to the runner.
  • --mode live being propagated the same way --mode replay is.
  • The full set of --streaming-mode choices (sse, bidi, None) for the
    test subcommand specifically (only sse was covered before, and only
    for record).
  • Click rejecting an invalid --mode value before the runner is ever
    invoked.
  • Click rejecting an invalid --streaming-mode value before the runner is
    ever invoked.

This adds six new test functions to close those gaps, reusing the existing
fake_conformance_test fixture and the established style in the file (no
new fixtures, no production code changes).

Testing plan

Ran the new tests plus the full CLI test file:

$ python -m pytest tests/unittests/cli/utils/test_cli_tools_click.py -q
103 passed, 1 xfailed, 33 warnings in 9.51s

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.py and confirmed each new test fails,
then reverted:

  • Truncating PATHS to a single entry made
    test_cli_conformance_test_accepts_multiple_directories fail
    (AssertionError on the missing second path).
  • Adding a bogus extra choice to the --mode click.Choice made
    test_cli_conformance_test_rejects_invalid_mode fail (exit_code became
    0 instead of 2).
$ python -m pytest tests/unittests/cli/utils/test_cli_tools_click.py -k "conformance" -v
13 passed

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).

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.
@chelsealong

Copy link
Copy Markdown
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(cli): add coverage for adk conformance test command options

2 participants