Skip to content

USHIFT-6640: Fix gateway API tests#6411

Open
pacevedom wants to merge 3 commits intoopenshift:mainfrom
pacevedom:USHIFT-6640
Open

USHIFT-6640: Fix gateway API tests#6411
pacevedom wants to merge 3 commits intoopenshift:mainfrom
pacevedom:USHIFT-6640

Conversation

@pacevedom
Copy link
Copy Markdown
Contributor

No description provided.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Mar 26, 2026
@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented Mar 26, 2026

@pacevedom: This pull request references USHIFT-6640 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 bug to target the "4.22.0" version, but no target version was set.

Details

In 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.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 26, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 4df3c619-abf8-4ee8-8928-2f2ad1366ff6

📥 Commits

Reviewing files that changed from the base of the PR and between 1dee3d9 and 6856dab.

📒 Files selected for processing (1)
  • test/suites/optional/gateway-api.robot

Walkthrough

The gateway-api Robot test suite removed the suite-level robot:skip tag, added a post-apply retry step to verify gateway readiness after resolving HTTPRoute references, and introduced a new keyword that checks the gateway's Programmed condition via kubectl (run with kubeconfig).

Changes

Cohort / File(s) Summary
Robot Test Suite
test/suites/optional/gateway-api.robot
Removed robot:skip from suite Test Tags; extended the Create HTTP Route post-apply wait to include Wait Until Keyword Succeeds running Verify Gateway Programmed after Verify HTTPRoute References Resolved; added Verify Gateway Programmed keyword that queries gateway/test-gateway .status.conditions[?(@.type=="Programmed")].status via Run With Kubeconfig and fails unless the value equals "True".

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

✨ 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 and usage tips.

@openshift-ci openshift-ci bot requested review from eslutsky and jogeo March 26, 2026 13:59
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Mar 26, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: pacevedom

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 Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 26, 2026
Copy link
Copy Markdown

@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

🧹 Nitpick comments (1)
test/suites/optional/gateway-api.robot (1)

81-82: Pass port explicitly to avoid hidden coupling.

Line 82 hardwires ${GATEWAY_PORT} inside Create HTTP Route, which makes the keyword less reusable and harder to maintain when ports vary.

Suggested refactor
 Test Simple HTTP Route
@@
-    Create HTTP Route    ${GATEWAY_HOSTNAME}    ${NS_GATEWAY}
+    Create HTTP Route    ${GATEWAY_HOSTNAME}    ${NS_GATEWAY}    ${GATEWAY_PORT}

 Create HTTP Route
@@
-    [Arguments]    ${hostname}    ${namespace}
+    [Arguments]    ${hostname}    ${namespace}    ${gateway_port}
@@
-    ...    Verify Gateway Port Listening    ${GATEWAY_PORT}
+    ...    Verify Gateway Port Listening    ${gateway_port}

As per coding guidelines, "-Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/suites/optional/gateway-api.robot` around lines 81 - 82, The test
currently relies on a hidden global `${GATEWAY_PORT}` inside the reusable
keyword Create HTTP Route; update the Create HTTP Route keyword to accept an
explicit port argument (e.g., port) and use that argument instead of referencing
`${GATEWAY_PORT}` internally, then call Create HTTP Route from the test passing
`${GATEWAY_PORT}` explicitly and keep Verify Gateway Port Listening invoked with
the same `${GATEWAY_PORT}` so the port is not coupled implicitly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@test/suites/optional/gateway-api.robot`:
- Around line 102-107: The test "Verify Gateway Port Listening" uses `Run And
Return Rc` with `nc -z ${USHIFT_HOST} ${port}` which can hang; replace this with
`Run Process` invoking `nc -z ${USHIFT_HOST} ${port}` (or `nc -z -w <seconds>`),
and supply an explicit Robot Framework `timeout` argument so the command fails
fast on unresponsive networks; update the assertion to check the process return
code from `Run Process` instead of `Run And Return Rc`.

---

Nitpick comments:
In `@test/suites/optional/gateway-api.robot`:
- Around line 81-82: The test currently relies on a hidden global
`${GATEWAY_PORT}` inside the reusable keyword Create HTTP Route; update the
Create HTTP Route keyword to accept an explicit port argument (e.g., port) and
use that argument instead of referencing `${GATEWAY_PORT}` internally, then call
Create HTTP Route from the test passing `${GATEWAY_PORT}` explicitly and keep
Verify Gateway Port Listening invoked with the same `${GATEWAY_PORT}` so the
port is not coupled implicitly.
🪄 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), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: dafe35e2-9bed-49f4-96b1-b60cf0eebd90

📥 Commits

Reviewing files that changed from the base of the PR and between a81273d and 8061a38.

📒 Files selected for processing (1)
  • test/suites/optional/gateway-api.robot

@pacevedom
Copy link
Copy Markdown
Contributor Author

/hold

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 26, 2026
@pacevedom
Copy link
Copy Markdown
Contributor Author

/test all

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Mar 27, 2026

@pacevedom: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/verify 6856dab link true /test verify
ci/prow/e2e-aws-tests-bootc-el9 6856dab link true /test e2e-aws-tests-bootc-el9

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.

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

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. 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.

2 participants