Skip to content

tests: remove tests for protobuf cpp backend#2585

Merged
parthea merged 5 commits intomainfrom
remove-cpp
Mar 12, 2026
Merged

tests: remove tests for protobuf cpp backend#2585
parthea merged 5 commits intomainfrom
remove-cpp

Conversation

@parthea
Copy link
Contributor

@parthea parthea commented Mar 12, 2026

PR #2502 updated the minimum version of Protobuf to 4.x.

The cpp protobuf implementation backend is only supported with Protobuf 3.x, so we can remove it from tests.
https://github.com/protocolbuffers/protobuf/tree/main/python#implementation-backends

Fixes #2388

@parthea parthea requested a review from a team as a code owner March 12, 2026 11:57
@product-auto-label product-auto-label bot added the size: m Pull request size is medium. label Mar 12, 2026
@gemini-code-assist
Copy link
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 streamlines the project's testing infrastructure by eliminating support for the 'cpp' protobuf implementation backend. This change is a direct consequence of updating the minimum required Protobuf version to 4.x, which is incompatible with the 'cpp' backend. By removing the outdated test configurations and associated logic, the PR simplifies the test suite and ensures that all tests run against currently supported protobuf implementations, improving maintainability and relevance.

Highlights

  • Test Configuration Update: The 'cpp' protobuf implementation has been removed from the protobuf_implementation parameter list in unit test configurations across various noxfile.py files.
  • Dependency and Logic Removal: Conditional logic and specific dependency installations related to the 'cpp' protobuf backend, including the protobuf<4 requirement, were removed as they are no longer necessary.
  • Alignment with Protobuf 4.x: These changes align the test suite with the project's updated minimum Protobuf version (4.x), which no longer supports the 'cpp' backend.
Changelog
  • gapic/templates/noxfile.py.j2
    • Removed 'cpp' from the protobuf_implementation parameter list.
    • Removed the conditional skip for 'cpp' implementation on Python 3.11+.
    • Removed the session.install("protobuf<4") line specific to the 'cpp' implementation.
  • tests/integration/goldens/asset/noxfile.py
    • Removed 'cpp' from the protobuf_implementation parameter list.
    • Removed the conditional skip for 'cpp' implementation on Python 3.11+.
    • Removed the session.install("protobuf<4") line specific to the 'cpp' implementation.
  • tests/integration/goldens/credentials/noxfile.py
    • Removed 'cpp' from the protobuf_implementation parameter list.
    • Removed the conditional skip for 'cpp' implementation on Python 3.11+.
    • Removed the session.install("protobuf<4") line specific to the 'cpp' implementation.
  • tests/integration/goldens/eventarc/noxfile.py
    • Removed 'cpp' from the protobuf_implementation parameter list.
    • Removed the conditional skip for 'cpp' implementation on Python 3.11+.
    • Removed the session.install("protobuf<4") line specific to the 'cpp' implementation.
  • tests/integration/goldens/logging/noxfile.py
    • Removed 'cpp' from the protobuf_implementation parameter list.
    • Removed the conditional skip for 'cpp' implementation on Python 3.11+.
    • Removed the session.install("protobuf<4") line specific to the 'cpp' implementation.
  • tests/integration/goldens/logging_internal/noxfile.py
    • Removed 'cpp' from the protobuf_implementation parameter list.
    • Removed the conditional skip for 'cpp' implementation on Python 3.11+.
    • Removed the session.install("protobuf<4") line specific to the 'cpp' implementation.
  • tests/integration/goldens/redis/noxfile.py
    • Removed 'cpp' from the protobuf_implementation parameter list.
    • Removed the conditional skip for 'cpp' implementation on Python 3.11+.
    • Removed the session.install("protobuf<4") line specific to the 'cpp' implementation.
  • tests/integration/goldens/redis_selective/noxfile.py
    • Removed 'cpp' from the protobuf_implementation parameter list.
    • Removed the conditional skip for 'cpp' implementation on Python 3.11+.
    • Removed the session.install("protobuf<4") line specific to the 'cpp' implementation.
Activity
  • No human activity (comments, reviews) has been recorded on this pull request yet.
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

This pull request aims to remove tests for the cpp protobuf backend, which is the correct approach after upgrading to Protobuf 4.x. The changes are on the right track, but there are two issues to address:

  1. Incomplete Removal: The cpp implementation is removed from the unit test session, but it's still present in the prerelease_deps session in the template file gapic/templates/noxfile.py.j2. This should also be removed for consistency.
  2. Manual Edit of Generated Files: The "golden" files under tests/integration/goldens/ have been edited manually. The repository's guidelines require that changes to generated files are made by updating the template and then regenerating the files.

To fix this, please update gapic/templates/noxfile.py.j2 to remove the cpp backend from all relevant test sessions, and then regenerate the golden files.

@nox.parametrize(
"protobuf_implementation",
["python", "upb", "cpp"],
["python", "upb"],
Copy link
Contributor

Choose a reason for hiding this comment

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

high

This appears to be a generated "golden" file. According to the repository's general rules, changes to generated code should be made by updating the generator template (gapic/templates/noxfile.py.j2) and then regenerating the output files, rather than editing them manually. Please revert the manual changes to the golden files, update the template completely, and then regenerate them.

References
  1. Changes to generated code should be made by updating the generator template and then regenerating the output files, rather than directly modifying the generated files.

@parthea parthea enabled auto-merge (squash) March 12, 2026 12:48
Copy link
Contributor

@chalmerlowe chalmerlowe 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 merged commit 12879ca into main Mar 12, 2026
113 checks passed
@parthea parthea deleted the remove-cpp branch March 12, 2026 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size: m Pull request size is medium.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove the 'cpp' implementation once support for Protobuf 3.x is dropped.

3 participants