Skip to content

NO-JIRA: port OTP CAPI tests to OTE framework - #627

Open
stefanonardo wants to merge 1 commit into
openshift:mainfrom
stefanonardo:ote-port-otp-capi-tests
Open

NO-JIRA: port OTP CAPI tests to OTE framework#627
stefanonardo wants to merge 1 commit into
openshift:mainfrom
stefanonardo:ote-port-otp-capi-tests

Conversation

@stefanonardo

@stefanonardo stefanonardo commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Port 6 tests from openshift-tests-private clusterinfrastructure/capi to the existing OTE framework
  • Tests rewritten to use controller-runtime client patterns matching existing e2e tests (no new dependencies)
  • All tests tagged with [OTP], [Jira:OCPCLOUD], [OCPFeatureGate:ClusterAPIMachineManagement], [sig-cluster-lifecycle] and start as Informing

Files

  • e2e/operator.go — operator configuration checks (deployment annotations, CRD installation, terminationMessagePolicy, secret sync)
  • e2e/webhook_validation.go — webhook enforcement (infra cluster deletion denied, invalid cluster kind patch rejected, cluster deletion denied)

Tests ported

OTP ID Suite Description
61980 parallel Workload management annotations on deployments
71913 parallel IPAM CRDs installed
73620 parallel terminationMessagePolicy = FallbackToLogsOnError
51141 disruptive worker-user-data secret re-syncs after deletion
76078 disruptive Infrastructure cluster deletion denied by webhook
55205 disruptive Webhook rejects invalid cluster kind patch & deletion

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Tests
    • Added ordered end-to-end validations for Cluster API infrastructure on OpenShift: verify workload management annotations on Deployment pod templates, ensure IPAM CRDs are installed, and confirm all containers use the expected termination message policy.
    • Added platform-scoped coverage to ensure worker user-data Secrets are removed and then automatically re-created.
    • Added webhook enforcement tests to confirm dry-run deletes are denied and invalid infrastructure references are rejected.
  • Chores
    • Updated end-to-end test dependencies to support the new validations.

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: LGTM mode

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jul 15, 2026
@openshift-ci-robot

Copy link
Copy Markdown

@stefanonardo: This pull request explicitly references no jira issue.

Details

In response to this:

Summary

  • Port 6 tests from openshift-tests-private clusterinfrastructure/capi to the existing OTE framework
  • Tests rewritten to use controller-runtime client patterns matching existing e2e tests (no new dependencies)

Tests ported

OTP ID Suite Description
61980 parallel Workload management annotations on deployments
71913 parallel IPAM CRDs installed
73620 parallel terminationMessagePolicy = FallbackToLogsOnError
51141 disruptive worker-user-data secret re-syncs after deletion
76078 disruptive Infrastructure cluster deletion denied by webhook
55205 disruptive Webhook rejects invalid cluster kind patch & deletion

🤖 Generated with Claude Code

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 Jul 15, 2026

Copy link
Copy Markdown

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Adds ordered OpenShift end-to-end suites covering Cluster API Deployment configuration, IPAM CRDs, worker Secret recreation, and webhook rejection of invalid updates and deletions.

Changes

Cluster API e2e validation

Layer / File(s) Summary
Operator configuration checks
e2e/operator.go
Validates Deployment annotations, required IPAM CRDs, and container termination message policies in the Cluster API namespace.
Worker Secret recreation
e2e/operator.go
On supported platforms, deletes worker-user-data and verifies that it is recreated with a different UID.
Webhook validation checks
e2e/webhook_validation.go, e2e/go.mod
Maps platforms to infrastructure kinds, checks rejection of invalid references and deletion attempts, and adds supporting test dependencies.

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

Suggested reviewers: nrb, theobarberbany

Sequence Diagram(s)

sequenceDiagram
  participant E2ETest
  participant KubernetesAPI
  participant Webhook
  E2ETest->>KubernetesAPI: Submit invalid infrastructure reference
  KubernetesAPI->>Webhook: Validate patch
  Webhook-->>KubernetesAPI: Reject invalid kind
  KubernetesAPI-->>E2ETest: Return validation error
  E2ETest->>KubernetesAPI: Submit dry-run deletion
  KubernetesAPI->>Webhook: Validate deletion
  Webhook-->>KubernetesAPI: Reject deletion
  KubernetesAPI-->>E2ETest: Return denial error
