Skip to content

test: Add unit tests for CLI functionality - #577

Closed
K-dash wants to merge 7 commits into
google:mainfrom
K-dash:test/add-unit-tests-for-cli
Closed

K-dash wants to merge 7 commits into
google:mainfrom
K-dash:test/add-unit-tests-for-cli

Conversation

@K-dash

@K-dash K-dash commented May 6, 2025 •

Copy link
Copy Markdown
Contributor

Ref #542

@hangfei Hi!
This commit introduces unit tests for the following CLI-related components:

  • cli_deploy.py
  • cli_create.py
  • cli.py
  • cli_tools_click.py

With the addition of these test cases, the test coverage rates are now as follows:

Name                                      Stmts   Miss  Cover
-----------------------------------------------------------------
src/google/adk/cli/cli.py                    81      2    98%
src/google/adk/cli/cli_create.py             91      8    91%
src/google/adk/cli/cli_deploy.py             40      0   100%
src/google/adk/cli/cli_tools_click.py       146      9    94%

This commit introduces unit tests for the following CLI-related components:

- cli_deploy.py: Tests for the cloud deployment feature.
- cli_create.py: Tests for the agent creation feature.
- cli.py: Tests for the main CLI execution logic.
- cli_tools_click.py: Tests for the Click-based CLI tools.
@google-cla

google-cla Bot commented May 6, 2025

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@K-dash K-dash changed the title Add unit tests for CLI functionality test: Add unit tests for CLI functionality May 6, 2025
@hangfei
hangfei requested a review from Jacksunwei May 7, 2025 05:24
@hangfei

hangfei commented May 8, 2025

Copy link
Copy Markdown
Collaborator

Thanks. This is really comprehensive tests.

Some of the tests added are failing in github workflows. Could you fix them? (it might be different test env related.) @K-dash

@K-dash

K-dash commented May 8, 2025

Copy link
Copy Markdown
Contributor Author

@hangfei
Thanks for checking. I’ve fixed the test code, so it should pass now.
Root cause: the test fed asyncio.run() a plain iterator instead of a coroutine.

@hangfei hangfei added the ready to pull [Status] This PR is ready to be imported back to Google label May 9, 2025
@hangfei

hangfei commented May 9, 2025

Copy link
Copy Markdown
Collaborator

It's merged by bot. Thanks!

@hangfei hangfei closed this May 9, 2025
copybara-service Bot pushed a commit that referenced this pull request May 9, 2025
Copybara import of the project:

--
f60707a by K <[email protected]>:

test(cli): Add unit tests for CLI functionality

This commit introduces unit tests for the following CLI-related components:

- cli_deploy.py: Tests for the cloud deployment feature.
- cli_create.py: Tests for the agent creation feature.
- cli.py: Tests for the main CLI execution logic.
- cli_tools_click.py: Tests for the Click-based CLI tools.

--
7be2159 by K <[email protected]>:

fix test_cli_eval_success_path

COPYBARA_INTEGRATE_REVIEW=#577 from K-dash:test/add-unit-tests-for-cli 69f12d3
PiperOrigin-RevId: 756602765
coder-aditi pushed a commit to coder-aditi/adk-python that referenced this pull request Jul 2, 2025
Copybara import of the project:

--
f60707a by K <[email protected]>:

test(cli): Add unit tests for CLI functionality

This commit introduces unit tests for the following CLI-related components:

- cli_deploy.py: Tests for the cloud deployment feature.
- cli_create.py: Tests for the agent creation feature.
- cli.py: Tests for the main CLI execution logic.
- cli_tools_click.py: Tests for the Click-based CLI tools.

--
7be2159 by K <[email protected]>:

fix test_cli_eval_success_path

COPYBARA_INTEGRATE_REVIEW=google#577 from K-dash:test/add-unit-tests-for-cli 69f12d3
PiperOrigin-RevId: 756602765
FrigaZzz pushed a commit to FrigaZzz/adk-python that referenced this pull request Aug 11, 2026
Copybara import of the project:

--
f60707a by K <[email protected]>:

test(cli): Add unit tests for CLI functionality

This commit introduces unit tests for the following CLI-related components:

- cli_deploy.py: Tests for the cloud deployment feature.
- cli_create.py: Tests for the agent creation feature.
- cli.py: Tests for the main CLI execution logic.
- cli_tools_click.py: Tests for the Click-based CLI tools.

--
7be2159 by K <[email protected]>:

fix test_cli_eval_success_path

COPYBARA_INTEGRATE_REVIEW=google#577 from K-dash:test/add-unit-tests-for-cli 69f12d3
PiperOrigin-RevId: 756602765
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready to pull [Status] This PR is ready to be imported back to Google

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants