Skip to content

Conversation

@YaoZengzeng
Copy link
Member

What type of PR is this?

/kind enhancement

What this PR does / why we need it:

Which issue(s) this PR fixes:
Fixes #178

Special notes for your reviewer:

Does this PR introduce a user-facing change?:


@volcano-sh-bot volcano-sh-bot added the kind/enhancement New feature or request label Jan 30, 2026
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @YaoZengzeng, 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 enhances the robustness and accuracy of the code interpreter's end-to-end tests. By transitioning from an SDK-based execution model to direct API calls, the tests now more closely simulate real-world service interactions, ensuring the core functionality of the code interpreter is validated against its actual HTTP endpoints. This change improves the reliability of the test suite and provides a clearer picture of the service's behavior.

Highlights

  • Refactored Code Interpreter E2E Testing: The end-to-end tests for the code interpreter have been significantly refactored to directly interact with the Code Interpreter API via HTTP requests, moving away from local Python SDK execution.
  • New API Interaction Functions: Introduced invokeCodeInterpreter, createCodeInterpreterSession, deleteCodeInterpreterSession, and invokeWithSession functions to manage direct API calls and session lifecycle for code interpreter tests.
  • Updated Data Structures: Replaced CodeExecuteRequest and CodeExecuteResponse with CodeInterpreterExecuteRequest and CodeInterpreterExecuteResponse to align with the direct API's command execution request/response structure.
  • New Basic Invocation Test: Added TestCodeInterpreterBasicInvocation to validate the direct API access for code execution, including tests for basic commands and exit code handling.

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

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 significantly improves the end-to-end tests for the code interpreter by refactoring them to use direct API access instead of executing a Python script. This change makes the tests more robust, direct, and a better representation of how the API is intended to be used. The addition of helper functions like invokeCodeInterpreter and invokeWithSession greatly improves code clarity and reusability within the test suite. The new TestCodeInterpreterBasicInvocation provides good coverage for the basic API functionality.

Comment on lines +673 to +687
if tc.expectStdout != "" {
if resp.Stdout != tc.expectStdout {
t.Errorf("Expected stdout %q, got %q", tc.expectStdout, resp.Stdout)
}
}
if tc.expectStderr != "" {
if resp.Stderr != tc.expectStderr {
t.Errorf("Expected stderr %q, got %q", tc.expectStderr, resp.Stderr)
}
}
if resp.ExitCode != tc.expectExit {
t.Errorf("Expected exit code %d, got %d", tc.expectExit, resp.ExitCode)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The assertions for stdout and stderr are currently skipped if the expected value is an empty string. This could mask issues where a command unexpectedly produces output when none is expected.

To improve test accuracy and align with the idiomatic use of testify in this file, I recommend using require.Equal for all checks. This ensures all expectations, including empty outputs, are validated and makes the code more concise.

			require.Equal(t, tc.expectStdout, resp.Stdout)
			require.Equal(t, tc.expectStderr, resp.Stderr)
			require.Equal(t, tc.expectExit, resp.ExitCode)

@codecov-commenter
Copy link

codecov-commenter commented Jan 30, 2026

⚠️ 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 35.77%. Comparing base (845b798) to head (cb8e4a5).
⚠️ Report is 40 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     #185      +/-   ##
==========================================
+ Coverage   35.60%   35.77%   +0.16%     
==========================================
  Files          29       29              
  Lines        2533     2549      +16     
==========================================
+ Hits          902      912      +10     
- Misses       1505     1511       +6     
  Partials      126      126              
Flag Coverage Δ
unittests 35.77% <ø> (+0.16%) ⬆️

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.

respondError(c, http.StatusNotFound, err.Error())
} else {
respondError(c, http.StatusInternalServerError, "internal server error")
respondError(c, http.StatusInternalServerError, err.Error())
Copy link
Member

Choose a reason for hiding this comment

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

Deliberately hide the error details

Copy link
Member Author

Choose a reason for hiding this comment

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

Just for debug, will cleanup later.

Comment on lines 292 to 301
// GetSandboxPodIP gets the IP address of the pod corresponding to the Sandbox with retry logic
func (c *K8sClient) GetSandboxPodIP(ctx context.Context, namespace, sandboxName, podName string) (string, error) {
retryCtx, cancel := context.WithTimeout(ctx, 20*time.Second)
defer cancel()
ticker := time.NewTicker(time.Second)
defer ticker.Stop()

var ip string
var err error
for {
Copy link
Member

Choose a reason for hiding this comment

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

donot we have already guranteed it is ready before calling GetSandboxPodIP
How can ip not assigned when it is ready

Signed-off-by: YaoZengzeng <yaozengzeng@huawei.com>
Signed-off-by: YaoZengzeng <yaozengzeng@huawei.com>
@volcano-sh-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from yaozengzeng. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/enhancement New feature or request size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Why do the e2e run python code locally?

4 participants