fix missed lifecycle shutdown time update in sandbox helper test#207
Conversation
Signed-off-by: Zhou Zihang <z@mcac.cc>
Summary of ChangesHello @acsoto, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses a minor bug where a test case was not updated to reflect a recent API change. It ensures that the Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request provides a small but important fix to a test case in pkg/workloadmanager/sandbox_helper_test.go. The change correctly updates the test fixture to use the new SandboxSpec structure, where ShutdownTime is now nested within Lifecycle. This aligns the test with the recent API changes mentioned in the description. The change is correct and I have no further feedback.
There was a problem hiding this comment.
Pull request overview
This PR fixes a missed test fixture update from PR #201, which upgraded the agent-sandbox dependency to v0.1.1. The v0.1.1 API moved ShutdownTime from being a direct field on SandboxSpec to being nested under Spec.Lifecycle.ShutdownTime. While PR #201 updated production code and most tests, one test case in sandbox_helper_test.go was overlooked.
Changes:
- Updated test fixture in
TestBuildSandboxInfo_TableDrivento use the v0.1.1 API structure withLifecycle.ShutdownTime
Signed-off-by: Zhou Zihang <z@mcac.cc>
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #207 +/- ##
==========================================
+ Coverage 35.60% 42.46% +6.85%
==========================================
Files 29 29
Lines 2533 2560 +27
==========================================
+ Hits 902 1087 +185
+ Misses 1505 1341 -164
- Partials 126 132 +6
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:
|
| CreationTimestamp: metav1.NewTime(now), | ||
| }, | ||
| Spec: sandboxv1alpha1.SandboxSpec{ | ||
| ShutdownTime: &metav1.Time{Time: shutdownTime}, |
There was a problem hiding this comment.
Both are right,
// Lifecycle defines when and how the sandbox should be shut down.
// +optional
Lifecycle `json:",inline"`
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: hzxuzhonghu The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind bug
What this PR does / why we need it:
This is a small follow-up fix after #201. In the
agent-sandboxv0.1.1 migration,ShutdownTimemoved underLifecycle. One test case inpkg/workloadmanager/sandbox_helper_test.gostill used the old struct literal shape (SandboxSpec{ShutdownTime: ...}), which was missed in the previous PR.This PR updates that test fixture to the v0.1.1 API shape:
SandboxSpec{Lifecycle: {ShutdownTime: ...}}.ref #201
Which issue(s) this PR fixes:
Fixes # (N/A)
Special notes for your reviewer:
Verification run:
go test ./pkg/workloadmanager -run TestBuildSandboxInfo_TableDriven -count=1Does this PR introduce a user-facing change?: