test: add e2e session/sandbox lifecycle tests#298
test: add e2e session/sandbox lifecycle tests#298JagjeevanAK wants to merge 4 commits intovolcano-sh:mainfrom
Conversation
|
Welcome @JagjeevanAK! It looks like this is your first PR to volcano-sh/agentcube 🎉 |
There was a problem hiding this comment.
Code Review
This pull request introduces end-to-end tests for AgentCube session and sandbox lifecycles, along with a supporting AgentRuntime configuration with a short TTL. The tests verify session auto-creation, reuse, 404 error handling for missing runtimes, and stateful code interpreter sessions. Review feedback suggests improving test robustness by checking ignored errors from io.ReadAll, using t.Fatal instead of t.Skip when session creation fails to properly signal a system failure, and reporting premature session invalidation as an error rather than a log message.
|
@hzxuzhonghu can you check this PR ? |
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #298 +/- ##
==========================================
+ Coverage 43.37% 47.58% +4.21%
==========================================
Files 30 30
Lines 2610 2820 +210
==========================================
+ Hits 1132 1342 +210
+ Misses 1355 1338 -17
- Partials 123 140 +17
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
d41404a to
673bd45
Compare
673bd45 to
4114bae
Compare
Signed-off-by: Jagjeevan Kashid <jagjeevandev97@gmail.com>
4114bae to
a6663e9
Compare
Signed-off-by: Jagjeevan Kashid <jagjeevandev97@gmail.com>
|
can you check the recent updates ? CC: @acsoto |
Thank you. E2E Tests failed. Cloud you pls check? |
Signed-off-by: Jagjeevan Kashid <jagjeevandev97@gmail.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hey man Sorry for previous stuff now I think all test should pass easily CC: @acsoto |
|
LGTM |
|
Any update on this ? CC: @YaoZengzeng and @tjucoder |
| // Auto-created sessions come directly from WorkloadManager response, which | ||
| // currently does not include kind. Default to Sandbox so Router signs JWT | ||
| // when forwarding to sandbox runtimes (e.g. PicoD). | ||
| Kind: types.SandboxKind, |
There was a problem hiding this comment.
This field is missing set, because we cannot know whether it is sandbox or sandboxclaim now.
Do you see any problem without it?
|
|
||
| // invokeCodeInterpreterWithHeader is like invokeCodeInterpreter but also returns | ||
| // the x-agentcube-session-id response header so B1 can assert on it. | ||
| func (e *testEnv) invokeCodeInterpreterWithHeader( |
| // 1. Returns HTTP 200. | ||
| // 2. Produces the expected stdout (e.g. "2\n" for print(1+1)). | ||
| // 3. Sets the x-agentcube-session-id response header. | ||
| func TestCodeInterpreterSessionAutoCreation(t *testing.T) { |
There was a problem hiding this comment.
isn't this included in TestAgentRuntimeSessionCreationAndReuse
What type of PR is this?
/kind feature
What this PR does / why we need it:
Adds
test/e2e/session_lifecycle_test.gowith three net-new lifecycle tests from issue #103 that were not previously covered bye2e_test.go. All tests live in the existinge2epackage and reuse the shared helpers already present ine2e_test.go.Also adds
test/e2e/echo_agent_short_ttl.yaml— an AgentRuntime CR withsessionTimeout: 30srequired by the existingTestAgentRuntimeSessionTTL(A3) test.Tests added:
TestAgentRuntimeSessionCreationAndReusex-agentcube-session-idauto-creates a session and returns the header; second call with that ID returns the same session ID and correct outputTestCodeInterpreterSessionAutoCreationx-agentcube-session-idset in response headerTestCodeInterpreterStatefulSessionScenarios already covered by existing tests (no duplication):
TestAgentRuntimeErrorHandlingTestAgentRuntimeSessionTTLTestCodeInterpreterFileOperations / "download file"Which issue(s) this PR fixes:
Fixes #103
Special notes for your reviewer:
echo_agent_short_ttl.yamluses the same echo-server logic asecho_agent.yamlbut withsessionTimeout: 30s; apply it before runningTestAgentRuntimeSessionTTL.Does this PR introduce a user-facing change?: