Skip to content

test(adk): add WrapToolCall ToolMiddleware tests#906

Merged
zhuangjie1125 merged 1 commit intomainfrom
fix/warptool
Mar 24, 2026
Merged

test(adk): add WrapToolCall ToolMiddleware tests#906
zhuangjie1125 merged 1 commit intomainfrom
fix/warptool

Conversation

@zhuangjie1125
Copy link
Copy Markdown
Contributor

  • Add 6 subtests for AgentMiddleware.WrapToolCall in TestChatModelAgentRun:
    • Invokable middleware: basic invocation, argument capture
    • Multiple middlewares: verify outer-to-inner execution order
    • Modify result: middleware can alter tool output
    • Streamable middleware: works with StreamableTool
    • EnhancedInvokable middleware: works with EnhancedInvokableTool
    • EnhancedStreamable middleware: works with EnhancedStreamableTool
  • Add fakeEnhancedInvokableToolForTest and fakeEnhancedStreamableToolForTest helpers
  • Fix collectToolMiddlewaresFromMiddlewares to also check EnhancedInvokable and EnhancedStreamable fields before skipping
  • Fix deprecated comment in skill middleware (New -> NewMiddleware)

- Add 6 subtests for AgentMiddleware.WrapToolCall in TestChatModelAgentRun:
  - Invokable middleware: basic invocation, argument capture
  - Multiple middlewares: verify outer-to-inner execution order
  - Modify result: middleware can alter tool output
  - Streamable middleware: works with StreamableTool
  - EnhancedInvokable middleware: works with EnhancedInvokableTool
  - EnhancedStreamable middleware: works with EnhancedStreamableTool
- Add fakeEnhancedInvokableToolForTest and fakeEnhancedStreamableToolForTest helpers
- Fix collectToolMiddlewaresFromMiddlewares to also check EnhancedInvokable
  and EnhancedStreamable fields before skipping
- Fix deprecated comment in skill middleware (New -> NewMiddleware)
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 24, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.17%. Comparing base (867fc23) to head (ab60107).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #906      +/-   ##
==========================================
+ Coverage   81.98%   82.17%   +0.18%     
==========================================
  Files         146      146              
  Lines       16063    16063              
==========================================
+ Hits        13170    13200      +30     
+ Misses       1957     1916      -41     
- Partials      936      947      +11     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@zhuangjie1125 zhuangjie1125 merged commit 9514a61 into main Mar 24, 2026
18 checks passed
@zhuangjie1125 zhuangjie1125 deleted the fix/warptool branch March 24, 2026 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants