8000 feat(tools): add common verification framework and demo workload verify CLI by janzak-dev · Pull Request #882 · google/xmc · GitHub
[go: up one dir, main page]

Skip to content

feat(tools): add common verification framework and demo workload verify CLI - #882

Merged
janzak-dev merged 9 commits into
mainfrom
feat/nightly-common-validation
Sep 16, 2026
Merged

janzak-dev merged 9 commits into
mainfrom
feat/nightly-common-validation

Conversation

@janzak-dev
@janzak-dev janzak-dev commented Sep 15, 2026 •
Copy link
Copy Markdown
Collaborator

🥞 Stack Navigation


🏛️ Role in PR Stack Architecture

This PR serves as Layer 3 (Shared Verification Framework & Baseline Test) within the 4-part multi-example execution and validation stack.

  • Stack Objective: Establish an automated, robust, end-to-end multi-example workload execution and validation framework running against xmc-nightly.
  • Layer 3 Role: Introduces tools/nightly_tests/common.py (centralized flag management, authenticated gRPC stub/channel context managers, REST client helpers, and error handling) and refactors demo_workload_verify.py as the baseline verifier for simple_job.

Summary

Introduces the shared verification module common.py alongside a hermetic test suite common_test.py, refactors demo_workload_verify.py to use clean top-level module imports, and configures .github/workflows/nightly-test-suite.yml for standard python3 -m <module> execution.

Successful run

https://github.com/google/xmc/actions/runs/34993099183

Motivation & Context

Extracting common verification logic reduces duplication across workload verifier scripts and standardizes banner logging, command-line arguments, channel lifecycle management, and error handling for the entire suite of verifiers built in Layer 4.

Key Changes

  • tools/nightly_tests/common.py: Shared verification helpers providing flag definitions, endpoint resolvers, channel contexts, REST client helpers, and banner formatters.
  • tools/nightly_tests/common_test.py: Added 13 hermetic unit tests covering flag parsing, URL resolution, banner generation, and error handling.
  • tools/nightly_tests/demo_workload_verify.py: Refactored to use common.py as the baseline test verifier with clean top-level imports (removing sys.path.insert and defensive try/except workarounds).
  • tools/nightly_tests/BUILD.bazel: Defined common py_library, common_test py_test, and updated demo_workload_verify target dependencies.
  • .github/workflows/nightly-test-suite.yml: Updated validation step to execute via "${GITHUB_WORKSPACE}/.venv/bin/python3" -m tools.nightly_tests.demo_workload_verify.

Assumptions

None — requirements were fully specified.

Verification & Testing

  • Hermetic Bazel Tests: bazel test //tools/nightly_tests:all (all tests passing 100%).
  • Pre-commit Checks: ./.githooks/pre-commit check (100% compliance).
  • Verified GitHub Actions E2E Run: Workflow Run #34984952706
    • Workload: Demo Workload (experiments/12642)
    • Outcome: PASSED (100%) — All 3 cpu-queue WorkUnits verified as COMPLETED.

Related Issues / Bugs

N/A

TAG=agy
CONV=606f1e41-6785-4137-b85b-cd0f56237339

@gemini-code-assist gemini-code-assist Bot left a comment
Copy link
8000 Copy Markdown

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 refactors the XMC nightly tests by introducing a shared common.py module containing standard flags, gRPC channel lifecycle managers, and logging helpers. The demo_workload_verify.py script is updated to leverage these common utilities, and the Bazel build configuration is adjusted accordingly. The review feedback highlights a potential parsing bug with IPv6 addresses in resolve_dashboard_endpoint, suggests restoring the required status of the xid flag to prevent tracebacks, and recommends using the new common.get_flag helper consistently instead of getattr.

