Skip to content

fix missed lifecycle shutdown time update in sandbox helper test#207

Merged
volcano-sh-bot merged 2 commits intovolcano-sh:mainfrom
acsoto:fix-sandbox-helper-test-lifecycle
Feb 6, 2026
Merged

fix missed lifecycle shutdown time update in sandbox helper test#207
volcano-sh-bot merged 2 commits intovolcano-sh:mainfrom
acsoto:fix-sandbox-helper-test-lifecycle

Conversation

@acsoto
Copy link
Contributor

@acsoto acsoto commented Feb 6, 2026

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-sandbox v0.1.1 migration, ShutdownTime moved under Lifecycle. One test case in pkg/workloadmanager/sandbox_helper_test.go still 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=1

Does this PR introduce a user-facing change?:

NONE

Signed-off-by: Zhou Zihang <z@mcac.cc>
Copilot AI review requested due to automatic review settings February 6, 2026 06:40
@volcano-sh-bot volcano-sh-bot added the kind/bug Something isn't working label Feb 6, 2026
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @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 SandboxSpec in a specific test fixture correctly uses the new Lifecycle nesting for ShutdownTime, maintaining test accuracy and consistency with the updated API.

Highlights

  • Test Fixture Update: The TestBuildSandboxInfo_TableDriven test in pkg/workloadmanager/sandbox_helper_test.go has been updated to correctly reflect the SandboxSpec API structure. Specifically, ShutdownTime is now nested under Lifecycle, aligning with the agent-sandbox v0.1.1 migration.

🧠 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
  • pkg/workloadmanager/sandbox_helper_test.go
    • Updated the SandboxSpec literal in TestBuildSandboxInfo_TableDriven to nest ShutdownTime under Lifecycle, matching the agent-sandbox v0.1.1 API.
Activity
  • A verification run was performed using go test ./pkg/workloadmanager -run TestBuildSandboxInfo_TableDriven -count=1 to confirm the fix.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_TableDriven to use the v0.1.1 API structure with Lifecycle.ShutdownTime

Signed-off-by: Zhou Zihang <z@mcac.cc>
@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 42.46%. Comparing base (845b798) to head (eac0963).
⚠️ Report is 83 commits behind head on main.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

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     
Flag Coverage Δ
unittests 42.46% <ø> (+6.85%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

CreationTimestamp: metav1.NewTime(now),
},
Spec: sandboxv1alpha1.SandboxSpec{
ShutdownTime: &metav1.Time{Time: shutdownTime},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both are right,

	// Lifecycle defines when and how the sandbox should be shut down.
	// +optional
	Lifecycle `json:",inline"`

Copy link
Member

@hzxuzhonghu hzxuzhonghu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@volcano-sh-bot
Copy link
Contributor

[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

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@volcano-sh-bot volcano-sh-bot merged commit b2fd46c into volcano-sh:main Feb 6, 2026
14 checks passed
@acsoto acsoto deleted the fix-sandbox-helper-test-lifecycle branch February 6, 2026 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants