Repository navigation
test(harbor): install the fake registry for every Harbor test from conftest - #5321
Conversation
test_harbor_manifest.py reached the real registry client in 10 tests: it imported fake_registry but not the autouse no_real_registry fixture, so every prepare outside the two classes that opt in resolved ubuntu:24.04 from Docker Hub and failed once the anonymous rate limit (HTTP 429) hit. Import no_real_registry as the sibling Harbor test modules do. In test_harbor_image_build.py, record an arm64 ubuntu base before the run that asks for linux/arm64, instead of letting prepare resolve it again. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Signed-off-by: Kajal Jain <[email protected]>
|
/ok to test 03aaf8c |
|
/review |
…nftest Opting in per module is how test_harbor_manifest.py reached Docker Hub: it imported fake_registry but not no_real_registry. Move FakeRegistryClient to harbor_registry_fakes.py and both fixtures to conftest.py, where no_real_registry is autouse for every test_harbor* module, so a new module cannot forget it. Drop the per-module fixture imports. test_harbor_image_configs.py runs the real RegistryClient against its own fake HTTP registry, so it overrides no_real_registry with a no-op. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Signed-off-by: Kajal Jain <[email protected]>
|
/ok to test 5756b28 |
|
/review |
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
SHIP
LGTM — no concerns found. Reviewed all 14 changed files and affected registry-recording paths, including fixture isolation, the real-client fake-HTTP opt-out, and preservation of the platform-specific build test.
Static inspection only; tests were not executed.
Review generated by codex. This was a full review. Request a full review with /review reset=true.
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
SHIP
LGTM — no concerns found within the follow-up scope. Review 5701877365 approved this exact head without findings, and the trusted baseline is the same immutable tree. There are no subsequent changes or unresolved findings to assess; this is not a fresh whole-PR review.
One delegated report was unavailable; its fixture and fake-client scope was independently inspected. Static inspection only; tests were not executed.
Note: formal approval is not available for this request, so this review is posted as a comment only.
Review generated by codex. This was a findings-only review. Request a full review with /review reset=true.
…registry Requesting monkeypatch in the root autouse fixture set it up first for every unit test, so it was torn down after the other autouse fixtures. The telemetry reset_telemetry_state teardown then ran while a test's patches (sys.modules['nemo.lens'] removed) were still in place, leaving two nemo.lens module objects and failing 8 tests in telemetry/test_setup.py. Fetch it with request.getfixturevalue inside the Harbor branch so other tests keep their fixture order. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Kajal Jain <[email protected]>
41d8797
|
/ok to test 41d8797 |
|
/review reset=true |
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
SHIP
LGTM — no concerns found within the follow-up scope.
Compared against the clean reviewed baseline at 5756b28. Checked the conditional monkeypatch setup, including telemetry teardown isolation, Harbor fake-state consumers, and the real-client opt-out. Also traced the mirrored Docker image change through environment creation and Docker launch, checking preservation of both detached-process cancellation cases.
No prior findings remained unresolved, and no introduced regressions were established. This was not a fresh whole-PR review. Static inspection only; tests and image pulls were not executed.
Review generated by codex. This was a findings-only review. Request a full review with /review reset=true.
main (#5213) fixed the same two Docker Hub failures separately: it pulls the deadline test image from ECR Public pinned by digest, and gives the arm64 image-build test a multi-arch registry stand-in. Both of main's versions are kept, replacing this branch's mirror.gcr.io image and arm64 record edit. The fixtures still move into conftest, so the per-module no_real_registry imports main added are dropped; main's moved config and path_utils imports are kept. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Kajal Jain <[email protected]>
d9f2bde
|
/ok to test d9f2bde |
|
/review reset=true |
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
SHIP
LGTM — no concerns found.
Completed a fresh review of all 13 changed files and affected paths. Checked fixture isolation and conditional monkeypatch setup, migrated fake-state consumers, and the real-client HTTP opt-out. Also traced preservation of non-Harbor telemetry teardown, imported fixtures, and platform-specific image-record reuse.
Static inspection only; tests were not executed.
Review generated by codex. This was a full review. Request a full review with /review reset=true.
|
/review-approve |
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
SHIP
LGTM — no concerns found within the follow-up scope.
The latest bot review, 5715055268, reported no findings at this exact head. The trusted baseline is the same immutable tree, so there are no subsequent changes or unresolved findings to assess. This is not a fresh whole-PR review.
Static inspection only; tests were not executed.
Review generated by codex. This was a findings-only review. Request a full review with /review reset=true.
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/41100653280 |
Summary
no_real_registry(autouse) andfake_registrymove fromtest_harbor_tasks.pytotests/unit_tests/conftest.py, andFakeRegistryClientto a newtests/unit_tests/harbor_registry_fakes.py. The autouse fixture applies to everytest_harbor*module, so a new Harbor test module cannot forget it. It requestsmonkeypatchonly for those modules, so the fixture teardown order of other tests (the telemetry state reset) is unchanged. The per-module fixture imports are removed.test_harbor_image_configs.pyruns the realRegistryClientagainst its own fake HTTP registry, so it overridesno_real_registrywith a no-op.Why
Harbor tests that run
prepare_targetreached Docker Hub through the real registry client and failed with HTTP 429 forlibrary/ubuntu:24.04whenever a module forgot to import the autouseno_real_registry;test_harbor_manifest.pywas one. #5213 fixed those modules by adding the import. This PR removes the need for it: the fixture lives in conftest and covers every Harbor module, so the same slip cannot happen again.RegistryClient._opendoes not retry HTTP errors, so any rate limit fails a test that reaches the registry.No production code changes. No issue filed: this is a test-isolation follow-up to a CI failure on
main.Validation
registry-1.docker.iowithout the fixture.ruff checkandruff format --checkpass on every changed file.Rollout evidence: N/A, test-only change.
🤖 Generated with Claude Code