Skip to content

Conversation

@parthea
Copy link
Contributor

@parthea parthea commented Feb 9, 2026

See #10960.

This PR should be merged with a merge-commit, not a squash-commit, in order to preserve the git history.

danoscarmike and others added 30 commits April 6, 2020 17:38
chore: copy test_utils, scripts to master
To avoid generating bogus PRs

Co-authored-by: Jeffrey Rennie <rennie@google.com>

Source-Author: Carlos de la Guardia <cguardia@yahoo.com>
Source-Date: Tue May 19 11:57:19 2020 -0500
Source-Repo: googleapis/synthtool
Source-Sha: d2364eb80b840a36136c8ce12f1c6efabcc9600e
Source-Link: googleapis/synthtool@d2364eb
Add a lower bound checker to be invoked on the command line by client libraries. This accomplishes two things:
- Makes it easier to mass update/create constraints files.
- Adds another layer of checks to the lower bounds in setup.py / constraints files.

See googleapis/synthtool#869 for additional context on the lower bounds work.

`lower-bound-checker` is intentionally restrictive on the types of pins it permits in `setup.py` and `constraints.txt`. The tool doesn't try to `pip install` the package. It is assumed that other checks (e.g., setup.py lint, unit tests) will pick up on things like misspelled package names or a version range that cannot be fulfilled.

```
busunkim@busunkim:~/github/python-test-utils$ lower-bound-checker check --help
Usage: lower-bound-checker check [OPTIONS]

  Check that the constraints-file pins to the lower bound specified in
  package-name's setup.py for each requirement.

  Requirements:

  1. The setup.py pins every requirement in one of the following formats:

      * foo==1.2.0

      * foo>=1.2.0

      * foo>=1.2.0, <2.0.0dev

      * foo<2.0.0dev, >=1.2.0

  2. The constraints file pins every requirement to a single version:

      * foo==1.2.0

  3. package-name is already be installed in the environment.

Options:
  --package-name TEXT      Name of the package.  [required]
  --constraints-file TEXT  Path to constraints file.  [required]
  --help                   Show this message and exit.
```


**Example Usage:**

(for reviewers)
- Install this repo from source: `pip install /path/to/repo`
- Install another package from source: `pip install /path/to/google-cloud-foo`

1. Check an existing package and constraints file:
```
lower-bound-checker check --package-name google-cloud-foo
--constraints-file testing/constraints-3.6.txt
```

2. Create/update a constraints file:
```
lower-bound-checker update --package-name google-cloud-foo
--constraints-file testing/constraints-3.6.txt
```
Co-authored-by: google-cloud-policy-bot[bot] <80869356+google-cloud-policy-bot[bot]@users.noreply.github.com>
gcr.io/repo-automation-bots/owlbot-python:latest@sha256:4c981a6b6f2b8914a448d7b3a01688365be03e3ed26dfee399a6aa77fb112eaa
#34)

[![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [pre-commit/pre-commit-hooks](https://togithub.com/pre-commit/pre-commit-hooks) | repository | major | `v3.4.0` -> `v4.0.1` |

---

### Release Notes

<details>
<summary>pre-commit/pre-commit-hooks</summary>

### [`v4.0.1`](https://togithub.com/pre-commit/pre-commit-hooks/releases/v4.0.1)

[Compare Source](https://togithub.com/pre-commit/pre-commit-hooks/compare/v4.0.0...v4.0.1)

##### Fixes

-   `check-shebang-scripts-are-executable` fix entry point.
    -   [#&#8203;602](https://togithub.com/pre-commit/pre-commit-hooks/issues/602) issue by [@&#8203;Person-93](https://togithub.com/Person-93).
    -   [#&#8203;603](https://togithub.com/pre-commit/pre-commit-hooks/issues/603) PR by [@&#8203;scop](https://togithub.com/scop).

### [`v4.0.0`](https://togithub.com/pre-commit/pre-commit-hooks/releases/v4.0.0)

[Compare Source](https://togithub.com/pre-commit/pre-commit-hooks/compare/v3.4.0...v4.0.0)

##### Features

-   `check-json`: report duplicate keys.
    -   [#&#8203;558](https://togithub.com/pre-commit/pre-commit-hooks/issues/558) PR by [@&#8203;AdityaKhursale](https://togithub.com/AdityaKhursale).
    -   [#&#8203;554](https://togithub.com/pre-commit/pre-commit-hooks/issues/554) issue by [@&#8203;adamchainz](https://togithub.com/adamchainz).
-   `no-commit-to-branch`: add `main` to default blocked branches.
    -   [#&#8203;565](https://togithub.com/pre-commit/pre-commit-hooks/issues/565) PR by [@&#8203;ndevenish](https://togithub.com/ndevenish).
-   `check-case-conflict`: check conflicts in directory names as well.
    -   [#&#8203;575](https://togithub.com/pre-commit/pre-commit-hooks/issues/575) PR by [@&#8203;slsyy](https://togithub.com/slsyy).
    -   [#&#8203;70](https://togithub.com/pre-commit/pre-commit-hooks/issues/70) issue by [@&#8203;andyjack](https://togithub.com/andyjack).
-   `check-vcs-permalinks`: forbid other branch names.
    -   [#&#8203;582](https://togithub.com/pre-commit/pre-commit-hooks/issues/582) PR by [@&#8203;jack1142](https://togithub.com/jack1142).
    -   [#&#8203;581](https://togithub.com/pre-commit/pre-commit-hooks/issues/581) issue by [@&#8203;jack1142](https://togithub.com/jack1142).
-   `check-shebang-scripts-are-executable`: new hook which ensures shebang'd scripts are executable.
    -   [#&#8203;545](https://togithub.com/pre-commit/pre-commit-hooks/issues/545) PR by [@&#8203;scop](https://togithub.com/scop).

##### Fixes

-   `check-executables-have-shebangs`: Short circuit shebang lookup on windows.
    -   [#&#8203;544](https://togithub.com/pre-commit/pre-commit-hooks/issues/544) PR by [@&#8203;scop](https://togithub.com/scop).
-   `requirements-txt-fixer`: Fix comments which have indentation
    -   [#&#8203;549](https://togithub.com/pre-commit/pre-commit-hooks/issues/549) PR by [@&#8203;greshilov](https://togithub.com/greshilov).
    -   [#&#8203;548](https://togithub.com/pre-commit/pre-commit-hooks/issues/548) issue by [@&#8203;greshilov](https://togithub.com/greshilov).
-   `pretty-format-json`: write to stdout using UTF-8 encoding.
    -   [#&#8203;571](https://togithub.com/pre-commit/pre-commit-hooks/issues/571) PR by [@&#8203;jack1142](https://togithub.com/jack1142).
    -   [#&#8203;570](https://togithub.com/pre-commit/pre-commit-hooks/issues/570) issue by [@&#8203;jack1142](https://togithub.com/jack1142).
-   Use more inclusive language.
    -   [#&#8203;599](https://togithub.com/pre-commit/pre-commit-hooks/issues/599) PR by [@&#8203;asottile](https://togithub.com/asottile).

##### Breaking changes

-   Remove deprecated hooks: `flake8`, `pyflakes`, `autopep8-wrapper`.
    -   [#&#8203;597](https://togithub.com/pre-commit/pre-commit-hooks/issues/597) PR by [@&#8203;asottile](https://togithub.com/asottile).

</details>

---

### Configuration

📅 **Schedule**: At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻️ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box.

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/synthtool).
Source-Link: googleapis/synthtool@333fd90
Post-Processor: gcr.io/repo-automation-bots/owlbot-python:latest@sha256:b8c131c558606d3cea6e18f8e87befbd448c1482319b0db3c5d5388fa6ea72e3
fixes #907
Source-Link: googleapis/synthtool@b0eb8a8
Post-Processor: gcr.io/repo-automation-bots/owlbot-python:latest@sha256:df50e8d462f86d6bcb42f27ecad55bb12c404f1c65de9c6fe4c4d25120080bd6

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
'six.wraps' preserves metdata better under Python 2.7, which makes
stuff like pytest fixture injection work with plain functions.

Closes #36.
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Source-Link: googleapis/synthtool@53ea389
Post-Processor: gcr.io/repo-automation-bots/owlbot-python:latest@sha256:e1793a23ae0ee9aafb2e3a53b564a351f74790dbe3c2d75f8fc3b8c43e5c036c
Source-Link: googleapis/synthtool@e44dc0c
Post-Processor: gcr.io/repo-automation-bots/owlbot-python:latest@sha256:5ff7446edeaede81c3ed58b23a4e76a5403fba1350ce28478045657303b6479d
Source-Link: googleapis/synthtool@dd05f9d
Post-Processor: gcr.io/repo-automation-bots/owlbot-python:latest@sha256:aea14a583128771ae8aefa364e1652f3c56070168ef31beb203534222d842b8b
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @parthea, 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 undertakes a significant chore: the migration of the python-test-utils library into a new, standardized package location. This move aims to consolidate and organize shared testing infrastructure, ensuring that the utilities are consistently applied and maintained across projects. The changes introduce a robust set of CI/CD pipelines and development tools, establishing a solid foundation for future development and testing efforts within the new structure.

Highlights

  • Code Migration: The entire python-test-utils library has been migrated into a new package structure under packages/google-cloud-testutils, as indicated by the creation of numerous files within this new directory.
  • Comprehensive CI/CD Setup: Extensive Continuous Integration and Continuous Deployment (CI/CD) configurations have been added, including GitHub Actions workflows for linting and unit tests, and Kokoro configurations for continuous, presubmit, and sample testing across various Python versions (3.7-3.14).
  • Development Workflow Standardization: New development workflow tools and configurations have been introduced, such as .flake8 for linting, .pre-commit-config.yaml for pre-commit hooks (Black, Flake8), mypy.ini for type checking, and noxfile.py for managing development tasks, ensuring consistent code quality and development practices.
  • Enhanced Testing Utilities: Key utility modules within test_utils have been included, providing functionalities like orchestrate for deterministic concurrency testing, prefixer for resource ID management, lower_bound_checker for dependency constraint validation, and retry mechanisms for robust test execution.
  • Metadata and Documentation: Standard repository metadata (.repo-metadata.json), contributing guidelines (CONTRIBUTING.md), issue/PR templates, a changelog (CHANGELOG.md), and a code of conduct (CODE_OF_CONDUCT.md) have been added to the new package, improving project maintainability and community engagement.
Changelog
  • packages/google-cloud-testutils/.flake8
    • Added Flake8 configuration for linting rules and exclusions.
  • packages/google-cloud-testutils/.github/CODEOWNERS
    • Added code ownership definitions for the new package.
  • packages/google-cloud-testutils/.github/CONTRIBUTING.md
    • Added contributing guidelines for the new package.
  • packages/google-cloud-testutils/.github/ISSUE_TEMPLATE/bug_report.md
    • Added a bug report issue template.
  • packages/google-cloud-testutils/.github/ISSUE_TEMPLATE/feature_request.md
    • Added a feature request issue template.
  • packages/google-cloud-testutils/.github/ISSUE_TEMPLATE/support_request.md
    • Added a support request issue template.
  • packages/google-cloud-testutils/.github/PULL_REQUEST_TEMPLATE.md
    • Added a pull request template with submission checklist.
  • packages/google-cloud-testutils/.github/auto-label.yaml
    • Added auto-labeling configuration for pull requests.
  • packages/google-cloud-testutils/.github/blunderbuss.yml
    • Added Blunderbuss configuration for automated issue and PR assignments.
  • packages/google-cloud-testutils/.github/header-checker-lint.yml
    • Added header checker lint configuration.
  • packages/google-cloud-testutils/.github/workflows/lint.yml
    • Added GitHub Actions workflow for linting, supporting Python 3.14.
  • packages/google-cloud-testutils/.github/workflows/unittest.yml
    • Added GitHub Actions workflow for unit tests across Python versions 3.7-3.14, including coverage reporting.
  • packages/google-cloud-testutils/.gitignore
    • Added a standard .gitignore file for Python projects.
  • packages/google-cloud-testutils/.kokoro/build.sh
    • Added Kokoro build script for executing Nox sessions and integrating with FlakyBot.
  • packages/google-cloud-testutils/.kokoro/continuous/common.cfg
    • Added common Kokoro continuous build configuration.
  • packages/google-cloud-testutils/.kokoro/continuous/continuous.cfg
    • Added Kokoro continuous build configuration for linting and lower bounds checks.
  • packages/google-cloud-testutils/.kokoro/continuous/prerelease-deps.cfg
    • Added Kokoro continuous build configuration for prerelease dependencies.
  • packages/google-cloud-testutils/.kokoro/populate-secrets.sh
    • Added script to populate secrets from Secret Manager for Kokoro builds.
  • packages/google-cloud-testutils/.kokoro/presubmit/common.cfg
    • Added common Kokoro presubmit build configuration.
  • packages/google-cloud-testutils/.kokoro/presubmit/prerelease-deps.cfg
    • Added Kokoro presubmit build configuration for prerelease dependencies.
  • packages/google-cloud-testutils/.kokoro/presubmit/presubmit.cfg
    • Added Kokoro presubmit build configuration for linting and lower bounds checks.
  • packages/google-cloud-testutils/.kokoro/samples/lint/common.cfg
    • Added common Kokoro sample lint configuration.
  • packages/google-cloud-testutils/.kokoro/samples/lint/continuous.cfg
    • Added Kokoro continuous sample lint configuration.
  • packages/google-cloud-testutils/.kokoro/samples/lint/periodic.cfg
    • Added Kokoro periodic sample lint configuration.
  • packages/google-cloud-testutils/.kokoro/samples/lint/presubmit.cfg
    • Added Kokoro presubmit sample lint configuration.
  • packages/google-cloud-testutils/.kokoro/samples/python3.10/common.cfg
    • Added common Kokoro sample test configuration for Python 3.10.
  • packages/google-cloud-testutils/.kokoro/samples/python3.10/continuous.cfg
    • Added Kokoro continuous sample test configuration for Python 3.10.
  • packages/google-cloud-testutils/.kokoro/samples/python3.10/periodic-head.cfg
    • Added Kokoro periodic sample test against head configuration for Python 3.10.
  • packages/google-cloud-testutils/.kokoro/samples/python3.10/periodic.cfg
    • Added Kokoro periodic sample test configuration for Python 3.10.
  • packages/google-cloud-testutils/.kokoro/samples/python3.10/presubmit.cfg
    • Added Kokoro presubmit sample test configuration for Python 3.10.
  • packages/google-cloud-testutils/.kokoro/samples/python3.11/common.cfg
    • Added common Kokoro sample test configuration for Python 3.11.
  • packages/google-cloud-testutils/.kokoro/samples/python3.11/continuous.cfg
    • Added Kokoro continuous sample test configuration for Python 3.11.
  • packages/google-cloud-testutils/.kokoro/samples/python3.11/periodic-head.cfg
    • Added Kokoro periodic sample test against head configuration for Python 3.11.
  • packages/google-cloud-testutils/.kokoro/samples/python3.11/periodic.cfg
    • Added Kokoro periodic sample test configuration for Python 3.11.
  • packages/google-cloud-testutils/.kokoro/samples/python3.11/presubmit.cfg
    • Added Kokoro presubmit sample test configuration for Python 3.11.
  • packages/google-cloud-testutils/.kokoro/samples/python3.12/common.cfg
    • Added common Kokoro sample test configuration for Python 3.12.
  • packages/google-cloud-testutils/.kokoro/samples/python3.12/continuous.cfg
    • Added Kokoro continuous sample test configuration for Python 3.12.
  • packages/google-cloud-testutils/.kokoro/samples/python3.12/periodic-head.cfg
    • Added Kokoro periodic sample test against head configuration for Python 3.12.
  • packages/google-cloud-testutils/.kokoro/samples/python3.12/periodic.cfg
    • Added Kokoro periodic sample test configuration for Python 3.12.
  • packages/google-cloud-testutils/.kokoro/samples/python3.12/presubmit.cfg
    • Added Kokoro presubmit sample test configuration for Python 3.12.
  • packages/google-cloud-testutils/.kokoro/samples/python3.13/common.cfg
    • Added common Kokoro sample test configuration for Python 3.13.
  • packages/google-cloud-testutils/.kokoro/samples/python3.13/continuous.cfg
    • Added Kokoro continuous sample test configuration for Python 3.13.
  • packages/google-cloud-testutils/.kokoro/samples/python3.13/periodic-head.cfg
    • Added Kokoro periodic sample test against head configuration for Python 3.13.
  • packages/google-cloud-testutils/.kokoro/samples/python3.13/periodic.cfg
    • Added Kokoro periodic sample test configuration for Python 3.13.
  • packages/google-cloud-testutils/.kokoro/samples/python3.13/presubmit.cfg
    • Added Kokoro presubmit sample test configuration for Python 3.13.
  • packages/google-cloud-testutils/.kokoro/samples/python3.14/common.cfg
    • Added common Kokoro sample test configuration for Python 3.14.
  • packages/google-cloud-testutils/.kokoro/samples/python3.14/continuous.cfg
    • Added Kokoro continuous sample test configuration for Python 3.14.
  • packages/google-cloud-testutils/.kokoro/samples/python3.14/periodic-head.cfg
    • Added Kokoro periodic sample test against head configuration for Python 3.14.
  • packages/google-cloud-testutils/.kokoro/samples/python3.14/periodic.cfg
    • Added Kokoro periodic sample test configuration for Python 3.14.
  • packages/google-cloud-testutils/.kokoro/samples/python3.14/presubmit.cfg
    • Added Kokoro presubmit sample test configuration for Python 3.14.
  • packages/google-cloud-testutils/.kokoro/samples/python3.7/common.cfg
    • Added common Kokoro sample test configuration for Python 3.7.
  • packages/google-cloud-testutils/.kokoro/samples/python3.7/continuous.cfg
    • Added Kokoro continuous sample test configuration for Python 3.7.
  • packages/google-cloud-testutils/.kokoro/samples/python3.7/periodic-head.cfg
    • Added Kokoro periodic sample test against head configuration for Python 3.7.
  • packages/google-cloud-testutils/.kokoro/samples/python3.7/periodic.cfg
    • Added Kokoro periodic sample test configuration for Python 3.7.
  • packages/google-cloud-testutils/.kokoro/samples/python3.7/presubmit.cfg
    • Added Kokoro presubmit sample test configuration for Python 3.7.
  • packages/google-cloud-testutils/.kokoro/samples/python3.8/common.cfg
    • Added common Kokoro sample test configuration for Python 3.8.
  • packages/google-cloud-testutils/.kokoro/samples/python3.8/continuous.cfg
    • Added Kokoro continuous sample test configuration for Python 3.8.
  • packages/google-cloud-testutils/.kokoro/samples/python3.8/periodic-head.cfg
    • Added Kokoro periodic sample test against head configuration for Python 3.8.
  • packages/google-cloud-testutils/.kokoro/samples/python3.8/periodic.cfg
    • Added Kokoro periodic sample test configuration for Python 3.8.
  • packages/google-cloud-testutils/.kokoro/samples/python3.8/presubmit.cfg
    • Added Kokoro presubmit sample test configuration for Python 3.8.
  • packages/google-cloud-testutils/.kokoro/samples/python3.9/common.cfg
    • Added common Kokoro sample test configuration for Python 3.9.
  • packages/google-cloud-testutils/.kokoro/samples/python3.9/continuous.cfg
    • Added Kokoro continuous sample test configuration for Python 3.9.
  • packages/google-cloud-testutils/.kokoro/samples/python3.9/periodic-head.cfg
    • Added Kokoro periodic sample test against head configuration for Python 3.9.
  • packages/google-cloud-testutils/.kokoro/samples/python3.9/periodic.cfg
    • Added Kokoro periodic sample test configuration for Python 3.9.
  • packages/google-cloud-testutils/.kokoro/samples/python3.9/presubmit.cfg
    • Added Kokoro presubmit sample test configuration for Python 3.9.
  • packages/google-cloud-testutils/.kokoro/test-samples-against-head.sh
    • Added a customized test runner for samples, specifically for testing against head.
  • packages/google-cloud-testutils/.kokoro/test-samples-impl.sh
    • Added the core implementation script for sample testing in Kokoro.
  • packages/google-cloud-testutils/.kokoro/test-samples.sh
    • Added the default test runner for samples, handling periodic builds and rewinding to the latest release.
  • packages/google-cloud-testutils/.kokoro/trampoline.sh
    • Added a trampoline script for Kokoro builds, handling secret population and cleanup.
  • packages/google-cloud-testutils/.kokoro/trampoline_v2.sh
    • Added an updated trampoline script (v2) for Docker image management and test execution in CI environments.
  • packages/google-cloud-testutils/.librarian/state.yaml
    • Added Librarian configuration for library version management.
  • packages/google-cloud-testutils/.pre-commit-config.yaml
    • Added pre-commit configuration for code formatting (Black) and linting (Flake8).
  • packages/google-cloud-testutils/.repo-metadata.json
    • Added repository metadata, including name, documentation, issue tracker, and language.
  • packages/google-cloud-testutils/.trampolinerc
    • Added Trampoline build system configuration.
  • packages/google-cloud-testutils/CHANGELOG.md
    • Added the changelog for google-cloud-testutils, detailing past releases and features like Python 3.14 support and the Prefixer class.
  • packages/google-cloud-testutils/CODE_OF_CONDUCT.md
    • Added the Code of Conduct document.
  • packages/google-cloud-testutils/LICENSE
    • Added the Apache 2.0 license file.
  • packages/google-cloud-testutils/MANIFEST.in
    • Added manifest file for Python package distribution.
  • packages/google-cloud-testutils/README.rst
    • Added the README file for the Python Test Utils library.
  • packages/google-cloud-testutils/SECURITY.md
    • Added the security policy document.
  • packages/google-cloud-testutils/mypy.ini
    • Added MyPy configuration for type checking.
  • packages/google-cloud-testutils/noxfile.py
    • Added Nox configuration for managing development tasks, including linting, formatting, type checking, unit tests, and lower bound checks across Python 3.7-3.14.
  • packages/google-cloud-testutils/pytest.ini
    • Added Pytest configuration to treat all warnings as errors.
  • packages/google-cloud-testutils/renovate.json
    • Added Renovate bot configuration for dependency updates.
  • packages/google-cloud-testutils/scripts/decrypt-secrets.sh
    • Added script to decrypt secrets for sample testing.
  • packages/google-cloud-testutils/scripts/readme-gen/readme_gen.py
    • Added a Python script for generating READMEs from YAML configuration.
  • packages/google-cloud-testutils/scripts/readme-gen/templates/README.tmpl.rst
    • Added Jinja2 template for README generation.
  • packages/google-cloud-testutils/scripts/readme-gen/templates/auth.tmpl.rst
    • Added Jinja2 template for authentication setup instructions.
  • packages/google-cloud-testutils/scripts/readme-gen/templates/auth_api_key.tmpl.rst
    • Added Jinja2 template for API key authentication instructions.
  • packages/google-cloud-testutils/scripts/readme-gen/templates/install_deps.tmpl.rst
    • Added Jinja2 template for dependency installation instructions.
  • packages/google-cloud-testutils/scripts/readme-gen/templates/install_portaudio.tmpl.rst
    • Added Jinja2 template for PortAudio installation instructions.
  • packages/google-cloud-testutils/setup.py
    • Added the Python package setup file, defining metadata, dependencies, console scripts, and Python version classifiers (3.7-3.14).
  • packages/google-cloud-testutils/test_utils/init.py
    • Added the __init__.py file for the test_utils package, including version import.
  • packages/google-cloud-testutils/test_utils/imports.py
    • Added utility for conditionally failing imports for testing purposes.
  • packages/google-cloud-testutils/test_utils/lower_bound_checker/lower_bound_checker.py
    • Added a command-line tool to check and update lower bounds of dependencies in setup.py against constraints files.
  • packages/google-cloud-testutils/test_utils/orchestrate.py
    • Added a module for orchestrating deterministic concurrency tests using syncpoints.
  • packages/google-cloud-testutils/test_utils/prefixer.py
    • Added a utility class for creating and managing unique resource IDs for system tests, aiding in cleanup.
  • packages/google-cloud-testutils/test_utils/py.typed
    • Added marker file for PEP 561, indicating inline types.
  • packages/google-cloud-testutils/test_utils/retry.py
    • Added decorators for retrying functions with exponential backoff based on exceptions, results, or instance state.
  • packages/google-cloud-testutils/test_utils/system.py
    • Added utilities for system environment checks and generating unique resource IDs.
  • packages/google-cloud-testutils/test_utils/version.py
    • Added version definition for the test_utils package.
  • packages/google-cloud-testutils/test_utils/vpcsc_config.py
    • Added utility for VPCSC detection and conditional test skipping.
  • packages/google-cloud-testutils/testing/.gitignore
    • Added .gitignore for testing-related files.
  • packages/google-cloud-testutils/testing/constraints-3.7.txt
    • Added dependency constraints file for Python 3.7.
  • packages/google-cloud-testutils/tests/unit/resources/bad_package/setup.py
    • Added a test resource setup.py for a package with invalid lower bound definitions.
  • packages/google-cloud-testutils/tests/unit/resources/good_package/setup.py
    • Added a test resource setup.py for a package with valid lower bound definitions.
  • packages/google-cloud-testutils/tests/unit/test_lower_bound_checker.py
    • Added unit tests for the lower_bound_checker utility.
  • packages/google-cloud-testutils/tests/unit/test_orchestrate.py
    • Added unit tests for the orchestrate concurrency testing utility.
  • packages/google-cloud-testutils/tests/unit/test_prefixer.py
    • Added unit tests for the prefixer utility.
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.

@google-cla
Copy link

google-cla bot commented Feb 9, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

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 PR migrates the python-test-utils library into a new package, involving extensive changes across source code and configuration files. A high-severity vulnerability was identified in readme_gen.py due to unsafe YAML deserialization using yaml.load(), which can lead to arbitrary code execution; yaml.safe_load() is recommended. Additionally, there are opportunities to update hardcoded paths and URLs from the old repository, address potentially broken CI configurations, and modernize some code, including Python 2 compatibility fixes and improved version parsing. All original comments have been retained as they do not contradict any provided rules.

I am having trouble creating individual review comments. Click here to see my feedback.

packages/google-cloud-testutils/.github/workflows/unittest.yml (32)

critical

The version v6 for actions/upload-artifact appears to be invalid. The latest stable version is v4. Using an invalid version will cause the workflow to fail.

      uses: actions/upload-artifact@v4

packages/google-cloud-testutils/.github/workflows/unittest.yml (54)

critical

The version v7 for actions/download-artifact appears to be invalid. The latest stable version is v4. Using an invalid version will cause the workflow to fail.

      uses: actions/download-artifact@v4

packages/google-cloud-testutils/scripts/readme-gen/readme_gen.py (57)

security-high high

The use of yaml.load() is a high-severity vulnerability as it can lead to arbitrary code execution if the YAML file is compromised. It is deprecated in modern PyYAML versions without a Loader argument. Please use yaml.safe_load() instead to securely parse YAML files and prevent potential code execution.

        config = yaml.safe_load(f)

packages/google-cloud-testutils/.kokoro/continuous/common.cfg (17-26)

high

The paths for build_file and TRAMPOLINE_BUILD_FILE seem to be hardcoded with the old repository name python-test-utils. After migrating to a monorepo, these paths are likely incorrect and will cause CI failures. Please update these paths to reflect the new directory structure. This issue is present in multiple Kokoro configuration files throughout the .kokoro directory.

packages/google-cloud-testutils/.github/PULL_REQUEST_TEMPLATE.md (2)

medium

This link to create a new issue points to the old repository. It should be updated to point to the new issue tracker for this package within the monorepo.

- [ ] Make sure to open an issue as a [bug/issue](https://github.com/googleapis/google-cloud-python/issues/new/choose) before writing your code!  That way we can discuss the change, evaluate designs, and agree on the general idea

packages/google-cloud-testutils/.repo-metadata.json (5-10)

medium

The client_documentation, issue_tracker, and repo fields appear to be pointing to the old standalone repository. Since this package is being migrated into a monorepo, these should be updated to reflect the new location. For example, repo should likely be the name of the monorepo (e.g., googleapis/google-cloud-python), and the URLs should be adjusted accordingly.

packages/google-cloud-testutils/setup.py (24-27)

medium

Reading the version number using a regex is a bit fragile. A more robust approach is to execute version.py and read the __version__ variable from a dictionary. This avoids issues if the formatting of version.py changes.

version_info = {}
with open(os.path.join(PACKAGE_ROOT, "test_utils/version.py")) as fp:
    exec(fp.read(), version_info)
version = version_info["__version__"]

packages/google-cloud-testutils/test_utils/retry.py (90)

medium

For Python 3, super() can be called without arguments. This makes the code cleaner and less prone to errors if the class name changes.

        super().__init__(max_tries, delay, backoff, logger)

packages/google-cloud-testutils/test_utils/retry.py (148)

medium

For Python 3, super() can be called without arguments. This makes the code cleaner and less prone to errors if the class name changes.

        super().__init__(max_tries, delay, backoff, logger)

packages/google-cloud-testutils/test_utils/retry.py (203)

medium

For Python 3, super() can be called without arguments. This makes the code cleaner and less prone to errors if the class name changes.

        super().__init__(max_tries, delay, backoff, logger)

packages/google-cloud-testutils/tests/unit/test_orchestrate.py (18-21)

medium

The try...except ImportError block for importing mock is a pattern for Python 2 compatibility. Since this package requires Python 3.7+, this is no longer necessary. You can directly import mock from unittest.

from unittest import mock

@parthea
Copy link
Contributor Author

parthea commented Feb 9, 2026

Wait for cl/867743948

@parthea parthea marked this pull request as ready for review February 9, 2026 21:26
@parthea parthea requested review from a team as code owners February 9, 2026 21:26
Copy link
Contributor

@daniel-sanche daniel-sanche left a comment

Choose a reason for hiding this comment

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

LGTM

@parthea parthea added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Feb 9, 2026
@parthea
Copy link
Contributor Author

parthea commented Feb 9, 2026

This is ready for review but not merge

@parthea parthea removed the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Feb 9, 2026
@parthea parthea merged commit 151eeae into main Feb 9, 2026
28 checks passed
@parthea parthea deleted the migration.python-test-utils.migration.2026-02-09_17-15-38.migrate branch February 9, 2026 22:52
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.