test: add missing unit tests for adk and core packages - #2520
yashrajshuklaaa wants to merge 6 commits into
Conversation
… reconciler, reconciler utils Signed-off-by: Yashraj Shukla <shuklayashraj68@gmail.com>
bff00a2 to
c06a3f0
Compare
| assert.True(t, serviceerrors.IsCode(err, serviceerrors.CodePermissionDenied)) | ||
| } | ||
|
|
||
| func assertAnError() error { |
There was a problem hiding this comment.
name says assert, but this just builds an error. confusing name.
| Spec: v1alpha3.SandboxAgentSpec{ | ||
| Type: v1alpha3.AgentType_Declarative, | ||
| Declarative: &v1alpha3.DeclarativeAgentSpec{ | ||
| // ModelConfig deliberately omitted / points at a ModelConfig |
There was a problem hiding this comment.
comment says omitted, but code sets it to a missing name. pick one wording.
There was a problem hiding this comment.
resolved! thanks for the suggestion.
Signed-off-by: Yashraj Shukla <shuklayashraj68@gmail.com>
…CreateRunnerConfig via mockllm) Signed-off-by: Yashraj Shukla <shuklayashraj68@gmail.com>
Signed-off-by: Yashraj Shukla <shuklayashraj68@gmail.com>
c06a3f0 to
baa973f
Compare
|
@EItanya @supreme-gg-gg the test-e2e failure (TestAgentInstanceActiveTask) looks unrelated to this PR. it's a stream/actor-suspend race in an e2e test and this PR only adds unit tests with no production code changes. Could one of you re-run the job or take a look when you get a chance? |
|
@EItanya Could you please approve the workflow run so CI can complete? |
|
🤖 AI-assisted review. Thanks for putting time into improving test coverage! I think this PR would be more useful if we narrowed it to tests that protect current behavior against regressions.
The auth header assertions and parsing edge cases look worth keeping. Could you trim the PR to focused tests for behavior that still exists, with assertions that would fail if that behavior broke? A smaller suite with clear regression coverage would be a stronger addition. |
…ests Signed-off-by: Yashraj Shukla <shuklayashraj68@gmail.com>
Signed-off-by: Yashraj Shukla <shuklayashraj68@gmail.com>
05d13d1 to
ac0fd28
Compare
|
@EItanya all fixed. Removed the obsolete core tests, the hollow ShareTools tests, and the unused mock server. PTAL |
What
Unit tests for
go/adk/pkg/authandgo/adk/pkg/runner. No production code changes.Changes
auth/token_test.go: token lifecycle, header injection,TokenRoundTripper.runner/adapter_test.go:agentNameFromAppName,splitCSV,buildTokenPropagationPluginenv branching, andCreateRunnerConfigwiring (app-name default, session fallback, missing-model error).Revision note
Per @EItanya's review: removed tests for
core/internal/controller/reconciler/{status,utils},translator, andservice/agent. Their implementation moved or was removed onmain, so they no longer compiled. Removed two ShareTools test cases that didn't actually test ShareTools behavior. Removed the mock HTTP server and fixtures since no test called the model;CreateRunnerConfigtests now build the config inline.Validation
go build, go vet, go test - All pass.