Skip to content

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

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

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

@ohmayr ohmayr commented Jun 11, 2026

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 owner June 11, 2026 16:35

@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 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 thread packages/gapic-generator/gapic/templates/noxfile.py.j2
Comment thread packages/gapic-generator/gapic/templates/noxfile.py.j2
@ohmayr ohmayr changed the title feat: support parallel system test execution in generated noxfiles chore(generator): support parallel system test execution in generated noxfiles Jun 11, 2026
@ohmayr ohmayr added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Jun 11, 2026
@ohmayr

ohmayr commented Jun 11, 2026

Copy link
Copy Markdown
Contributor Author

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

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

Labels

do not merge Indicates 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