Repository navigation
refactor(nightly): extract shared workload verification helpers for simple and clickhouse tests - #1064
Conversation
…imple and clickhouse tests
There was a problem hiding this comment.
Code Review
This pull request refactors the nightly test verification scripts by consolidating common validation logic into a unified verify_standard_workload function and extracting helper assertion functions to common.py, supported by new unit tests. Feedback on the changes highlights two key areas: first, in verify_standard_workload, the default fallback for workers should include all job names from expected_jobs rather than just the first one to prevent ignoring other jobs in multi-job workloads; second, the updated dashboard validation now strictly verifies all associated charts, which may lead to unexpected failures if any optional charts are empty.
…d_chart_data and add unit tests
|
PR description reconciliation The description lists
Could you update the description to match the actual diff (and call out those behavior changes if they're intentional)? |
- Add public validate_work_unit_jobsets in xmc_entities_validator and delegate common.assert_work_unit_jobsets to it. - Pin WorkUnit count in verify_standard_workload to len(workers) so NUM_WORK_UNITS in the environment does not inflate single-unit checks. - Drop unused strict_required parameter and XMANAGER_UI_URL strictness inference from assert_dashboard_chart_data. - Unpack tuple-packed assignments, restore timeout duration in dashboard hydration error message, and restore WorkUnits/Workers/Timeout/Title fields in banner and summary output. - Document follow-up responsibility split TODO in common.py docstring and expand stub-boundary and strictness unit tests.
… verify_standard_workload
VLukiantsev
left a comment
There was a problem hiding this comment.
LGTM. All review threads addressed and verified at 8af88d69; CI green. Reminder: please track the common.py split TODO in a follow-up issue once the stack lands.
Split tools/nightly_tests/common.py and common_test.py into five domain-focused modules with 1-to-1 unit test files and remove common.py: - verifier_cli.py: CLI flags, parsing helpers, and run_main entrypoint - endpoint_resolution.py: ESS, Dashboard, ClickHouse, and UI URL resolvers - ess_session.py: ESS gRPC channel context manager and error decorator - verification_report.py: console banner and success summary formatters - workload_verification.py: standard and dashboard workload orchestrators Update all nightly verifier binaries, BUILD.bazel targets, and workflow comments to import the new domain modules directly. Follow-up to #1064
Summary
Refactors the two preexisting nightly E2E verifier scripts (
tools/nightly_tests/simple_job_verify.pyandtools/nightly_tests/clickhouse_metrics_job_verify.py) and extracts only the shared workload verification primitives they use intotools/nightly_tests/common.pyandtools/nightly_tests/xmc_entities_validator.py.Stack Context (GitHub Stack #1065)
verify_standard_workload,assert_experiment,assert_work_units,assert_work_unit_jobsets,assert_clickhouse_metrics,assert_dashboard_chart_data,_print_workload_banner,_print_workload_summary) andxmc_entities_validator.validate_work_unit_jobsets, and refactors the two preexisting verifiers (simple_job_verify.pyandclickhouse_metrics_job_verify.py).validate_artifacts/assert_work_unit_artifacts), adds verifiers and matrix entries for the 6 newly unblocked examples (init_container_job,sidecar,multipod_job,metrics_job,chart_artifact_job,metrics_dashboard_job), and fixesmetrics_dashboard_jobandxdashauth forwarding.managed_xprof_artifact_job,per_job_node_selector,pathways_job,xdash_dashboard).Motivation & Context
Previously,
simple_job_verify.py(131 lines) andclickhouse_metrics_job_verify.py(167 lines) duplicated experiment validation, work unit validation, jobset container topology validation, ClickHouse endpoint resolution, and dashboard hydration assertions. Extracting these shared step runners intocommon.pyand enhancingxmc_entities_validator.pyreduces both scripts to declarative ~60-line specifications and provides a clean foundation for subsequent verifiers.Key Changes
tools/nightly_tests/common.py&tools/nightly_tests/common_test.py:assert_experiment,assert_work_units,assert_work_unit_jobsets,assert_clickhouse_metrics,assert_dashboard_chart_data,_print_workload_banner,_print_workload_summary, andverify_standard_workload(plus a module-levelTODO(xmc)tracking the follow-up split ofcommon.pyinto focused helper modules once this stack lands).simple_job_verify.pyandclickhouse_metrics_job_verify.py(artifact helpers are deferred to Layer 2 where artifact verifiers are introduced).tools/nightly_tests/xmc_entities_validator.py&tools/nightly_tests/xmc_entities_validator_test.py:validate_work_unit_jobsetsto encapsulate WorkUnit JobSet container topology inspection inside the validator module without cross-module calls to private_fetch_raw_work_unitsor_validate_jobset_containers._log_and_check_clickhouse_metricsand_verify_single_chart_dataso_verify_dashboard_and_chart_data_onceverifies all charts on a dashboard whenexpected_chart_idis omitted while keeping all functionstools/nightly_tests/simple_job_verify.py&tools/nightly_tests/clickhouse_metrics_job_verify.py:common.verify_standard_workload,common.assert_clickhouse_metrics, andcommon.assert_dashboard_chart_data.Verification & Testing
5e8f128c) passed 100% green across all jobs:Build Example Container Images: ✅success(19s)Run & Verify: Simple Job (3 Multi-Unit Batch)(simple_job_verify.py): ✅success(2m20s)Run & Verify: ClickHouse Metrics Job(clickhouse_metrics_job_verify.py): ✅success(1m18s)Aggregate Examples Results: ✅success(7s)bazel test //tools/nightly_tests/...(all 4 test targets pass, including stub-boundary tests forverify_standard_workloadandsubTestbranch coverage forassert_dashboard_chart_data)../.githooks/pre-commitpassed cleanly.TAG=agy
CONV=acf882de-1561-404c-ba2e-ae0940451165