Integration Tests Configuration#
Goal: Configure the integration tests to validate discovery, storage, permissions, and notifications (event aggregation, event consumer) services.
Brief description
Integration tests verify interactions among the following services after deployment:
Storage service and Permission service
Storage service and Notification service
Notification service (event aggregation service and event consumer service)
If a service required for one of these interactions is not deployed according to the discovery service configuration, tests for that interaction are skipped.
The run starts with a preflight phase: required Helm values are validated (discovery service endpoint and storage API resource base), and service endpoints returned by the discovery service must be reachable.
After preflight succeeds, the suite exercises gRPC and REST APIs of services. Assertions cover status codes and the structure and values of fields in responses.
Expected output#
Tests run in a pod. On success the pod exits with status Completed; on failure it may exit with Error. Inspect the logs for test summaries, preflight errors, and failed tests. Error logs contain hints to help identify and fix issues.
kubectl logs <pod-name> -n <namespace>
Replace <pod-name> and <namespace> with your integration-tests pod and namespace.
Note
Deploy only the services listed above you want to run tests against; you do not need to deploy all of the services.
Pulling the Integration Tests Helm Chart#
Pull and unpack the Integration Tests Helm chart from the NGC catalog. Replace {NGC_API_KEY} with your NGC API key.
# pull the chart from NGC
helm fetch https://helm.ngc.nvidia.com/nvidia/omniverse/charts/storage-api-integration-tests-1.0.3.tgz --username='$oauthtoken' --password=${NGC_API_KEY}
# unpack the chart and cd into the directory
tar -xvf storage-api-integration-tests-1.0.3.tgz
cd storage-api-integration-tests
Configure the Integration Tests#
Use integration-tests-values.yaml as the values file (same as previous examples).
# create and edit the local values file, we're using VS Code for this example
code integration-tests-values.yaml
Minimal required values to run the integration tests:
Set the image and storage API resource base (Bucket URL for S3 or Azure Blob container) you want to test against.
image:
repository: "nvcr.io/nvidia/omniverse/integration-tests"
pullSecrets:
- name: ngcpull-secret
job:
storageApiResourceBase: "https://storage.example.com/bucket"
discoveryServiceEndpoint: "http://discovery-service:8080"
Additional Values reference#
Brief description of the optional values you can set:
Service endpoints (choose one)
Option 1: Discovery (default): Set
discoveryServiceEndpoint(e.g.http://discovery-service:8080). Endpoints are fetched from Discovery; you do not need to set manual endpoints.Option 2: Manual: Leave
discoveryServiceEndpointempty or omit it, and setmanualEndpointsfor each service you test:grpcStorage/httpStorage— Storage service.grpcPermission/httpPermission— Permission service.grpcNotificationConsumer/httpNotificationConsumer— Notification consumer.grpcNotificationAggregation/httpNotificationAggregation— Notification aggregation.
Note
Leave a service’s fields empty or do not specify them if you are not running tests for that service.
Pytest
pytestMarkers— Pytest marker expression to filter tests:rest: REST API testsgrpc: gRPC API testsstorage: Storage service testsnotification: Notification service testsstorage_and_notification: Storage and Notification service testsLeave empty or do not specify it to run all tests.
pytestTechnicalOutput— Set totruefor raw pytest output (debugging);falseor empty for human-readable output.
Authentication
# If enabled, the test job obtains an access token via OAuth2 client credentials. Default is false.
serviceIdentity:
clientCredentials:
# Use client credentials flow to obtain the access token for API calls.
enabled: true
# OIDC discovery document URL.
# Example: https://login.microsoftonline.com/<tenant>/v2.0/.well-known/openid-configuration
openIdConfigurationUri: "https://login.microsoftonline.com/<tenant>/v2.0/.well-known/openid-configuration"
# Scope passed to the token endpoint.
clientScope: "SCOPE"
# OAuth client_id (the client secret is injected from clientSecretRef only).
clientId: "CLIENT-ID"
# Existing Secret holding the client secret value (single key).
clientSecretRef:
name: "integration-tests-oauth-client-secret"
key: "oauth-client-secret"
Create the Secret before installing the chart so clientSecretRef resolves. Replace {CLIENT_SECRET_VALUE} with your OAuth2 client secret. If you use a different namespace than storage-apis, pass that namespace here.
kubectl create secret generic integration-tests-oauth-client-secret \
--from-literal=oauth-client-secret={CLIENT_SECRET_VALUE} \
--namespace storage-apis
# validate the secret was created
kubectl get secret integration-tests-oauth-client-secret -n storage-apis
serviceIdentity.clientCredentials.enabled— Set totruefor authentication using client credentials.
Note
This is only needed if you are using authentication.
skipConnectivityChecks (optional)
skipConnectivityChecks— Set totrueif you do not want the job to stop as soon as the connectivity check step fails, or if your gRPC service does not support health checks. The job keeps going and runs the test suite; individual tests may still be skipped or fail if the deployment is not ready.
Install the Integration Tests.
# validate the chart
helm template . -f integration-tests-values.yaml
# dry-run the install
helm upgrade --install storage-api-integration-tests . -f integration-tests-values.yaml --namespace storage-apis --dry-run --debug
If everything looks good, you can install the Integration Tests.
# install the integration tests
helm upgrade --install storage-api-integration-tests . -f integration-tests-values.yaml --namespace storage-apis
# validate the pod is running, this may take a few minutes to start up
kubectl get pods -n storage-apis
Clean up#
To clean up: uninstall the Helm release and delete the namespace.
# uninstall the integration tests
helm uninstall storage-api-integration-tests -n storage-apis
# delete the namespace
kubectl delete namespace storage-apis
# validate the namespace was deleted
kubectl get namespace storage-apis