Skip to content

Adds unit tests for Storage and ContainerBuilder#34

Merged
jeffcarp merged 6 commits intomainfrom
test/cloud-wrappers
Feb 23, 2026
Merged

Adds unit tests for Storage and ContainerBuilder#34
jeffcarp merged 6 commits intomainfrom
test/cloud-wrappers

Conversation

@JyotinderSingh
Copy link
Collaborator

No description provided.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @JyotinderSingh, 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 coverage for the keras_remote project by introducing a suite of new unit tests across several core components. The changes ensure the reliability and correctness of Cloud Storage operations, container image building logic, accelerator configuration parsing, and geographical constant utilities. Additionally, it establishes a robust testing infrastructure with shared fixtures and proper configuration for both unit and end-to-end tests.

Highlights

  • New Unit Tests for Storage Utilities: Added comprehensive unit tests for keras_remote.utils.storage functions, covering artifact upload, download, cleanup, and project resolution logic.
  • New Unit Tests for Container Builder: Introduced unit tests for keras_remote.infra.container_builder, validating requirement hashing, Dockerfile generation for various accelerator types, image existence checks, and the get_or_build_container workflow.
  • New Unit Tests for Accelerator Parsing: Added extensive unit tests for keras_remote.core.accelerators, ensuring correct parsing of GPU and TPU configurations, handling of aliases, multi-counts, topologies, and error conditions.
  • New Unit Tests for Constants and Zone Helpers: Implemented unit tests for keras_remote.constants to verify the functionality of zone-to-region and zone-to-Artifact Registry location conversions, as well as default zone retrieval.
  • Shared Pytest Fixtures: Created new conftest.py files to provide shared pytest fixtures, including a sample function for serialization tests, GCP environment variable setup, and mocks for Google Cloud Storage and Kubernetes clients.
  • Pyproject.toml Updates: Updated pyproject.toml to include new test dependencies (pytest, pytest-cov, pytest-mock, pytest-timeout), added keras-remote[test] to dev dependencies, and configured pytest to define test paths and an 'e2e' marker.
  • E2E Test Configuration: Added a conftest.py for end-to-end tests, introducing a pytest hook to skip E2E tests by default unless the E2E_TESTS environment variable is explicitly set, and a fixture to retrieve the GCP project from environment variables.

🧠 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
  • conftest.py
    • Added new file to provide shared pytest fixtures for general test utilities.
  • keras_remote/conftest.py
    • Added new file to provide shared pytest fixtures for mocking GCP and Kubernetes services.
  • keras_remote/core/test_accelerators.py
    • Added new file containing unit tests for accelerator parsing and configuration logic.
  • keras_remote/infra/test_container_builder.py
    • Added new file containing unit tests for container image building, hashing, and Dockerfile generation.
  • keras_remote/test_constants.py
    • Added new file containing unit tests for zone, region, and location helper functions.
  • keras_remote/utils/test_storage.py
    • Added new file containing unit tests for Cloud Storage utility functions.
  • pyproject.toml
    • Added new 'test' dependency group for pytest and related tools.
    • Included 'keras-remote[test]' in the 'dev' dependency group.
    • Configured pytest to define test paths and an 'e2e' marker.
  • tests/e2e/conftest.py
    • Added new file to configure conditional skipping of end-to-end tests based on environment variables.
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/tests.yaml
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

The pull request introduces a comprehensive suite of unit tests for core components including accelerator parsing, container building, and cloud storage utilities. It also sets up the testing infrastructure in pyproject.toml and provides shared fixtures. The tests are well-structured and cover various edge cases and error conditions. However, there is a version mismatch in the test dependencies and some minor redundancy in mock assertions.

@JyotinderSingh JyotinderSingh force-pushed the test/cloud-wrappers branch 3 times, most recently from 66e1f5f to 24e6e69 Compare February 21, 2026 02:26
@JyotinderSingh JyotinderSingh marked this pull request as ready for review February 21, 2026 02:27
@JyotinderSingh
Copy link
Collaborator Author

/gemini review

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 adds a comprehensive set of unit tests for the Storage and ContainerBuilder components. The tests are well-structured, covering various scenarios including deterministic behavior, different inputs, and edge cases. My feedback includes a few suggestions to improve the readability and maintainability of the test code by simplifying redundant expressions and using more descriptive parameterized tests.

@jeffcarp jeffcarp merged commit 05d95c9 into main Feb 23, 2026
4 checks passed
@JyotinderSingh JyotinderSingh deleted the test/cloud-wrappers branch February 23, 2026 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants