Skip to content

OSAC-3161: add GPU InstanceType lifecycle E2E tests - #316

Merged
openshift-merge-bot[bot] merged 3 commits into
osac-project:mainfrom
Tzif-Morgen:feat/OSAC-3161-gpu-instancetype-e2e
Aug 6, 2026
Merged

openshift-merge-bot[bot] merged 3 commits into
osac-project:mainfrom
Tzif-Morgen:feat/OSAC-3161-gpu-instancetype-e2e

Conversation

@Tzif-Morgen

@Tzif-Morgen Tzif-Morgen commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Extend GRPCClient.create_instance_type() with optional gpu parameter for creating GPU-enabled InstanceTypes
  • Add test_gpu_instance_type covering create+verify, list distinguishability, immutability rejection
  • AC-5 (deletion protection) verified manually on cluster - same GPU-agnostic referential integrity mechanism already automated in test_compute_instance_deletion_protection

Test plan

  • test_gpu_instance_type passes against cluster with OSAC-3159 deployed
  • test_instance_type_lifecycle (existing) still passes - no regressions
  • AC-5 manually verified via CLI: osac delete instancetype returns FailedPrecondition: in use
Screenshot 2026-08-05 at 11 32 02

Assisted-by: Claude Code noreply@anthropic.com

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Added support for specifying GPU resources when creating instance types.
    • GPU details are now included in instance type information and listings.
  • Bug Fixes

    • Improved validation of GPU instance type behavior, including field immutability during updates.
    • Enhanced lifecycle handling for GPU instance types, including reliable cleanup and preservation of expected not-found responses.

Assisted-by: Claude Code <noreply@anthropic.com>
Signed-off-by: Tzif <tmorgens@redhat.com>
@openshift-ci-robot

openshift-ci-robot commented Aug 5, 2026 •

Copy link
Copy Markdown

@Tzif-Morgen: This pull request references OSAC-3161 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 task to target the "5.0.0" version, but no target version was set.

Details

In response to this:

Summary

  • Extend GRPCClient.create_instance_type() with optional gpu parameter for creating GPU-enabled InstanceTypes
  • Add test_gpu_instance_type_lifecycle covering create+verify, list distinguishability, immutability rejection, and delete+verify
  • AC-5 (deletion protection) verified manually on cluster — same GPU-agnostic referential integrity mechanism already automated in test_compute_instance_deletion_protection

Test plan

  • test_gpu_instance_type_lifecycle passes against cluster with OSAC-3159 deployed
  • test_instance_type_lifecycle (existing) still passes — no regressions
  • make lint passes on changed files
  • AC-5 manually verified via CLI: osac delete instancetype returns FailedPrecondition: in use

Assisted-by: Claude Code noreply@anthropic.com

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.

@coderabbitai

coderabbitai Bot commented Aug 5, 2026 •

Copy link
Copy Markdown

Review Change Stack

Walkthrough

The test client now supports optional GPU specifications. A new lifecycle test validates GPU InstanceType creation, listing, update immutability, persistence, deletion, and cleanup.

Changes

GPU InstanceType support

Layer / File(s) Summary
GPU request construction
tests/core/grpc_client.py
GRPCClient.create_instance_type accepts an optional gpu argument and adds it to the request specification when provided.
GPU lifecycle validation
tests/vmaas/test_instance_type_lifecycle.py
Adds GPU configuration and validates GPU fields, GPU and non-GPU listings, rejected GPU updates, persistence, and cleanup behavior.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant LifecycleTest
  participant GRPCClient
  participant PrivateAPI
  LifecycleTest->>GRPCClient: Create InstanceType with GPU configuration
  GRPCClient->>PrivateAPI: Submit InstanceType specification
  PrivateAPI-->>LifecycleTest: Return GPU fields
  LifecycleTest->>PrivateAPI: List and update InstanceTypes
  PrivateAPI-->>LifecycleTest: Return listing and update results
  LifecycleTest->>PrivateAPI: Delete InstanceTypes
  PrivateAPI-->>LifecycleTest: Return deletion results
Loading

Possibly related PRs

Suggested labels: lgtm

Suggested reviewers: rgolangh, eliorerz

🚥 Pre-merge checks | ✅ 11
✅ Passed checks (11 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
No-Hardcoded-Secrets ✅ Passed The PR adds only GPU test values and request fields; scans of all added lines found no API keys, tokens, passwords, private keys, credential URLs, or long encoded blobs.
No-Weak-Crypto ✅ Passed The PR adds GPU payload and lifecycle assertions only; the added lines contain no MD5, SHA1, DES, RC4, Blowfish, ECB, custom crypto, or secret comparisons.
No-Injection-Vectors ✅ Passed The PR adds JSON payload construction and list-based subprocess calls; runner.py uses subprocess.run without shell=True, and no prohibited eval, exec, pickle, yaml.load, os.system, SQL, or HTML sin...
Container-Privileges ✅ Passed The PR changes only two Python files; the added lines contain no privileged, hostPID, hostNetwork, hostIPC, SYS_ADMIN, or allowPrivilegeEscalation settings.
No-Sensitive-Data-In-Logs ✅ Passed The changed files add no print or logger calls; they handle only synthetic GPU values and expected API error text, while token transport code is unchanged.
Ai-Attribution ✅ Passed All three PR commits include an Assisted-by: Claude Code trailer and a Red Hat Signed-off-by; none includes a Co-Authored-By trailer.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the addition of GPU InstanceType lifecycle E2E tests, which is the primary change.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Assisted-by: Claude Code <noreply@anthropic.com>
Signed-off-by: Tzif <tmorgens@redhat.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/vmaas/test_instance_type_lifecycle.py`:
- Around line 165-168: Extend the post-rejected-update assertions in the
instance type lifecycle test to verify every GPU field changed by the request,
including pciDeviceSelector, resourceName, and count. Compare each returned
value with the corresponding TEST_GPU expected value while preserving the
existing unchanged-after-rejection validation.
🪄 Autofix

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: CHILL

Plan: Pro Plus

Run ID: e0a7add4-dd6e-4b01-bc6f-7b3ee862caad

📥 Commits

Reviewing files that changed from the base of the PR and between 7eaf28c and 44e9614.

📒 Files selected for processing (2)
  • tests/core/grpc_client.py
  • tests/vmaas/test_instance_type_lifecycle.py

Comment thread tests/vmaas/test_instance_type_lifecycle.py
Assisted-by: Claude Code <noreply@anthropic.com>
Signed-off-by: Tzif <tmorgens@redhat.com>
@omer-vishlitzky

Copy link
Copy Markdown
Contributor

Looks kesem
/lgtm
/approved

@omer-vishlitzky

Copy link
Copy Markdown
Contributor

/approve

@openshift-ci

openshift-ci Bot commented Aug 6, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: omer-vishlitzky, Tzif-Morgen

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot added the approved label Aug 6, 2026
@openshift-merge-bot
openshift-merge-bot Bot merged commit aa55129 into osac-project:main Aug 6, 2026
11 of 13 checks passed

This branch was previously deployed

1 inactive deployment
e2e-test — e4222b1b Deployed Aug 5, 2026 by Tzif-Morgen via e2e-caas-full-install / e2e #276
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants