Repository navigation
feat(e2e): add reusable in-process example runner harness - #873
Merged
Merged
Conversation
This was referenced Sep 14, 2026
There was a problem hiding this comment.
Code Review
This pull request introduces a reusable test harness and subprocess execution utilities for XMC example jobs, including Bazel build configurations and comprehensive unit tests. The review feedback suggests several robustness and debuggability improvements: directly trusting the XMANAGER_ENDPOINT environment variable without performing a transient port check, reusing an existing XMC_AUTH_TOKEN from the environment to avoid redundant token requests, catching subprocess.TimeoutExpired to log captured output upon timeouts, and simplifying the corresponding unit tests.
janzak-dev
force-pushed
the
feat/e2e-example-runner-harness
branch
from
September 16, 2026 09:16
00f8248 to
fcabeb3
Compare
janzak-dev
marked this pull request as ready for review
September 16, 2026 11:01
- Introduce ExampleRunner class for executing XManager example scripts in subprocess with injected auth environment - Add Bazel targets and unit tests in test/e2e/examples - Wire examples_e2e_pkg dependency into root test/e2e BUILD.bazel TAG=agy CONV=251c6b67-d377-495f-841d-676ceff5fb73
…and capture timeout output in example runner - Trust XMANAGER_ENDPOINT if set without socket checking. - Reuse existing XMC_AUTH_TOKEN if present before fetching Dex token. - Capture and log stdout/stderr upon subprocess.TimeoutExpired. - Update and simplify unit tests in example_runner_test.py. Addresses review comments on PR #873: - #873 (comment) - #873 (comment) - #873 (comment) - #873 (comment) TAG=agy CONV=f070b97a-6c09-4041-be95-0e08bf1c0131
…le runner Add TODO above parse_launch_output explaining that regex matching stdout is brittle and recommending standardizing example launch outputs explicitly. TAG=agy CONV=f070b97a-6c09-4041-be95-0e08bf1c0131
Remove artificial PROJECT_ID, IMAGE_PATH, and QUEUE_NAME fallbacks from execute_example_launch proc_env, requiring callers or environment to supply actual workload parameters. TAG=agy CONV=f070b97a-6c09-4041-be95-0e08bf1c0131
janzak-dev
force-pushed
the
feat/e2e-example-runner-harness
branch
from
September 16, 2026 11:51
b586396 to
79f929c
Compare
andrzejfudro
previously approved these changes
Sep 16, 2026
…arden stdout parsing - Remove unused admin user/password constants from example_runner.py. - Rename port_forward_grpc_service to resolve_grpc_endpoint. - Harden parse_launch_output regexes across all example workload stdout patterns. - Add parameterized unit tests in example_runner_test.py. Addresses review comments on PR #873: - #873 (comment) - #873 (comment) - #873 (comment) TAG=agy CONV=f070b97a-6c09-4041-be95-0e08bf1c0131
andrzejfudro
approved these changes
Sep 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Introduces an in-process, reusable Python test execution harness (
example_runner) and comprehensive unit tests for executing XMC developer example scripts within end-to-end integration test suites.Motivation & Context
Testing real example scripts (
examples/chart_artifact_job/launch.py,examples/simple_job/launch.py, etc.) in end-to-end integration environments requires:127.0.0.1:50051) and injecting minted Dex OIDC Bearer tokens (XMC_AUTH_TOKEN),XMC_INSECURE_GRPC=true, and persona email (XMC_USER_EMAIL).xid), WorkUnit ID (wid), and canonical Artifact name.subprocess.TimeoutExpiredand process failures to capture combined stdout/stderr for immediate troubleshooting in CI/CD.This PR introduces
test/e2e/examples/example_runner.pyand its Bazel targets as the shared harness for all Tier 2 and Tier 3 workflow tests.How Downstream Tests Consume
example_runner(e.g. PR #714)Downstream integration tests (such as PR #714 - Chart Artifact E2E test) use
example_runneras the workload execution and metadata extraction bridge:Stack Position
This PR is Layer 2 of the E2E PR stack:
feat(e2e): harden test orchestration, auth token helpers, and kind resolver): Merged intomainfeat(e2e): add reusable in-process example runner harness): Base:mainfeat(e2e): add Tier 2 integration test for chart artifact example workflow): Base:feat/e2e-example-runner-harnessKey Changes
test/e2e/examples/example_runner.py:execute_example_launch()with subprocess execution and auth environment injection (XMC_AUTH_TOKEN,XMANAGER_ENDPOINT,XMC_INSECURE_GRPC).parse_launch_output()to extractxid,wid, andartifact_namefrom stdout logs into a typedExampleLaunchResult.port_forward_grpc_service()context manager to resolve or verify local gRPC endpoints.subprocess.TimeoutExpired.test/e2e/examples/example_runner_test.py:test/e2e/examples/BUILD.bazel:example_runner_lib,example_runner_test, andexamples_pkgtargets.Assumptions
None — requirements were fully specified.
Verification & Testing
bazel test //test/e2e/examples:...(PASSED)bazel test //test/e2e/...(12/12 test targets PASSED)./.githooks/pre-commit(all checks passed: buildifier, gofmt, golangci-lint, addlicense, ruff)./tools/analyze_diff_size.py --base-ref origin/main(0 prod / 500 test / 500 total lines — within all thresholds)Related Issues / Bugs
N/A
TAG=agy
CONV=f070b97a-6c09-4041-be95-0e08bf1c0131