Loading
🚥 Pre-merge checks | ✅ 12 | ❌ 3

❌ Failed checks (3 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Test Structure And Quality ⚠️ Warning The secret re-sync assertion uses framework.MAPINamespace in its failure message, so the diagnostic text is wrong and misleading. Change that message to CAPINamespace and add clearer failure context to the other cluster assertions if you want stronger diagnosability.
Microshift Test Compatibility ⚠️ Warning e2e/operator.go and e2e/webhook_validation.go use config.openshift.io platform types with no [Skipped:MicroShift]/[apigroup:...] guard, so they’re not MicroShift-safe. Add a MicroShift skip guard or tag these suites with an unavailable API group / [Skipped:MicroShift] so the tests are automatically excluded on MicroShift.
✅ Passed checks (12 passed)
Check name Status Explanation
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.
Stable And Deterministic Test Names ✅ Passed Both new files use only static literal Describe/It titles; no timestamps, IDs, node/namespace names, or other runtime values appear in test names.
Single Node Openshift (Sno) Test Compatibility ✅ Passed The new e2e tests only do namespace-scoped API checks, dry-run webhook calls, and secret re-sync; they don’t count nodes or require HA behavior.
Topology-Aware Scheduling Compatibility ✅ Passed PASS: The PR only adds e2e validation tests and a go.mod entry; no deployment manifests, pod specs, affinity, replicas, PDBs, or node selectors were introduced.
Ote Binary Stdout Contract ✅ Passed No process-level stdout writes were added; suite setup only registers schemes/sets Ginkgo loggers, and the only direct output goes to stderr.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed The new Ginkgo tests only use Kubernetes client CRUD/list operations and platform gating; no hardcoded IPs, IPv4-only parsing, URL building, or external internet access.
No-Weak-Crypto ✅ Passed Reviewed the touched files; they add e2e checks and dependency updates only, with no MD5/SHA1/DES/RC4/3DES/Blowfish/ECB, custom crypto, or secret/token comparisons.
Container-Privileges ✅ Passed No changed K8s manifests or privileged settings were added; the PR only adds Go e2e tests and a go.mod update, with no privileged/root/host* or allowPrivilegeEscalation fields.
No-Sensitive-Data-In-Logs ✅ Passed No added logs emit secrets/tokens/PII; new Ginkgo messages only reference resource names, namespaces, platform, and status checks.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: porting OTP CAPI tests into the OTE framework.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@openshift-ci
openshift-ci Bot requested review from nrb and theobarberbany July 15, 2026 15:06
@openshift-ci

openshift-ci Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign racheljpg for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@stefanonardo
stefanonardo force-pushed the ote-port-otp-capi-tests branch 2 times, most recently from 74e1114 to 5df1330 Compare July 15, 2026 15:09

@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: 3

🤖 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 `@e2e/otp_capi_machines.go`:
- Around line 25-29: Require the named managed resources directly: in
e2e/otp_capi_machines.go lines 25-29, replace the ClusterList lookup and
first-item selection with a fetch of the Cluster named clusterName; in
e2e/otp_capi.go lines 123-125, fail the test when the matching infrastructure
resource is absent instead of skipping it.

In `@e2e/otp_capi.go`:
- Around line 23-26: The user-facing test output in e2e/otp_capi.go lines 23-26
must say “Cluster API” instead of “CAPI,” including the deployment-listing step
and namespace assertion. In e2e/otp_capi_machines.go lines 19-27, update the
skip, test, step, and assertion text to use “Cluster API” consistently; no
direct changes are required elsewhere.
- Around line 127-130: Update the deletion checks to use dry-run operations via
client.DryRunAll: in e2e/otp_capi.go, pass the option to the infrastructure
resource Delete call; in e2e/otp_capi_machines.go, pass it to the Cluster Delete
call. Preserve the existing denied-error assertions at both sites.
🪄 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 YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 6551d145-75c2-420a-8dd9-964ce5e7400d

📥 Commits

Reviewing files that changed from the base of the PR and between 1fcdc56 and 5df1330.

📒 Files selected for processing (2)
  • e2e/otp_capi.go
  • e2e/otp_capi_machines.go

Comment thread e2e/otp_capi_machines.go Outdated
Comment thread e2e/otp_capi.go Outdated
Comment thread e2e/otp_capi.go Outdated
Comment thread e2e/operator.go Outdated
"sigs.k8s.io/controller-runtime/pkg/client"
)

