feat(e2e): Add files external provider tests - #217
Conversation
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughIntroduces E2E test coverage for NGC and Hugging Face storage backends. Enhances the test harness with per-session log isolation and automatic failure-triggered log tail capture. Strengthens NGC backend error handling to catch SDK exceptions during client initialization and storage validation. Wires provider credentials into CI. ChangesExternal Storage Backend E2E Testing
Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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.
Inline comments:
In `@e2e/conftest.py`:
- Around line 73-75: The current logic always appends a UUID to the services log
filename (base -> path) which breaks CI because when E2E_SERVICES_LOG is set the
CI expects the original unsuffixed `${{ runner.temp }}/services.log`; change the
code so that if E2E_SERVICES_LOG is present in the environment you use that
value unchanged for request.session.stash[_services_log_key], and only generate
a UUID-suffixed path when you fall back to the default tempfile path; adjust the
logic around base and path creation to branch on
os.environ.get("E2E_SERVICES_LOG") and store the appropriate value.
In `@e2e/files/test_storage_backends.py`:
- Around line 197-199: The test's expected error message is outdated; update the
assertion for the case with id "nonexistent-resource" to match
validate_storage's current not-found branch (which produces "NGC resource not
found: ..."). Locate the test vector containing {"target":
"this-resource-does-not-exist-12345"} and replace the existing match string
"Failed to access NGC resource this-resource-does-not-exist-12345" with the new
message produced by validate_storage (e.g., "NGC resource not found:
this-resource-does-not-exist-12345") or change the assertion to a stable
substring/regex that looks for "NGC resource not found" plus the target; ensure
the test still references the id "nonexistent-resource".
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 780c483f-e071-496f-9e78-4b943f339426
📒 Files selected for processing (5)
.github/workflows/ci.yamle2e/conftest.pye2e/files/test_files.pye2e/files/test_storage_backends.pyservices/core/files/src/nmp/core/files/app/backends/ngc.py
mikeknep
left a comment
There was a problem hiding this comment.
LGTM, just the one non-blocking question I'm curious about
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
crookedstorm
left a comment
There was a problem hiding this comment.
Seems good for now. This implies PRs will require copy-pr-bot as soon as we accept contributions. I can test implementing that as soon as we need it. (Folks have told me to wait for something).
Summary
Implements AIRCORE-747: E2E tests for NGC-backed filesets with CI token, plus Hugging Face storage backend tests.
E2E test suite (
e2e/files/)e2e/test_files.py→e2e/files/test_files.py(file upload/download tests).e2e/files/test_storage_backends.pywith tests for NGC and Hugging Face external storage backends:TestNGCFileset— creates a secret + NGC-backed fileset pointing at a public resource (nvidia/nemo-microservices/nemo-microservices-quickstart), validates list/download/cache-status. Parametrized error tests verify that invalid key, wrong org, nonexistent resource, and missing secret all return400 BadRequestErrorwith descriptive messages. Skipped whenNGC_API_KEYis not set.TestHuggingFaceFileset— creates an HF-backed fileset (hf-internal-testing/tiny-random-bert), validates list/download/cache-status. UsesHF_TOKENfor authenticated access when available. Error test for nonexistent repo.CI wiring (
.github/workflows/ci.yaml)NGC_API_KEY(fromNGC_REGISTRY_READ_TOKENsecret) andHF_TOKENto thepython-e2e-testjob.Bug fix: NGC backend error handling (
services/core/files/.../ngc.py)_get_client(): Now catchesNgcException(in addition toValueError) duringclient.configure(). Previously, org mismatches raisedNgcExceptionwhich bubbled up as an unhandled 500.validate_storage(): Moved_get_registry_api()and_get_target()inside the try block. Previously these calls were outside error handling, so failures likeAccessDeniedExceptionfrom version resolution were unhandled 500s.E2E infrastructure improvements (
e2e/conftest.py)pytest_runtest_makereporthook that appends the tail of the services log to the test report when a test fails. Previously, server-side errors only showed as opaque "500" from the client.services_log_pathis now a session-scoped fixture with a UUID suffix, so parallel pytest processes never clobber each other's logs.Test plan
pytest e2e/files/test_storage_backends.py --run-e2e)pytest e2e/files/test_files.py --run-e2e)pytest services/core/files/tests/test_ngc_backend.py)python-e2e-testjob passes (NGC tests will skip untilNGC_REGISTRY_READ_TOKENsecret is created)NGC_API_KEYrepository secret (mapped fromNGC_REGISTRY_READ_TOKEN)Signed-off-by: Matthew Grossman mgrossman@nvidia.com
Summary by CodeRabbit
Tests
Bug Fixes
Chores