Skip to content

tests: add system tests for resumable uploads - #18539

Merged
parthea merged 8 commits into
mainfrom
add-support-for-resumable-uploads-4
Oct 8, 2026
Merged

parthea merged 8 commits into
mainfrom
add-support-for-resumable-uploads-4

Conversation

@parthea

@parthea parthea commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Fixes b/562515672

@gemini-code-assist gemini-code-assist Bot left a comment

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.

Code Review

This pull request introduces comprehensive system tests for the resumable upload feature in the GAPIC generator. It adds conditional imports and setup for ResumableUploadServiceClient and its REST interceptor in conftest.py, along with helper functions to initiate and resume uploads. It also adds four new test files covering progress tracking, resumption scenarios, error recovery paths, and stall/deadline controls. There are no review comments, so I have no feedback to provide.

@parthea
parthea force-pushed the add-support-for-resumable-uploads-4 branch from f0defed to bae5b33 Compare October 1, 2026 20:04
@parthea
parthea force-pushed the add-support-for-resumable-uploads-2 branch from 39c26aa to f8fa453 Compare October 1, 2026 20:54
@parthea
parthea force-pushed the add-support-for-resumable-uploads-4 branch from bae5b33 to ed209a5 Compare October 1, 2026 21:07
if not HAS_RESUMABLE_UPLOAD_CLIENT or not HAS_RESUMABLE_UPLOAD_INTERCEPTOR:
pytest.skip("ResumableUploadServiceClient not available.")

transport_name = "rest"

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.

We need tests starting from clients created with grpc transports too, because those are the ones I'm more concerned about

I worry some of these fixtures are obscuring important details here Do we have any tests that go from creating a client to reading the result, exactly we expect end-users would?

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 created a live test which doesn't use the conftest.py fixtures: packages/gapic-generator/tests/system_live/test_google_ads_resumable_upload.py . This now runs as a system test

@parthea
parthea force-pushed the add-support-for-resumable-uploads-4 branch 3 times, most recently from be137fe to 54952a9 Compare October 1, 2026 22:34
@parthea
parthea force-pushed the add-support-for-resumable-uploads-2 branch 5 times, most recently from a07a705 to 09cea6f Compare October 3, 2026 15:01
@parthea
parthea force-pushed the add-support-for-resumable-uploads-4 branch from 54952a9 to 7a2bc54 Compare October 3, 2026 15:23
@parthea
parthea force-pushed the add-support-for-resumable-uploads-2 branch from cdacfb6 to d5a65d4 Compare October 3, 2026 15:26
@parthea
parthea force-pushed the add-support-for-resumable-uploads-4 branch 2 times, most recently from 8630d4a to c0f9005 Compare October 3, 2026 16:33
@parthea
parthea force-pushed the add-support-for-resumable-uploads-2 branch from 9425277 to dd724d6 Compare October 5, 2026 17:41
@parthea
parthea force-pushed the add-support-for-resumable-uploads-4 branch 2 times, most recently from d40a869 to 9f5d734 Compare October 5, 2026 19:09
To run the manual live Google Ads acceptance suite:
RUN_GOOGLE_ADS_ACCEPTANCE=true \\
GOOGLE_ADS_DEVELOPER_TOKEN="<developer-token>" \\
GOOGLE_ADS_LOGIN_CUSTOMER_ID="7568249731" \\

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.

This seems a little weird to see here. Are you sure this makes sense to check in? Do we have coverage gaps without TestGoogleAdsLiveAcceptance?

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 moved these to environment variables. The live acceptance test now runs as a system test

ResumableUploadSession = None


def make_resumable_upload(

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.

It looks like the tests still exercise this code in a way different than the user would. Is it possible to create a client, and start the stream using the client apis, instead of creating the session directly?

If this is the main system test, we should make sure we have good end-to-end coverage

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 created a live test which doesn't use conftest.py : packages/gapic-generator/tests/system_live/test_google_ads_resumable_upload.py

packages/gapic-generator/tests/system/conftest.py is used only for showcase integration tests

@parthea
parthea force-pushed the add-support-for-resumable-uploads-4 branch 2 times, most recently from 4847b7c to 9bcd175 Compare October 6, 2026 00:07
Base automatically changed from add-support-for-resumable-uploads-2 to main October 6, 2026 00:19
@parthea parthea closed this Oct 6, 2026
@parthea parthea reopened this Oct 6, 2026
@parthea
parthea force-pushed the add-support-for-resumable-uploads-4 branch from 9bcd175 to 2f01aca Compare October 6, 2026 16:42
@parthea
parthea marked this pull request as ready for review October 8, 2026 16:47
@parthea
parthea requested a review from a team as a code owner October 8, 2026 16:47
@parthea
parthea enabled auto-merge (squash) October 8, 2026 16:54

@daniel-sanche daniel-sanche left a comment

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.

LGTM

@parthea
parthea merged commit 25fc208 into main Oct 8, 2026
202 of 205 checks passed
@parthea
parthea deleted the add-support-for-resumable-uploads-4 branch October 8, 2026 20:59
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