Skip to content

test(integration): add script to run migrated tests on mounted directory#4578

Open
PranjalC100 wants to merge 4 commits intomasterfrom
new-run-tests-mounted-directory
Open

test(integration): add script to run migrated tests on mounted directory#4578
PranjalC100 wants to merge 4 commits intomasterfrom
new-run-tests-mounted-directory

Conversation

@PranjalC100
Copy link
Copy Markdown
Member

Description

This PR introduces a new bash script (tools/integration_tests/run_migrated_tests_mounted_directory.sh) to automate the execution of integration tests against a mounted GCS directory.

Key features of the script:

  • Parses test_config.yaml using yq to dynamically extract test configurations, mounted directories, and FUSE flags.
  • Automatically builds the gcsfuse binary if it is not found before starting the tests.
  • Safely handles mounting the bucket, running the go test command with the appropriate arguments, and unmounting via an exit trap.
  • Supports running tests for a specific package (--package) or all packages (--all).

Link to the issue in case of a bug fix.

bug

Testing details

  1. Manual - Verified the script properly parses the YAML config, mounts the directory, runs the tests, and cleans up the mount afterward.
  2. Unit tests - NA
  3. Integration tests - NA

Any backward incompatible change? If so, please explain.

No.

@PranjalC100 PranjalC100 requested a review from ashmeenkaur April 3, 2026 11:27
@PranjalC100 PranjalC100 requested review from a team, Tulsishah and meet2mky as code owners April 3, 2026 11:27
@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 introduces a new automation tool to streamline the integration testing process for gcsfuse. By dynamically parsing configuration files and managing the lifecycle of the mount and test execution, this script reduces manual effort and ensures consistent test environments.

Highlights

  • New Automation Script: Added a bash script to automate the execution of integration tests against a mounted GCS directory.
  • Dynamic Configuration: Implemented YAML parsing using yq to dynamically extract test configurations, mounted directories, and FUSE flags.
  • Build and Cleanup: Added automatic gcsfuse binary building and robust cleanup using exit traps to ensure proper unmounting.
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.

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.

@github-actions github-actions bot added the remind-reviewers Auto remind reviewers in attention set for review post 24hrs of inactivity on PR. label Apr 3, 2026
Copy link
Copy Markdown
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 introduces a bash script, run_migrated_tests_mounted_directory.sh, designed to automate integration testing for gcsfuse by parsing configurations from a YAML file. The script handles the end-to-end process of building the binary, mounting the bucket, executing Go tests or benchmarks, and performing cleanup. Feedback highlights a security vulnerability regarding the use of eval for variable expansion, potential bash syntax errors when handling null values from YAML parsing, and a suggestion to optimize benchmark execution by skipping standard tests.

Comment thread tools/integration_tests/run_migrated_tests_mounted_directory.sh Outdated
Comment thread tools/integration_tests/run_migrated_tests_mounted_directory.sh Outdated
GO_CMD+=(-run "^${TEST_NAME}$")
fi
else
GO_CMD+=(-bench .)
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

When TEST_NAME is not specified, go test -bench . is executed. By default, this runs all unit tests in the package in addition to the benchmarks. To run only benchmarks and skip tests, add the -run ^$ flag.

Suggested change
GO_CMD+=(-bench .)
GO_CMD+=(-bench . -run ^$)

@PranjalC100
Copy link
Copy Markdown
Member Author

Consider adding an option to handle different bucket types. We could approach this in two ways:

  • Accept different flag sets depending on the specific bucket type.
  • Accept a single bucket type flag, and validate it against the compatible section (e.g., flat, hns, zonal) in the test config file before executing the tests."

@PranjalC100
Copy link
Copy Markdown
Member Author

Some tests require a log_file and trace enabled logs. Will have to set this up in this script as well. For example: buffered_read package

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 7, 2026

Hi @ashmeenkaur, @meet2mky, @Tulsishah, your feedback is needed to move this pull request forward. This automated reminder was triggered because there has been no activity for over 24 hours. Please provide your input when you have a moment. Thank you!

7 similar comments
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 8, 2026

Hi @ashmeenkaur, @meet2mky, @Tulsishah, your feedback is needed to move this pull request forward. This automated reminder was triggered because there has been no activity for over 24 hours. Please provide your input when you have a moment. Thank you!

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 9, 2026

Hi @ashmeenkaur, @meet2mky, @Tulsishah, your feedback is needed to move this pull request forward. This automated reminder was triggered because there has been no activity for over 24 hours. Please provide your input when you have a moment. Thank you!

@github-actions
Copy link
Copy Markdown

Hi @ashmeenkaur, @meet2mky, @Tulsishah, your feedback is needed to move this pull request forward. This automated reminder was triggered because there has been no activity for over 24 hours. Please provide your input when you have a moment. Thank you!

@github-actions
Copy link
Copy Markdown

Hi @ashmeenkaur, @meet2mky, @Tulsishah, your feedback is needed to move this pull request forward. This automated reminder was triggered because there has been no activity for over 24 hours. Please provide your input when you have a moment. Thank you!

@github-actions
Copy link
Copy Markdown

Hi @ashmeenkaur, @meet2mky, @Tulsishah, your feedback is needed to move this pull request forward. This automated reminder was triggered because there has been no activity for over 24 hours. Please provide your input when you have a moment. Thank you!

@github-actions
Copy link
Copy Markdown

Hi @ashmeenkaur, @meet2mky, @Tulsishah, your feedback is needed to move this pull request forward. This automated reminder was triggered because there has been no activity for over 24 hours. Please provide your input when you have a moment. Thank you!

@github-actions
Copy link
Copy Markdown

Hi @ashmeenkaur, @meet2mky, @Tulsishah, your feedback is needed to move this pull request forward. This automated reminder was triggered because there has been no activity for over 24 hours. Please provide your input when you have a moment. Thank you!

@ashmeenkaur ashmeenkaur removed their request for review April 16, 2026 06:12
@PranjalC100 PranjalC100 force-pushed the new-run-tests-mounted-directory branch from 5bf2056 to a22bcdd Compare April 16, 2026 10:24
@PranjalC100 PranjalC100 force-pushed the new-run-tests-mounted-directory branch from a22bcdd to 9199f51 Compare April 16, 2026 16:44
@github-actions
Copy link
Copy Markdown

Hi @meet2mky, @Tulsishah, your feedback is needed to move this pull request forward. This automated reminder was triggered because there has been no activity for over 24 hours. Please provide your input when you have a moment. Thank you!

1 similar comment
@github-actions
Copy link
Copy Markdown

Hi @meet2mky, @Tulsishah, your feedback is needed to move this pull request forward. This automated reminder was triggered because there has been no activity for over 24 hours. Please provide your input when you have a moment. Thank you!

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