var _ = Describe("[OTP][Jira:OCPCLOUD][OCPFeatureGate:ClusterAPIInstall][sig-cluster-lifecycle] Cluster_Infrastructure CAPI", Ordered, func() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

do we keep [OTP] tag if it is no longer in OTP? What about [Jira:OCPCLOUD] tag?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

it's required by the OTE integration guide for tracking purposes

Comment thread e2e/operator.go
@@ -0,0 +1,147 @@
package e2e

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

do we want otp_ filename prefix?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

not really, I renamed the tests

@miyadav

miyadav commented Jul 15, 2026

Copy link
Copy Markdown
Member

/test e2e-aws-capi-techpreview

@stefanonardo
stefanonardo force-pushed the ote-port-otp-capi-tests branch 3 times, most recently from 2118b06 to 5453621 Compare July 16, 2026 08:22

@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: 2

🧹 Nitpick comments (1)
e2e/webhook_validation.go (1)

84-85: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use a descriptive parameter name.

Rename p to platform to make the mapping logic self-explanatory. As per coding guidelines, use descriptive names for functions, variables, and identifiers.

Suggested refactor
-func platformToInfraClusterKind(p configv1.PlatformType) string {
-	switch p {
+func platformToInfraClusterKind(platform configv1.PlatformType) string {
+	switch platform {
🤖 Prompt for 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.

In `@e2e/webhook_validation.go` around lines 84 - 85, Rename the parameter `p` to
`platform` in `platformToInfraClusterKind` and update all references within the
function’s switch or mapping logic accordingly, without changing behavior.

Source: Coding guidelines

🤖 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 `@e2e/operator.go`:
- Around line 50-64: Update the test around “should have FallbackToLogsOnError
as terminationMessagePolicy” to list Deployments in framework.CAPINamespace
instead of Pods, assert the Deployment list is non-empty, and inspect each
deployment’s deploy.Spec.Template.Spec.Containers for
TerminationMessageFallbackToLogsOnError.
- Around line 79-89: Update the secret deletion and re-sync verification around
secretKey to capture the original Secret UID before calling cl.Delete. In the
Eventually assertion, fetch the recreated Secret into a variable and require its
UID to differ from the saved UID, ensuring the check confirms recreation rather
than observing the deleting object.

---

Nitpick comments:
In `@e2e/webhook_validation.go`:
- Around line 84-85: Rename the parameter `p` to `platform` in
`platformToInfraClusterKind` and update all references within the function’s
switch or mapping logic accordingly, without changing behavior.
🪄 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 YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 0aa85948-a4f0-47a9-89f0-f21f24c261ec

📥 Commits

Reviewing files that changed from the base of the PR and between 5df1330 and 2118b06.

📒 Files selected for processing (2)
  • e2e/operator.go
  • e2e/webhook_validation.go

Comment thread e2e/operator.go Outdated
Comment thread e2e/operator.go Outdated

@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 `@e2e/go.mod`:
- Line 23: Update the module requirements in e2e/go.mod for
github.com/metal3-io/baremetal-operator/apis to v0.8.1 and
go.mongodb.org/mongo-driver to v1.17.7, preserving all other dependency versions
and declarations.
🪄 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 YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 391ef080-064d-45de-bcaf-77a417e57e87

📥 Commits

Reviewing files that changed from the base of the PR and between 2118b06 and 5453621.

⛔ Files ignored due to path filters (1)
  • e2e/go.sum is excluded by !**/*.sum
📒 Files selected for processing (3)
  • e2e/go.mod
  • e2e/operator.go
  • e2e/webhook_validation.go
🚧 Files skipped from review as they are similar to previous changes (2)
  • e2e/operator.go
  • e2e/webhook_validation.go

Comment thread e2e/go.mod Outdated
@stefanonardo
stefanonardo force-pushed the ote-port-otp-capi-tests branch from 5453621 to e1b4b82 Compare July 16, 2026 08:51
@stefanonardo

Copy link
Copy Markdown
Contributor Author

/test e2e-aws-ovn-techpreview

@stefanonardo
stefanonardo force-pushed the ote-port-otp-capi-tests branch from e1b4b82 to 6bee369 Compare July 16, 2026 14:36
@stefanonardo

Copy link
Copy Markdown
Contributor Author

/test e2e-aws-ovn-techpreview

@stefanonardo

Copy link
Copy Markdown
Contributor Author

/refresh tide

@openshift-ci openshift-ci Bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 21, 2026
@stefanonardo
stefanonardo force-pushed the ote-port-otp-capi-tests branch from 6bee369 to 0b306f2 Compare July 21, 2026 13:22
@openshift-ci openshift-ci Bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 21, 2026
@stefanonardo

Copy link
Copy Markdown
Contributor Author

/retest

@stefanonardo
stefanonardo force-pushed the ote-port-otp-capi-tests branch 2 times, most recently from 5b8e32a to 588eb2f Compare July 23, 2026 08:00
Comment thread e2e/operator.go Outdated
"sigs.k8s.io/controller-runtime/pkg/client"
)

var _ = Describe("[OTP][Jira:OCPCLOUD][OCPFeatureGate:ClusterAPIMachineManagement][sig-cluster-lifecycle] Cluster_Infrastructure CAPI", Ordered, func() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we need Ordered? Also for the other Describe block.

Comment thread e2e/go.mod Outdated
github.com/metal3-io/cluster-api-provider-metal3/api v1.11.2
github.com/onsi/ginkgo/v2 v2.28.1
github.com/onsi/gomega v1.39.1
github.com/openshift-eng/openshift-tests-extension v0.0.0-20260612102633-2fd5b2fa4221

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Not major but.
The openshift-tests-extension submodule was intentionally kept as a separate Go module to isolate its dependencies from the main module.

We could switch

- oteg.Informing()
+ Label("Lifecycle:informing")

to eliminate the dependency since Ginkgo is already a main module dependency.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The other repos are not following this practise, so we might keep it as it is.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I believe the OTE migration skill did this, I'll replace it with Label

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

maybe it was coming from here: https://github.com/openshift/cluster-capi-operator/blob/main/openshift-tests-extension/README.md?plain=1#L90

If your moving forward with it, can you also update the README?

Comment thread e2e/operator.go
)

var _ = Describe("[OTP][Jira:OCPCLOUD][OCPFeatureGate:ClusterAPIMachineManagement][sig-cluster-lifecycle] Cluster_Infrastructure CAPI", Ordered, func() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

When tests are invoked via make e2e (bypassing OTE tag filtering), they'll run regardless of gate state and fail on a non-TechPreview cluster. Needs a BeforeEach FG guard.

  BeforeEach(func() {
      if !framework.IsFeatureGateEnabled(ctx, cl, features.FeatureGateClusterAPIMachineManagement) {
          Skip("Feature gate ClusterAPIMachineManagement is not enabled.")
      }
  })

Comment thread e2e/operator.go
@@ -0,0 +1,96 @@
package e2e

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Both files are missing the Apache 2.0 license header that every other file in this package carries

Comment thread e2e/webhook_validation.go Outdated
var _ = Describe("[OTP][Jira:OCPCLOUD][OCPFeatureGate:ClusterAPIMachineManagement][sig-cluster-lifecycle] Cluster API Webhook Validation", Ordered, func() {

It("should deny deletion of infrastructure cluster resources", Label("Disruptive"), oteg.Informing(), func() {
switch platform {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is a nice addon for skiping when using make e2e and it also skips the test at runtime when running with openshift-tests.

However, #613 introduces Label("platform:<name>") with OTE suite-level wiring that filters at scheduling time.
Adding the label avoids OTE spinning up test infrastructure for these tests on unsupported platforms.
This might be a follow up, since the convention is only introduced at #613

@stefanonardo
stefanonardo force-pushed the ote-port-otp-capi-tests branch 2 times, most recently from 59f23b2 to 3d9bc10 Compare July 23, 2026 11:26

@pmeida pmeida left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

PR #606 introduces tests for the foundational deployment layer - highly deterministic, fast checks.
This PR ports deeper operational/functional behavior tests that happen to share the same gate.
That said, most tests here are also checking static state (annotations exist, CRDs exist, pod spec fields) - equally deterministic.
The secret re-sync test is the exception: it deletes a secret and waits for the controller to recreate it, making it a reconciliation/timing test and inherently more fragile. Also worth noting: the secret sync controller activates with the platform-specific gate (e.g. ClusterAPIMachineManagementAWS), so this test may be gated on the wrong feature gate.

I don't see direct overlaps between the two PRs, but #606 established a convention where tests for a specific feature gate live in a single file (e.g. cluster_api_machine_management.go, cluster_api_machine_management_aws.go). These PR breaks the pattern.

Comment thread e2e/webhook_validation.go Outdated
Comment on lines +103 to +116
func platformToInfraClusterKind(p configv1.PlatformType) string {
switch p {
case configv1.AWSPlatformType:
return "AWSCluster"
case configv1.GCPPlatformType:
return "GCPCluster"
case configv1.VSpherePlatformType:
return "VSphereCluster"
case configv1.AzurePlatformType:
return "AzureCluster"
default:
return ""
}
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The codebase already has pkg/util.GetCAPITypesForInfrastructure() which maps platform to infra cluster kind. See webhook_test.go for usage.

Comment thread e2e/operator.go Outdated
Comment on lines +106 to +114
Eventually(func() bool {
recreated := &corev1.Secret{}
if err := cl.Get(ctx, secretKey, recreated); err != nil {
return false
}
return recreated.UID != originalUID
}, framework.WaitMedium, framework.RetryMedium).Should(BeTrue(),
"worker-user-data secret should be re-created from %s", framework.MAPINamespace)
})

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I see your not using komega here, and other places.

# example with komega
recreated := &corev1.Secret{ObjectMeta: metav1.ObjectMeta{Name: secretKey.Name, Namespace: secretKey.Namespace}}
Eventually(komega.Object(recreated)).WithTimeout(framework.WaitMedium).WithPolling(framework.RetryMedium).Should(
    HaveField("UID", Not(Equal(originalUID))),
)

This is the most impactful one - it fixes the swallowed-error problem and the missing-komega problem in a single change.
The other calls would also benefit from retry on transient API errors. The simple Gets are lower priority but still worth aligning for consistency.

@stefanonardo
stefanonardo force-pushed the ote-port-otp-capi-tests branch from 3d9bc10 to 93a0cf8 Compare July 24, 2026 12:15
Port 6 tests from openshift-tests-private clusterinfrastructure/capi
to OTE using controller-runtime patterns. Tests include [OTP],
[Jira:OCPCLOUD], [OCPFeatureGate:ClusterAPIInstall] tags and start
as Informing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@stefanonardo
stefanonardo force-pushed the ote-port-otp-capi-tests branch from 93a0cf8 to f3b8ac4 Compare July 24, 2026 12:33
@openshift-ci

openshift-ci Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

@stefanonardo: all tests passed!

Full PR test history. Your PR dashboard.

Details

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 kubernetes-sigs/prow repository. I understand the commands that are listed here.

@pmeida

pmeida commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Since #606 has been merged we can already (but I am postponing to apply in one go):

  • Move operator.go and webhook_validation.go [OCPFeatureGate:ClusterAPIMachineManagement] tests into cluster_api_machine_management.go
  • Move operator.go and webhook_validation.go [OCPFeatureGate:ClusterAPIMachineManagement*] tests into cluster_api_machine_management_*.go - this are new files

Lets just wait for #613
after that we can:

  • Move operator.go and webhook_validation.go [OCPFeatureGate:ClusterAPIMachineManagementAWS] tests into cluster_api_machine_management_aws.go
  • Also apply Label("platform:aws") to [OCPFeatureGate:ClusterAPIMachineManagementAWS] and so on for other platforms - this allows filtering at OTE level

@pmeida

pmeida commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

I was starting to implement the above comment but stumbled with the 2 concerns.
Example test:

// port=maybe - 90.2% pass rate (246 runs last 60 days)
g.It("Author:zhsun-NonHyperShiftHOST-Medium-55205-Webhook validations for CAPI [Disruptive]", func() {

We recommend only porting tests with port=yes (95%+ pass rate), but others can be ported if a team feels they are worthwhile
source

The following ported tests have pass rates bellow it:

  • 51141 - 89,4%
  • 76078 - 89%
  • 55205 - 90,2%

Maybe we shouldn't port them.

  1. Most of the ported tests have NonHyperShiftHOST in the name. This means they be excluded from Hypershift cluster runs. We can achieve the same with a label introduced by OCPBUGS-100143: e2e: skip CRD Compatibility Checker tests on External topology clusters #638

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants