Repository navigation
test(deploy): port operator DGDR e2e coverage to pytest - #11946
Conversation
|
/ok to test e395cda |
|
🎯 Code Coverage (details) 🔗 Commit SHA: a4d2332 | Docs | Datadog PR Page | Give us feedback! |
|
/ok to test b449eca |
WalkthroughAdds reusable DGDR deployment workflows, planner image copying, a Python live-cluster test harness with CPU and H100 coverage, removal of legacy DGDR Go tests, and restricted profiling-job RBAC permissions. ChangesCI DGDR deployment flow
Live-cluster DGDR test migration
Profiling job RBAC
Estimated code review effort: 5 (Critical) | ~120 minutes 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
tests/deploy/dgdr_utils.py (1)
152-161: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueUse explicit
raiseinstead ofassertfor external-data validation.
dgdr_utils.pyis a helper module (not a test module or registered plugin), so pytest does not rewrite these asserts, and underpython -Otheassertstatements are stripped —parse_final_dgdwould then skip both checks and return a possibly non-DGD document silently. The same pattern recurs inget_output_dgd(Lines 360-362) andrun_lifecycle(Lines 610, 629); prefer explicitif/raisethere too.As per path instructions (.ai/python-guidelines.md): "never use assert for runtime validation—use explicit if/raise."
♻️ Proposed fix for `parse_final_dgd`
def parse_final_dgd(content: str) -> dict[str, Any]: """Return the last YAML document and assert that it is a DGD.""" documents = [document for document in yaml.safe_load_all(content) if document] - assert documents, "final_config.yaml must contain at least one YAML document" + if not documents: + raise AssertionError("final_config.yaml must contain at least one YAML document") result = documents[-1] - assert ( - result.get("kind") == "DynamoGraphDeployment" - ), "last final_config.yaml document must be a DynamoGraphDeployment" + if result.get("kind") != "DynamoGraphDeployment": + raise AssertionError( + "last final_config.yaml document must be a DynamoGraphDeployment" + ) return result🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/deploy/dgdr_utils.py` around lines 152 - 161, Replace the runtime assert checks in parse_final_dgd with explicit if/raise validation so they remain active under optimization: reject empty YAML documents and any final document whose kind is not DynamoGraphDeployment. Apply the same assert-to-if/raise conversion to the validation checks in get_output_dgd and run_lifecycle, preserving their existing conditions and error behavior.Source: Path instructions
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@tests/deploy/dgdr_utils.py`:
- Around line 152-161: Replace the runtime assert checks in parse_final_dgd with
explicit if/raise validation so they remain active under optimization: reject
empty YAML documents and any final document whose kind is not
DynamoGraphDeployment. Apply the same assert-to-if/raise conversion to the
validation checks in get_output_dgd and run_lifecycle, preserving their existing
conditions and error behavior.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 1b6a9d75-bd58-4954-a915-52bee58fe1c3
📒 Files selected for processing (25)
.github/actions/dynamo-deploy-test/action.yml.github/workflows/post-merge-ci.yml.github/workflows/pr.yaml.github/workflows/shared-copy.yml.github/workflows/shared-dgdr-deploy-test.ymldeploy/helm/charts/platform/components/operator/templates/profiling-job-rbac.yamldeploy/helm/charts/platform/tests/profiling_job_rbac_test.yamldeploy/operator/Makefiledeploy/operator/test/e2e/dgdr/README.mddeploy/operator/test/e2e/dgdr/dgdr_h100_e2e_test.godeploy/operator/test/e2e/dgdr/dgdr_lifecycle_spec_test.godeploy/operator/test/e2e/dgdr/dgdr_test.godeploy/operator/test/e2e/dgdr/helpers_test.godeploy/operator/test/e2e/dgdr/lifecycle_test.godeploy/operator/test/e2e/dgdr/profiling_test.godeploy/operator/test/e2e/dgdr/suite_test.godeploy/operator/test/e2e/dgdr/validation_test.godeploy/operator/test/e2e/doc.gotests/deploy/README.mdtests/deploy/conftest.pytests/deploy/dgdr_utils.pytests/deploy/test_dgd.pytests/deploy/test_dgdr.pytests/deploy/test_dgdr_h100.pytests/utils/managed_deployment.py
💤 Files with no reviewable changes (11)
- deploy/operator/test/e2e/dgdr/dgdr_h100_e2e_test.go
- deploy/operator/test/e2e/dgdr/README.md
- deploy/operator/test/e2e/dgdr/lifecycle_test.go
- deploy/operator/test/e2e/dgdr/dgdr_lifecycle_spec_test.go
- deploy/operator/test/e2e/dgdr/suite_test.go
- deploy/operator/test/e2e/dgdr/dgdr_test.go
- deploy/operator/test/e2e/dgdr/validation_test.go
- deploy/helm/charts/platform/components/operator/templates/profiling-job-rbac.yaml
- deploy/operator/test/e2e/dgdr/helpers_test.go
- tests/utils/managed_deployment.py
- deploy/operator/test/e2e/dgdr/profiling_test.go
|
/ok to test c17fd98 |
|
/ok to test 7cfd3bf |
|
/ok to test a39a2ba |
a39a2ba to
2b81c01
Compare
|
/ok to test 7dc93c5 |
1 similar comment
|
/ok to test 7dc93c5 |
Signed-off-by: Dr. Stefan Schimanski <[email protected]>
Signed-off-by: Dr. Stefan Schimanski <[email protected]>
Signed-off-by: Dr. Stefan Schimanski <[email protected]>
Signed-off-by: Dr. Stefan Schimanski <[email protected]>
Signed-off-by: Dr. Stefan Schimanski <[email protected]>
Signed-off-by: Dr. Stefan Schimanski <[email protected]>
Signed-off-by: Dr. Stefan Schimanski <[email protected]>
Signed-off-by: Dr. Stefan Schimanski <[email protected]>
Signed-off-by: Dr. Stefan Schimanski <[email protected]>
Signed-off-by: Dr. Stefan Schimanski <[email protected]>
Signed-off-by: Dr. Stefan Schimanski <[email protected]>
Signed-off-by: Dr. Stefan Schimanski <[email protected]>
Signed-off-by: Dr. Stefan Schimanski <[email protected]>
Signed-off-by: Dr. Stefan Schimanski <[email protected]>
Signed-off-by: Dr. Stefan Schimanski <[email protected]>
Signed-off-by: Dr. Stefan Schimanski <[email protected]>
Signed-off-by: Dr. Stefan Schimanski <[email protected]>
Signed-off-by: Dr. Stefan Schimanski <[email protected]>
Signed-off-by: Dr. Stefan Schimanski <[email protected]>
Signed-off-by: Dr. Stefan Schimanski <[email protected]>
7dc93c5 to
a4d2332
Compare
|
/ok to test a4d2332 |
1 similar comment
|
/ok to test a4d2332 |
#11946 moved tests/utils/managed_deployment.py to tests/deploy/dgd_utils.py, so the import here stopped resolving once main was merged in. This is what the pytest-marker-report hook was failing on: CI builds the PR merged with main, so it saw the rename while a branch based on the older main did not. Import DeploymentSpec/ManagedDeployment from their new home. Signed-off-by: Jie Hao <[email protected]>
Summary
Depends on #11949.
tests/deploy.gpu_0cases run against mocked hardware in isolated, always-cleaned namespaces.gpu_1and ten H100gpu_8cases will follow after a GPU-capacity discussion.The CPU job is independent of the vLLM, SGLang, and TensorRT-LLM deploy-test jobs.
Validation