Repository navigation
OSAC-1330: Add E2E tests for typed resource references - #343
omer-vishlitzky merged 12 commits into
Conversation
|
@danielerez: This pull request references OSAC-1330 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 feature 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. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: osac-project/coderabbit/.coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
WalkthroughThe PR adds VMaaS reference integration tests for name-to-ID resolution, validation, cross-tenant access, provisioning, and cleanup. It also adds shared fixtures, gRPC operations, CLI support, JUnit reporting, and workflow execution. ChangesVMaaS reference tests
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant ReferenceTests
participant GRPCClient
participant ResourceAPI
participant Kubernetes
ReferenceTests->>GRPCClient: Create resources with name references
GRPCClient->>ResourceAPI: Submit API requests
ResourceAPI-->>GRPCClient: Return resolved names and IDs
GRPCClient-->>ReferenceTests: Return resource data
ReferenceTests->>Kubernetes: Wait for readiness or deletion
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 9 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (9 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 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 |
🚨 Credential leak found in e2e run logs/artifactsWorkflow: E2E BMaaS Full Install Tainted raw logs and/or artifacts for that e2e run were deleted to close the exposure window. Inspect the redacted artifact (and the scan job summary) for finding details. Rotate any real credentials. |
🚨 Credential leak found in e2e run logs/artifactsWorkflow: E2E VMaaS Full Install Tainted raw logs and/or artifacts for that e2e run were deleted to close the exposure window. Inspect the redacted artifact (and the scan job summary) for finding details. Rotate any real credentials. |
🚨 Credential leak found in e2e run logs/artifactsWorkflow: E2E CaaS Full Install Tainted raw logs and/or artifacts for that e2e run were deleted to close the exposure window. Inspect the redacted artifact (and the scan job summary) for finding details. Rotate any real credentials. |
🚨 Credential leak found in e2e run logs/artifactsWorkflow: E2E BMaaS Full Install Tainted raw logs and/or artifacts for that e2e run were deleted to close the exposure window. Inspect the redacted artifact (and the scan job summary) for finding details. Rotate any real credentials. |
🚨 Credential leak found in e2e run logs/artifactsWorkflow: E2E CaaS Full Install Tainted raw logs and/or artifacts for that e2e run were deleted to close the exposure window. Inspect the redacted artifact (and the scan job summary) for finding details. Rotate any real credentials. |
🚨 Credential leak found in e2e run logs/artifactsWorkflow: E2E VMaaS Full Install Tainted raw logs and/or artifacts for that e2e run were deleted to close the exposure window. Inspect the redacted artifact (and the scan job summary) for finding details. Rotate any real credentials. |
🚨 Credential leak found in e2e run logs/artifactsWorkflow: E2E BMaaS Full Install Tainted raw logs and/or artifacts for that e2e run were deleted to close the exposure window. Inspect the redacted artifact (and the scan job summary) for finding details. Rotate any real credentials. |
🚨 Credential leak found in e2e run logs/artifactsWorkflow: E2E CaaS Full Install Tainted raw logs and/or artifacts for that e2e run were deleted to close the exposure window. Inspect the redacted artifact (and the scan job summary) for finding details. Rotate any real credentials. |
🚨 Credential leak found in e2e run logs/artifactsWorkflow: E2E VMaaS Full Install Tainted raw logs and/or artifacts for that e2e run were deleted to close the exposure window. Inspect the redacted artifact (and the scan job summary) for finding details. Rotate any real credentials. |
🚨 Credential leak found in e2e run logs/artifactsWorkflow: E2E BMaaS Full Install Tainted raw logs and/or artifacts for that e2e run were deleted to close the exposure window. Inspect the redacted artifact (and the scan job summary) for finding details. Rotate any real credentials. |
🚨 Credential leak found in e2e run logs/artifactsWorkflow: E2E VMaaS Full Install Tainted raw logs and/or artifacts for that e2e run were deleted to close the exposure window. Inspect the redacted artifact (and the scan job summary) for finding details. Rotate any real credentials. |
🚨 Credential leak found in e2e run logs/artifactsWorkflow: E2E CaaS Full Install Tainted raw logs and/or artifacts for that e2e run were deleted to close the exposure window. Inspect the redacted artifact (and the scan job summary) for finding details. Rotate any real credentials. |
9a12d76 to
befb801
Compare
Add shared fixtures, helper methods, and Makefile target for the typed resource reference E2E test suite (OSAC-3095/3100/3105/3110/3114). - tests/references/conftest.py: session-scoped fixtures for network class, virtual network, subnet, and security group with cleanup - tests/core/helpers.py: assert_grpc_field_violation for reference validation error assertions - tests/core/grpc_client.py: methods for NATGateway, RoleBinding, ProjectMembership CRUD and generic filtered list - Makefile: test-references target Assisted-by: Claude Code <noreply@anthropic.com> Signed-off-by: Haim Tayrie <htayrie@htayrie-thinkpadt14gen5.raanaii.csb>
Test VirtualNetwork→NetworkClass, Subnet→VN, and SecurityGroup→VN name-based references, invalid reference field path errors, CEL filter by nested reference path, and cross-tenant NetworkClass access. Assisted-by: Claude Code <noreply@anthropic.com> Signed-off-by: Haim Tayrie <htayrie@htayrie-thinkpadt14gen5.raanaii.csb>
Test full CI provisioning chain with name-based catalog item, subnet, and security group references, CI reaches Running state, invalid SG name returns array-indexed field path, cross-tenant template reference, and instance type deprecation replacement reference resolution. Assisted-by: Claude Code <noreply@anthropic.com> Signed-off-by: Haim Tayrie <htayrie@htayrie-thinkpadt14gen5.raanaii.csb>
Test ExternalIP→Pool by name, NATGateway→VN+ExternalIP by name, invalid attachment target returns field path error, and cross-tenant pool reference access. Assisted-by: Claude Code <noreply@anthropic.com> Signed-off-by: Haim Tayrie <htayrie@htayrie-thinkpadt14gen5.raanaii.csb>
Test ClusterCatalogItem→Template and Cluster→CatalogItem by name, BareMetalInstanceCatalogItem→Template and BMI→CatalogItem by name, cross-tenant cluster template reference, and invalid template name error reporting. Assisted-by: Claude Code <noreply@anthropic.com> Signed-off-by: Haim Tayrie <htayrie@htayrie-thinkpadt14gen5.raanaii.csb>
Test RoleBinding→Role+Users by name with reference resolution, ProjectMembership→Users by name, invalid role name error reporting, and multi-user role binding reference resolution. Fix create_project_membership to match proto spec (role enum + users list). Assisted-by: Claude Code <noreply@anthropic.com> Signed-off-by: Haim Tayrie <htayrie@htayrie-thinkpadt14gen5.raanaii.csb>
Restructure cleanup in test finally blocks to delete via API first (always runs) then best-effort wait for CR deletion, preventing resource leaks when wait helpers timeout. Fix cross-tenant compute test to move CI delete into finally block. Use proper cr_name=None initialization instead of dir() check. Fix Generator return type annotation on yield fixture. Assisted-by: Claude Code <noreply@anthropic.com> Signed-off-by: Haim Tayrie <htayrie@htayrie-thinkpadt14gen5.raanaii.csb>
Run tests/references/ as a follow-up step in both the snapshot and full-install E2E workflows, reusing the same deployed cluster. The step runs when test-suite is 'vmaas' or empty (the default PR/schedule paths) and is skipped on cancellation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Pick up any junit-*.xml files alongside the primary junit.xml so the references test results are included in the uploaded artifact. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove references step from e2e-vmaas (full-install covers it) - Fix result output in full-install to include references outcome - Add instance_type to compute reference tests (now required) - Add version to cluster creation (required by API) - Use SA token for IAM tests (JWT tenant lacks permissions) - Skip IP management tests when no ExternalIPPools deployed - Fix networking tests to use Get after Create for ref validation Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix camelCase response keys (catalogItem, networkAttachments, securityGroups) - Use CLI for Clusters/Create (version field is a message type, not string) - Add user auto-registration fixture and skip-on-not-found for IAM tests - Catch TimeoutError in cleanup blocks across networking and compute tests - Merge references tests into existing "Run E2E tests" step (vmaas suite) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…tion tests Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
89106ab to
8e9dddc
Compare
🚨 Credential leak found in e2e run logs/artifactsWorkflow: E2E BMaaS Full Install Tainted raw logs and/or artifacts for that e2e run were deleted to close the exposure window. Inspect the redacted artifact (and the scan job summary) for finding details. Rotate any real credentials. |
🚨 Credential leak found in e2e run logs/artifactsWorkflow: E2E CaaS Full Install Tainted raw logs and/or artifacts for that e2e run were deleted to close the exposure window. Inspect the redacted artifact (and the scan job summary) for finding details. Rotate any real credentials. |
🚨 Credential leak found in e2e run logs/artifactsWorkflow: E2E VMaaS Full Install Tainted raw logs and/or artifacts for that e2e run were deleted to close the exposure window. Inspect the redacted artifact (and the scan job summary) for finding details. Rotate any real credentials. |
|
/lgtm |
|
/retest |
|
Re-triggered failed runs:
|
OSAC-1330: Add E2E tests for typed resource references
Jira: OSAC-1330 (Deliverable 4)
Stories: OSAC-3095, OSAC-3100, OSAC-3105, OSAC-3110, OSAC-3114
Based on: #330
Summary
Adds a new
tests/references/E2E test suite validating that typed resource references (OSAC-1330) work correctly through the full gRPC API across all 5 resource domains. Tests cover name-based creation (golden path), error validation with field paths, CEL filter compatibility, and cross-tenant/platform-scoped references.Also adds CI coverage: the references tests run alongside the VMaaS suite in a single pytest invocation (appending
tests/references/to the test args whentest-suiteisvmaas), reusing the already-deployed cluster rather than spinning up a separate job.Changes
tests/references/conftest.py— Shared session-scoped fixtures:ref_test_run_id,ref_network_class(discovered via List),ref_virtual_network,ref_subnet,ref_security_groupwith lifecycle cleanuptests/references/test_networking_references.py— 6 tests for OSAC-3095: VN→NetworkClass, Subnet→VN, SG→VN by name; invalid ref error with field path; CEL filter by nested ref; cross-tenant NetworkClasstests/references/test_compute_references.py— 5 tests for OSAC-3100: full CI chain by name, CI reaches Running, invalid SG with array-indexed path, cross-tenant template, instance type deprecation replacementtests/references/test_ip_management_references.py— 4 tests for OSAC-3105: ExternalIP→Pool by name, NATGateway→VN+ExternalIP by name, invalid attachment target error, cross-tenant pooltests/references/test_cluster_baremetal_references.py— 4 tests for OSAC-3110: cluster chain by name, BMI chain by name, cross-tenant template, invalid template error; cluster version is discovered from the environment rather than hardcodedtests/references/test_iam_references.py— 4 tests for OSAC-3114: role binding with role+users by name, project membership by name, invalid role error, multi-user role bindingtests/core/helpers.py— Addedassert_grpc_field_violationhelper for validatingInvalidArgumenterrors withFieldViolationfield pathstests/core/grpc_client.py— Addedlist_with_filter, NATGateway CRUD, RoleBinding CRUD, ProjectMembership CRUD methodstests/core/osac_cli.py— Addedget_cluster_versionto discover cluster version from the environmentMakefile— Addedtest-referencestarget.github/workflows/e2e-vmaas-full-install.yml— References tests appended to the VMaaS pytest invocation whentest-suiteisvmaasscripts/gather-osac-logs.sh— Collect anyjunit-*.xmlfiles alongside the primaryjunit.xmlTesting
E2E VMaaS Full Installvia workflow_dispatch with defaulttest-suite: vmaas— verify the references tests run alongside the main suitejunit.xmlAcceptance Criteria
OSAC-3095 — Networking:
OSAC-3100 — Compute:
OSAC-3105 — IP Management:
OSAC-3110 — Cluster/Bare Metal:
OSAC-3114 — IAM:
Notes
projectfield (field 1 missing from proto) — replaced with multi-user UserReference validation