Skip to content

test(grpc_validation): e2e test for grpc direct-path fallback#4773

Draft
raj-prince wants to merge 3 commits into
masterfrom
grpc_dp_fallback_e2e
Draft

test(grpc_validation): e2e test for grpc direct-path fallback#4773
raj-prince wants to merge 3 commits into
masterfrom
grpc_dp_fallback_e2e

Conversation

@raj-prince

Copy link
Copy Markdown
Collaborator

Description

  • gRPC Fallback & DirectPath Test Coverage (grpc_validation_test.go): Updated tests to validate direct-path-with-fallback and direct-path-only strategies across single-region and multi-region buckets, asserting on fallback and directpath logs.
  • GCP Project Whitelist (setup_test.go): Added a check to execute tests only when running on a GCE VM within the gcs-fuse-test project.

Link to the issue in case of a bug fix.

b/522019946

Testing details

  1. Manual - Still waiting for the allowlisted project.
  2. Unit tests - NA
  3. Integration tests - NA

Any backward incompatible change? If so, please explain.

@raj-prince raj-prince requested review from a team and meet2mky as code owners June 10, 2026 03:38
@github-actions github-actions Bot added the remind-reviewers Auto remind reviewers in attention set for review post 24hrs of inactivity on PR. label Jun 10, 2026
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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 gRPC validation integration tests by introducing granular test cases for different gRPC path strategies. It ensures that the system correctly handles fallback and direct-path-only configurations. Additionally, it adds environment-specific safety checks to prevent test execution outside of the designated GCP project, improving test infrastructure stability.

Highlights

  • Enhanced gRPC Validation Tests: Updated the integration test suite to validate both 'direct-path-with-fallback' and 'direct-path-only' strategies across single and multi-region buckets.
  • Improved Test Reliability: Added comprehensive log substring assertions to verify expected gRPC connection behavior under different strategies.
  • GCP Environment Whitelisting: Implemented a mandatory check in the test setup to ensure tests only execute when running on a GCE VM within the authorized 'gcs-fuse-test' project.
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 the 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 counterproductive. 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.

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.

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

Copy link
Copy Markdown
Contributor

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 updates the gRPC validation integration tests to cover different gRPC path strategies (direct-path-with-fallback and direct-path-only) across single-region and multi-region buckets, and adds GCE environment and project ID checks to skip tests when appropriate. Feedback recommends using t.Fatalf instead of t.Errorf during mount failures to prevent cascading test failures, and using the existing gcpProject variable instead of hardcoding the project ID string.

Comment on lines +208 to +216
if err != nil {
if tc.expectedSuccess {
t.Errorf("Unexpected mount failure: %v", err)
}
} else {
if !tc.expectedSuccess {
t.Errorf("Expected mount failure but mount succeeded")
}
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Using t.Errorf here allows the test to continue executing even when the mount result is unexpected. This leads to cascading failures when checking the log file for substrings that won't exist. Using t.Fatalf instead will stop the test immediately on the first unexpected result, making the test output cleaner and easier to debug.

			if tc.expectedSuccess && err != nil {
				t.Fatalf("Unexpected mount failure: %v", err)
			}
			if !tc.expectedSuccess && err == nil {
				t.Fatalf("Expected mount failure but mount succeeded")
			}

log.Println("Skipping tests as we are not running on GCE.")
os.Exit(0)
}
if projectID != "gcs-fuse-test" {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Use the existing package-level variable gcpProject instead of hardcoding the string "gcs-fuse-test" again to maintain consistency and avoid duplication.

Suggested change
if projectID != "gcs-fuse-test" {
if projectID != gcpProject {

@raj-prince raj-prince marked this pull request as draft June 10, 2026 03:40
@codecov

codecov Bot commented Jun 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.69%. Comparing base (da692a3) to head (70ded35).
⚠️ Report is 21 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4773      +/-   ##
==========================================
+ Coverage   83.64%   83.69%   +0.04%     
==========================================
  Files         168      168              
  Lines       20775    20784       +9     
==========================================
+ Hits        17378    17395      +17     
+ Misses       2750     2740      -10     
- Partials      647      649       +2     
Flag Coverage Δ
unittests 83.69% <100.00%> (+0.04%) ⬆️

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

☔ View full report in Codecov by Harness.
📢 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.

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

Labels

remind-reviewers Auto remind reviewers in attention set for review post 24hrs of inactivity on PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant