- 
                Notifications
    
You must be signed in to change notification settings  - Fork 43
 
feat: Add comprehensive PVC storage test coverage #176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| 
           please review - @slin1237  | 
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary of Changes
Hello @abhinav-1305, 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 significantly enhances the test suite for Persistent Volume Claim (PVC) storage functionality. It introduces a wide array of unit and end-to-end tests to ensure robust handling of PVC URIs, metadata extraction from PVC-mounted models, and proper Kubernetes resource management for BaseModel and InferenceService objects utilizing PVCs. The added tests cover valid scenarios, edge cases, and various error conditions to improve the overall reliability of PVC-backed model serving.
Highlights
- Comprehensive PVC Storage Test Coverage: This PR introduces extensive unit and end-to-end test cases for PVC (Persistent Volume Claim) storage functionality, ensuring robust handling across various components.
 - Storage Package Unit Tests: Added detailed unit tests for PVC URI parsing, validation, and edge cases within the 
pkg/utils/storagepackage, covering various subpath formats, special characters, and invalid URI scenarios. - Model Agent Unit Tests: Enhanced unit tests for the 
model_metadata_agentandgophercomponents to validateconfig.jsonextraction, metadata mapping, Kubernetes API interactions for BaseModel/ClusterBaseModel updates, and error handling for malformed data or permission issues. - BaseModel Controller Unit Tests: Introduced comprehensive tests for the BaseModel controller's interaction with PVC storage, including metadata job creation, job spec validation, idempotency, and reconciliation logic for different PVC states (bound, pending, non-existent).
 - End-to-End PVC Workflow Tests: New E2E tests validate the complete lifecycle of models stored on PVCs, from PVC creation and population, through BaseModel processing and InferenceService deployment, including various error conditions and access mode behaviors (RWO, RWX).
 
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| 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 issue 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 is currently in preview and 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 to provide feedback.
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
- 
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. ↩
 
There was a problem hiding this 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 comprehensive test coverage for PVC storage functionality. I've suggested some improvements related to code simplification, fixing incorrect test expectations, and reducing duplication to enhance maintainability and correctness.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
| 
           thanks for the contribution, please fix the CI  | 
    
| 
           Hi @slin1237, I’ve fixed the comments from Gemini. Could you please re-trigger the CI so I can check the failures?  | 
    
… refactor filesystem operations
| 
           most of these CI commands are in make file you can verify those changes locally  | 
    
What type of PR is this?
/kind cleanup
/kind documentation
What this PR does / why we need it:
Test Coverage Overview
Detailed Test Coverage
Storage Package (
pkg/utils/storage/storage_test.go)pvc://my-pvc/models,pvc://my-pvc/path/to/modelsModel Agent (
pkg/modelagent/gopher_test.go)BaseModel Controller (
pkg/controller/v1beta1/basemodel/controller_test.go)E2E Tests (
tests/e2e/pvc_storage_test.go)Key Features Tested
PVC Storage URI Support
pvc://<pvc-name>/<subpath>andpvc://<namespace>:<pvc-name>/<subpath>Kubernetes Integration
Metadata Extraction
config.jsonparsing and model metadata extractionError Resilience
Test Quality Metrics
Which issue(s) this PR fixes:
Part of #167
Special notes for your reviewer:
NA
Does this PR introduce a user-facing change?