Skip to content

HYPERFLEET-404 - test: Add adapter failure testcase#12

Merged
openshift-merge-bot[bot] merged 1 commit intoopenshift-hyperfleet:mainfrom
yingzhanredhat:ying-e2e
Jan 27, 2026
Merged

HYPERFLEET-404 - test: Add adapter failure testcase#12
openshift-merge-bot[bot] merged 1 commit intoopenshift-hyperfleet:mainfrom
yingzhanredhat:ying-e2e

Conversation

@yingzhanredhat
Copy link
Contributor

@yingzhanredhat yingzhanredhat commented Jan 20, 2026

Summary by CodeRabbit

  • Tests

    • Added comprehensive test case for cluster adapter status management, including error handling and verification of adapter and cluster statuses during provisioning.
  • Documentation

    • Updated cluster creation test documentation with streamlined payload references.
    • Added configuration for GCP validation adapter testing with broker and hyperfleet API settings.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 20, 2026

Walkthrough

This pull request updates test documentation and configuration files for cluster validation testing. The changes include: (1) modifying the cluster creation test case to reference a new payload file location in testdata rather than testcases/templates, (2) adding a new YAML configuration file defining GCP validation adapter settings with Google Pub/Sub broker and validation namespace specifications, and (3) introducing a new test case documentation file that describes the cluster adapter status management scenario with preconditions, test steps, and expected status condition results.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested labels

lgtm

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: adding a test case for adapter failure scenarios, which aligns with the three modified files that implement this test case.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@testcases/cluster_lifecycle.md`:
- Line 680: The comment text "Validation gcp pod is restart" contains
grammatical errors; update that line in testcases/cluster_lifecycle.md to a
corrected phrase such as "Validate GCP pod is restarted" or "Validation: GCP pod
is restarted" (capitalize GCP and use the past participle "restarted") so the
sentence reads clearly.
🧹 Nitpick comments (2)
testcases/cluster_lifecycle.md (2)

621-621: Consider rephrasing the test title for clarity.

"The adapter's status should work well when its work meets error" is grammatically awkward. A clearer alternative:

-## Test Title: The adapter's status should work well when its work meets error 
+## Test Title: Adapter status should correctly reflect errors during provisioning

673-676: Markdown list indentation flagged by linter.

The static analysis tool flagged indentation issues on these lines. The current indentation (2 spaces) appears intentional for visual grouping under the helm command context, but standard markdown expects 0-space indentation for top-level list items.

If you want to satisfy the linter, remove the leading spaces:

   Parameters:
-  - `RELEASE_NAME`: The deployed HyperFleet release name
-  - `NAMESPACE_NAME`: The deployed GKE namespace name
-  - `values.yaml`: Default values file from [hyperfleet-chart/examples/gcp-pubsub/values.yaml](https://github.com/openshift-hyperfleet/hyperfleet-chart/blob/main/examples/gcp-pubsub/values.yaml)
+- `RELEASE_NAME`: The deployed HyperFleet release name
+- `NAMESPACE_NAME`: The deployed GKE namespace name
+- `values.yaml`: Default values file from [hyperfleet-chart/examples/gcp-pubsub/values.yaml](https://github.com/openshift-hyperfleet/hyperfleet-chart/blob/main/examples/gcp-pubsub/values.yaml)

Alternatively, if the current style is preferred for readability, you may configure markdownlint to allow this pattern.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Fix all issues with AI agents
In `@test-design/testcases/cluster/adapter-statues.md`:
- Around line 1-4: Rename the test file from "adapter-statues.md" to
"adapter-statuses.md" and update any internal references/imports/usages that
point to test-design/testcases/cluster/adapter-statues.md (search for
"adapter-statues" across the repo); ensure the new filename
"adapter-statuses.md" is used in test manifests, README links, and CI/test
runners so references remain consistent.
- Around line 39-44: Update the documentation to use the correct template path:
replace any references to templates/gcp_validation_adapter_values.yaml and
testcases/templates/gcp_validation_adapter_values.yaml with
testdata/payloads/clusters/gcp_validation_adapter_values.yaml and update the
example envsubst command accordingly so it reads envsubst <
testdata/payloads/clusters/gcp_validation_adapter_values.yaml >
values_changed.yaml; ensure both occurrences of the template name in the
markdown (the template reference and the envsubst command) are changed.
- Around line 132-137: Add the missing JSON payload file named
create_cluster_gcp.json under test-design/templates/ containing the GCP cluster
creation payload that matches the API schema used by the tests (fields like
clusterName, region, nodePools, machineType, credentials, etc.); also update the
curl example in adapter-statues.md to reference
templates/create_cluster_gcp.json (replace the incorrect testcases/templates
path) so the command points to test-design/templates/create_cluster_gcp.json and
the test can load the payload correctly.
🧹 Nitpick comments (1)
test-design/testcases/cluster/adapter-statues.md (1)

169-243: JSON example has inconsistent indentation.

The closing braces for the items array and root object at lines 237-242 have inconsistent indentation compared to the opening structure.

Proposed fix for JSON formatting
-  }
-  ],
-    "kind": "AdapterStatusList",
-    "page": 1,
-    "size": 2,
-    "total": 2
-  }
+    }
+  ],
+  "kind": "AdapterStatusList",
+  "page": 1,
+  "size": 2,
+  "total": 2
+}

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
test-design/testcases/cluster/create-cluster.md (1)

36-45: Align the curl payload path with the referenced template path.

The command uses testcases/templates/create_cluster_gcp.json, but the text and link reference templates/create_cluster_gcp.json. This inconsistency will break copy/paste usage.

🛠️ Proposed fix
-curl -X POST ${API_URL}/api/hyperfleet/v1/clusters \
-  -H "Content-Type: application/json" \
-  -d `@testcases/templates/create_cluster_gcp.json`
+curl -X POST ${API_URL}/api/hyperfleet/v1/clusters \
+  -H "Content-Type: application/json" \
+  -d `@templates/create_cluster_gcp.json`
🤖 Fix all issues with AI agents
In `@test-design/testcases/cluster/adapter-statues.md`:
- Around line 56-59: The unordered list under the "Parameters:" heading is
indented by two spaces and violates MD007; update the indentation so each list
item is aligned directly under the heading (no extra leading spaces) for the
items `RELEASE_NAME`, `NAMESPACE_NAME`, and `values.yaml`, ensuring the bullets
start at column 0 (or match the heading's expected indentation) to satisfy
markdownlint.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
test-design/testcases/cluster/create-cluster.md (1)

37-45: Fix file path inconsistency in cluster creation command.

The curl command at line 42 references gcp_validation_adapter_values.yaml (adapter configuration), but line 45 and the test context indicate this should be using gcp.json (cluster creation payload). This inconsistency would cause the test to fail or send incorrect data.

🔧 Proposed fix
 **Action:**
-Send POST request to create a new GCP cluster using the payload from [templates/create_cluster_gcp.json](templates/create_cluster_gcp.json):
+Send POST request to create a new GCP cluster:
 
 ```bash
 curl -X POST ${API_URL}/api/hyperfleet/v1/clusters \
   -H "Content-Type: application/json" \
-  -d `@testdata/payloads/clusters/gcp_validation_adapter_values.yaml`
+  -d `@testdata/payloads/clusters/gcp.json`

Payload example: See gcp.json: for the complete cluster creation payload.


</details>

</blockquote></details>

</blockquote></details>

@xueli181114
Copy link
Contributor

/lgtm

@openshift-ci
Copy link

openshift-ci bot commented Jan 27, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: xueli181114

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

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