Skip to content
This repository was archived by the owner on Mar 26, 2026. It is now read-only.

feat: add fragment tests#1056

Merged
software-dov merged 4 commits intogoogleapis:masterfrom
software-dov:fragment-tests
Nov 1, 2021
Merged

feat: add fragment tests#1056
software-dov merged 4 commits intogoogleapis:masterfrom
software-dov:fragment-tests

Conversation

@software-dov
Copy link
Copy Markdown
Contributor

Fragment tests are defined by a small proto file describing an API
surface with characteristics such that it is desirable to test the
generated surface for correctness or to prevent regressions.

As part of a fragment test, the generator is run on a fragment to
create a GAPIC library for the fragment. The generated unit tests
for the fragment are then executed to test the surface.

Includes fragment tests and fixes for #413 and #414 as well as fragment tests for various other previously fixed issues.

Note: the parallelization of the fragment tests is currently a standalone commit and can be removed. It dramatically speeds up execution, however, since most of the time spent per fragment is waiting on I/O or subprocesses.

@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Oct 29, 2021
Fragment tests are defined by a small proto file describing an API
surface with characteristics such that it is desirable to test the
generated surface for correctness or to prevent regressions.

As part of a fragment test, the generator is run on a fragment to
create a GAPIC library for the fragment. The generated unit tests
for the fragment are then executed to test the surface.
Within a session, e.g. Python 3.9, all fragment GAPICs are generated
and tested concurrently.
Copy link
Copy Markdown
Contributor

@busunkim96 busunkim96 left a comment

Choose a reason for hiding this comment

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

The golden files seem to need updating.

option java_package = "com.google.api";
option objc_class_prefix = "GAPI";

extend google.protobuf.MethodOptions {
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.

Where are these proto files from?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I copied them from googleapis and protobuf. My original idea was something complicated involving a hand-rolled semaphore/caching system to pull those repos as dependencies before running the fragment tests. I realized that was way too complicated, however, and just copied the three files I needed for these fragments.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

2 participants