OSAC-1123: add CaaS cluster storage E2E test - #138
openshift-merge-bot[bot] merged 4 commits into
Conversation
|
@akshaynadkarni: This pull request references OSAC-1123 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the epic to target the "5.0.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
Skipping CI for Draft Pull Request. |
|
@coderabbitai review |
a6e1814 to
cf71d76
Compare
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository: osac-project/coderabbit/.coderabbit.yaml Review profile: ASSERTIVE Plan: Enterprise Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
WalkthroughAdds CaaS cluster storage polling APIs, environment-backed storage test fixtures, collection skips, and an end-to-end lifecycle test covering provisioning, readiness, finalizers, cleanup, and tenant status. ChangesCaaS cluster storage lifecycle
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant CaaSTest
participant OsacCLI
participant KubernetesAPI
participant Tenant
CaaSTest->>KubernetesAPI: create Namespace and Tenant
CaaSTest->>KubernetesAPI: wait for StorageBackendReady
CaaSTest->>OsacCLI: create ClusterOrder
CaaSTest->>KubernetesAPI: annotate ClusterOrder with Tenant reference
KubernetesAPI->>Tenant: update clusterStorage entry
CaaSTest->>KubernetesAPI: verify finalizer and ClusterStorageReady
CaaSTest->>OsacCLI: delete ClusterOrder
CaaSTest->>KubernetesAPI: verify clusterStorage entry removal
🚥 Pre-merge checks | ✅ 10 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (10 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
cf71d76 to
ff45004
Compare
ff45004 to
774c206
Compare
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 `@tests/storage/test_caas_cluster_storage.py`:
- Around line 97-103: Ensure the teardown always deletes the created cluster
when wait_for_cluster_order_cr fails: in the finally block, decouple
cli.delete_cluster(uuid=cluster_uuid) from the co_name is not None check, while
retaining the cluster_uuid guard and exception suppression. Only perform
_verify_teardown for the ClusterOrder when co_name is available.
🪄 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: Repository: osac-project/coderabbit/.coderabbit.yaml
Review profile: ASSERTIVE
Plan: Enterprise
Run ID: dea9cd26-34fa-4056-a5fe-ad139b13fdc2
📒 Files selected for processing (4)
tests/core/helpers.pytests/core/k8s_client.pytests/storage/conftest.pytests/storage/test_caas_cluster_storage.py
Adds an E2E test for the CaaS storage path (Stage 3) of the Storage Controller. The test validates the full lifecycle: Tenant creation, VMaaS storage readiness, ClusterOrder provisioning with tenant annotation, CaaS storage provisioning (finalizer, ClusterStorageReady condition, Tenant clusterStorage status), and teardown cleanup. New k8s_client methods query ClusterOrder conditions, finalizers, and Tenant clusterStorage status. New wait helpers poll for CaaS-specific state transitions. The storage conftest skip logic is fixed (was inverted, skipping tests when the controller IS configured) and extended to skip CaaS tests when OSAC_PULL_SECRET_PATH is not set, since CaaS requires HyperShift cluster provisioning infrastructure. Signed-off-by: akshaynadkarni <25892229+akshaynadkarni@users.noreply.github.com> Assisted-by: Cursor/Claude Signed-off-by: akshaynadkarni <25892229+akshaynadkarni@users.noreply.github.com>
The CaaS E2E test timed out at 30 minutes on the SE-Lab SNO cluster while waiting for the network operator to become available on the hosted cluster. The worker node installed and rebooted successfully, but the network operator needed more time on resource-constrained lab hardware. This increases the wait_for_cluster_ready timeout from 30 minutes (120 retries x 15s) to 60 minutes (240 retries x 15s). All four tests that use this helper share the same cluster provisioning path, so the higher timeout benefits all of them. Signed-off-by: akshaynadkarni <25892229+akshaynadkarni@users.noreply.github.com> Assisted-by: Cursor/Claude Signed-off-by: akshaynadkarni <25892229+akshaynadkarni@users.noreply.github.com>
Delete the cluster by UUID in the finally block regardless of whether the ClusterOrder CR name was resolved. Previously, if wait_for_cluster_order_cr timed out, co_name stayed None and cli.delete_cluster was skipped, leaking the cluster. Signed-off-by: akshaynadkarni <25892229+akshaynadkarni@users.noreply.github.com> Assisted-by: Cursor/Claude Signed-off-by: akshaynadkarni <25892229+akshaynadkarni@users.noreply.github.com>
774c206 to
6e3cf28
Compare
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
@coderabbitai resolve |
✅ Action performedComments resolved and changes approved. |
wgordon17
left a comment
There was a problem hiding this comment.
Otherwise looks good 👍
| def test_caas_cluster_storage_lifecycle( | ||
| k8s_hub_client: K8sClient, | ||
| cli: OsacCLI, | ||
| storage_config_namespace: str, |
| cond_status = k8s.get_cluster_order_condition_status( | ||
| name=name, condition_type=condition_type, checked=False | ||
| ) | ||
| if cond_status != expected_status: | ||
| raise AssertionError( | ||
| f"ClusterOrder {name} entered Failed phase before {condition_type}={expected_status}" | ||
| ) | ||
| return k8s.get_cluster_order_condition_status(name=name, condition_type=condition_type, checked=False) |
There was a problem hiding this comment.
Why run get_cluster_order_condition_status twice, as opposed to running it once before the if phase statement and then returning the cached result
| k8s_hub_client.patch( | ||
| resource="clusterorder", | ||
| name=co_name, | ||
| patch=json.dumps({"metadata": {"annotations": {"osac.openshift.io/tenant": tenant_name}}}), | ||
| ) |
There was a problem hiding this comment.
You should check and ensure the patch succeeded, e.g., https://github.com/osac-project/osac-test-infra/blob/main/tests/vmaas/test_compute_instance_api_fields.py#L54-L57
- Remove unused storage_config_namespace fixture parameter - Assert patch return code when annotating ClusterOrder with tenant - Cache condition status to avoid redundant API call in wait_for_cluster_order_condition Signed-off-by: akshaynadkarni <25892229+akshaynadkarni@users.noreply.github.com> Assisted-by: Cursor/Claude Signed-off-by: akshaynadkarni <25892229+akshaynadkarni@users.noreply.github.com>
|
/retest |
|
Re-triggered failed runs:
|
|
@wgordon17 I have addressed your comments. PTAL. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: akshaynadkarni, zszabo-rh The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
13bf91e
into
osac-project:main
Summary
OSAC-1123: Adds an E2E test for the CaaS cluster storage provisioning lifecycle
and increases the shared
wait_for_cluster_readytimeout from 30 to 60 minutes.Why
The VMaaS storage E2E test (#107) covers Stages 1-2 (storage backend and
StorageClass provisioning on the hub). This adds coverage for Stage 3: provisioning
storage on a CaaS cluster via ClusterOrder. The test validates the full lifecycle:
tenant creation, VMaaS storage readiness, ClusterOrder provisioning with tenant
annotation, CaaS storage assertions (finalizer, ClusterStorageReady condition,
Tenant.status.clusterStorage entry), and teardown cleanup.
The timeout increase addresses cluster provisioning on resource-constrained lab
hardware where the network operator can take 30+ minutes to become available after
the worker node joins. All four tests that use
wait_for_cluster_readyshare thesame provisioning path and benefit from the higher ceiling.
Also fixes an inverted skip-logic bug in the storage conftest that was skipping
storage tests when the controller IS configured.
Testing
test_tenant_storage_lifecycle): passed on edge22 in 168.91sstorage AAP jobs all succeeded; cluster reached Ready in ~15 minutes after
MetalLB network fix; CaaS storage assertions blocked by
osac-aap#377
Related PRs
Ticket
OSAC-1123
Signed-off-by: akshaynadkarni 25892229+akshaynadkarni@users.noreply.github.com
Assisted-by: Cursor/Claude
Summary by CodeRabbit
New Features
Bug Fixes
Tests