Skip to content

chore(generator): support parallel system test execution in generated noxfiles - #17430

Closed
ohmayr wants to merge 1 commit into
mainfrom
update-generator-to-run-parallel-tests
Closed

chore(generator): support parallel system test execution in generated noxfiles#17430
ohmayr wants to merge 1 commit into
mainfrom
update-generator-to-run-parallel-tests

Conversation

@ohmayr

Copy link
Copy Markdown
Contributor

Updates the default noxfile.py template (noxfile.py.j2) in gapic-generator to support parallel test execution for system test suites by default using pytest-xdist. This allows all generated python client library packages to run their system tests in parallel.

  • Template Updates:
    • Added "pytest-xdist" to SYSTEM_TEST_STANDARD_DEPENDENCIES in gapic/templates/noxfile.py.j2.
    • Updated py.test invocations in the system(session) session of noxfile.py.j2 to run with parallel worker allocation (-n auto).

@ohmayr
ohmayr requested a review from a team as a code ownerJune 11, 2026 16:35

@gemini-code-assistgemini-code-assistBot 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 parallel execution for system tests by adding pytest-xdist to the dependencies and configuring pytest to run with -n auto in the noxfile.py.j2 template and its generated golden files. The reviewer recommends making the number of parallel workers configurable via an environment variable (e.g., NOX_SYSTEM_WORKERS) instead of hardcoding auto to prevent potential flakiness, race conditions, or API rate-limiting issues when interacting with live Google Cloud resources.

Comment threadpackages/gapic-generator/gapic/templates/noxfile.py.j2
Comment threadpackages/gapic-generator/gapic/templates/noxfile.py.j2
@ohmayrohmayr changed the title feat: support parallel system test execution in generated noxfileschore(generator): support parallel system test execution in generated noxfilesJun 11, 2026
@ohmayrohmayr added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Jun 11, 2026
@ohmayr

Copy link
Copy Markdown
ContributorAuthor

I am going to hold this one off until we can test the changes across all the packages that have system tests.

@daniel-sanche

Copy link
Copy Markdown
Contributor

I wonder if this could cause failures in some packages? Not all tests are written with concurrency in mind. And I could imagine some backends may have limitations too

@ohmayrohmayr closed this Aug 14, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do not mergeIndicates a pull request not ready for merge, due to either quality or timing.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@ohmayr@daniel-sanche