fix: update mock expectations from SendMessage to SendMessageWithRetry#7483
fix: update mock expectations from SendMessage to SendMessageWithRetry#7483
Conversation
4 tests in middleware_coverage2_test.go were mocking SendMessage but production code calls SendMessageWithRetry at error.go:247, causing test failures. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Fixes failing middleware coverage tests by aligning mock expectations with the production agent API (SendMessageWithRetry) used by ErrorMiddleware.
Changes:
- Updated 4
mockAgentexpectations fromSendMessagetoSendMessageWithRetryin agentic-loop error middleware tests. - Ensures tests match
ErrorMiddlewareproduction behavior (SendMessageWithRetrycalls inerror.go).
Azure Dev CLI Install InstructionsInstall scriptsMacOS/Linux
bash: pwsh: WindowsPowerShell install MSI install Standalone Binary
MSI
Documentationlearn.microsoft.com documentationtitle: Azure Developer CLI reference
|
Summary
4 tests in
middleware_coverage2_test.gowere mockingSendMessagebut production code (error.go:247) callsSendMessageWithRetry, causing test failures on main after PR #7424 merged.Changes
SendMessagetoSendMessageWithRetry:TestErrorMiddleware_Run_AgentSendMessageErrorTestErrorMiddleware_Run_ErrorWithTraceIdTestErrorMiddleware_Run_SavedCategoryGuidanceTestErrorMiddleware_Run_SavedCategoryTroubleshootRoot Cause
PR #7401 renamed the agent method from
SendMessagetoSendMessageWithRetry. PR #7424 (coverage tests) was rebased onto main but these 4 string-literal mock expectations were missed -- they compile fine even when wrong, only failing at runtime.Testing
go test ./... -shortpasses with zero failures