Skip to content

test(tools): add coverage for ForwardingArtifactService#6196

Open
nuthalapativarun wants to merge 1 commit into
google:mainfrom
nuthalapativarun:test/forwarding-artifact-service-coverage
Open

test(tools): add coverage for ForwardingArtifactService#6196
nuthalapativarun wants to merge 1 commit into
google:mainfrom
nuthalapativarun:test/forwarding-artifact-service-coverage

Conversation

@nuthalapativarun

Copy link
Copy Markdown

Link to Issue or Description of Change

2. Or, if no issue exists, describe the change:
Problem: ForwardingArtifactService (used by AgentTool to forward artifact operations from a sub-agent's ToolContext back to the root invocation context) has no unit test coverage. In particular, list_artifact_versions and get_artifact_version are unimplemented stubs that raise NotImplementedError, and the delegation logic in save_artifact, load_artifact, list_artifact_keys, delete_artifact, and list_versions is untested.
Solution: Add tests/unittests/tools/test_forwarding_artifact_service.py with unit tests covering:

  • Delegation of save_artifact, load_artifact, and list_artifact_keys to the wrapped ToolContext.
  • Delegation of delete_artifact and list_versions to the root invocation context's artifact_service, including the ValueError raised when no root artifact service is configured.
  • NotImplementedError raised by both unimplemented stubs (list_artifact_versions, get_artifact_version).

This is a test-only change with no behavior modifications.

Testing Plan

Unit Tests:

  • I have added or updated unit tests for my change.
  • All unit tests pass locally.
tests/unittests/tools/test_forwarding_artifact_service.py::test_save_artifact_delegates_to_tool_context PASSED
tests/unittests/tools/test_forwarding_artifact_service.py::test_load_artifact_delegates_to_tool_context PASSED
tests/unittests/tools/test_forwarding_artifact_service.py::test_list_artifact_keys_delegates_to_tool_context PASSED
tests/unittests/tools/test_forwarding_artifact_service.py::test_delete_artifact_delegates_to_invocation_context_service PASSED
tests/unittests/tools/test_forwarding_artifact_service.py::test_delete_artifact_raises_when_no_root_artifact_service PASSED
tests/unittests/tools/test_forwarding_artifact_service.py::test_list_versions_delegates_to_invocation_context_service PASSED
tests/unittests/tools/test_forwarding_artifact_service.py::test_list_versions_raises_when_no_root_artifact_service PASSED
tests/unittests/tools/test_forwarding_artifact_service.py::test_list_artifact_versions_raises_not_implemented PASSED
tests/unittests/tools/test_forwarding_artifact_service.py::test_get_artifact_version_raises_not_implemented PASSED

9 passed in 1.68s

Manual End-to-End (E2E) Tests:
N/A — test-only addition, no runtime behavior change.

Checklist

  • Read CONTRIBUTING.md
  • Self-review performed
  • Comments added for hard-to-understand areas
  • Tests added proving fix/feature works
  • New and existing unit tests pass locally
  • Manually tested end-to-end
  • Dependent changes merged/published downstream

Additional context

No associated issue — this is a pure test-coverage addition with no behavior change, per CONTRIBUTING.md's allowance for small, focused PRs.

@nuthalapativarun nuthalapativarun force-pushed the test/forwarding-artifact-service-coverage branch from 7756ce8 to 732579b Compare June 23, 2026 06:04
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.

1 participant