Comment thread tools/nightly_tests/common.py Resolved
@janzak-dev
janzak-dev added this pull request to stack #883 September 15, 2026 07:55
@janzak-dev
janzak-dev force-pushed the feat/nightly-common-validation branch from d50bc58 to 5c3803d Compare September 15, 2026 08:00
@janzak-dev
janzak-dev force-pushed the feat/nightly-common-validation branch from 5c3803d to 0ce79f0 Compare September 15, 2026 08:06
@janzak-dev
janzak-dev force-pushed the feat/nightly-common-validation branch from 0ce79f0 to e9bfb06 Compare September 15, 2026 08:12
@janzak-dev
janzak-dev force-pushed the feat/nightly-common-validation branch from e9bfb06 to ffb9c5a Compare September 15, 2026 08:18
@janzak-dev
janzak-dev force-pushed the feat/nightly-common-validation branch from ffb9c5a to 5c9a4c1 Compare September 15, 2026 08:26
@janzak-dev
janzak-dev force-pushed the feat/nightly-common-validation branch from 5c9a4c1 to e511742 Compare September 15, 2026 08:41
@janzak-dev
janzak-dev force-pushed the feat/nightly-common-validation branch from e511742 to d2a6ea7 Compare September 15, 2026 09:28
@janzak-dev
janzak-dev force-pushed the feat/nightly-common-validation branch from d2a6ea7 to 65da709 Compare September 15, 2026 09:36
@janzak-dev
janzak-dev force-pushed the feat/nightly-common-validation branch from 25184e0 to aa4d8db Compare September 15, 2026 12:59
@janzak-dev
janzak-dev force-pushed the feat/nightly-common-validation branch from 120d09b to 99f2abf Compare September 15, 2026 14:52
Base automatically changed from feat/trigger-all-examples to main September 15, 2026 15:50
…fy CLI

Extract common CLI flags, gRPC channel context managers, error handlers,
and logging helpers to common.py and update demo_workload_verify.py to use
the shared verification abstractions.

TAG=agy
CONV=2889d5f4-f25d-4694-93f6-70447e012e6b
- Use urllib.parse.urlparse in get_dashboard_url for robust host and port parsing
- Mark xid flag as required if common.flags is present
- Use common.get_flag to safely access FLAGS in demo_workload_verify

TAG=agy
CONV=606f1e41-6785-4137-b85b-cd0f56237339
…s and add common_test.py

TAG=agy
CONV=606f1e41-6785-4137-b85b-cd0f56237339
…oad_verify

- Add repository root sys.path bootstrap to demo_workload_verify.py
- Ensure PYTHONPATH is exported in nightly-test-suite.yml for defense-in-depth

TAG=agy
CONV=606f1e41-6785-4137-b85b-cd0f56237339
…rify

TAG=agy
CONV=606f1e41-6785-4137-b85b-cd0f56237339
…te workflow

TAG=agy
CONV=606f1e41-6785-4137-b85b-cd0f56237339
…kload_verify

TAG=agy
CONV=606f1e41-6785-4137-b85b-cd0f56237339
@janzak-dev
janzak-dev force-pushed the feat/nightly-common-validation branch from 99f2abf to 59b3a47 Compare September 15, 2026 16:01
TAG=agy
CONV=606f1e41-6785-4137-b85b-cd0f56237339
@janzak-dev
janzak-dev marked this pull request as ready for review September 15, 2026 16:13
@github-actions
github-actions Bot requested a review from pachopepe September 15, 2026 16:13
@janzak-dev
janzak-dev added this pull request to the merge queue Sep 16, 2026
Merged via the queue into main with commit c8fba90 Sep 16, 2026
15 checks passed
@janzak-dev
janzak-dev deleted the feat/nightly-common-validation branch September 16, 2026 08:50
@janzak-dev
janzak-dev restored the feat/nightly-common-validation branch September 17, 2026 10:27
@janzak-dev
janzak-dev deleted the feat/nightly-common-validation branch September 17, 2026 10:37

This branch was previously deployed

1 inactive deployment
xmc-nightly — 9a5fc3f3 Deployed Sep 15, 2026 by janzak-dev via 2. Validate Experiment & WorkUnits via SDK #10
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

0