Skip to content

test(e2e): install openshell CLI via console-recommended command - #219

Draft
JuanmaBM wants to merge 1 commit into
openshift-online:feature/gateway-version-installfrom
JuanmaBM:feat/e2e-install-match
Draft

test(e2e): install openshell CLI via console-recommended command#219
JuanmaBM wants to merge 1 commit into
openshift-online:feature/gateway-version-installfrom
JuanmaBM:feat/e2e-install-match

Conversation

@JuanmaBM

Copy link
Copy Markdown
Collaborator

Note

Depends on #210 — this is a stacked, draft PR based on feature/gateway-version-install. GitHub will auto-retarget it to main once #210 merges; at that point it can be marked ready for review.

Summary

The e2e test used to install the openshell CLI from a version pinned by hand in the CI workflow (v0.0.110), independent of the gateway image under test. This makes the e2e test install the CLI the same way the console recommends to users — by deriving the version from the reconciled gateway_version API field (added in #210) and running the exact install.sh | OPENSHELL_VERSION=… sh command the UI builds.

This matters because we're about to run downstream openshell-gateway images: their reported version carries a -rh… build suffix, and we need the recommended install command to keep working for them.

Changes

  • tests/e2e/lib.sh — add openshell_installer_version(), a pure helper mirroring buildOpenShellInstallCommand in packages/gateway-management-ui/src/gateways/gateway-connections.ts (trim → drop the first - and everything after → ensure a leading v). New env defaults: E2E_OPENSHELL_INSTALL (auto/always/never), OPENSHELL_INSTALL_SCRIPT_URL, E2E_GATEWAY_VERSION_TIMEOUT.
  • tests/e2e/e2e-openshell.sh — step 5 polls the API for gateway_version, installs the CLI with the console-recommended command, and asserts the installed openshell --version matches the derived version. The early presence check is relaxed (the CLI is installed after provisioning); E2E_OPENSHELL_INSTALL=never keeps the strict pre-installed behavior.
  • .github/workflows/e2e.yml — drop the hardcoded pinned install step.

Guardrail

Because install.sh pins OPENSHELL_VERSION exactly, a version that doesn't resolve to a real upstream release (e.g. a mis-trimmed downstream suffix) fails the test at the version-match assertion instead of silently installing the wrong CLI.

Note on keeping in lockstep

The version-derivation rule is intentionally duplicated in bash. lib.sh documents buildOpenShellInstallCommand as the canonical source; the two must stay in sync.

Validation

  • bash -n on both scripts; workflow YAML parses.
  • Unit-tested openshell_installer_version across cases including the downstream suffix (v0.0.109-rh9a8f8 → v0.0.109) and the empty/--prefixed cases the UI treats as undefined.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Aug 28, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 53831876-ff0e-4658-b743-4e34d17885b7

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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

@JuanmaBM

Copy link
Copy Markdown
Collaborator Author

Stacked on top of #210 (based on its feature/gateway-version-install branch). This PR only adds the e2e install change; it depends on the gateway_version API field introduced in #210. GitHub will auto-retarget this PR to main once #210 merges.

Instead of pinning the openshell CLI version in the CI workflow, the e2e
test now derives it from the reconciled gateway_version API field and
installs the CLI with the exact command the console recommends to users
(buildOpenShellInstallCommand). This keeps CI exercising the shipped
install path and guards it against breakage for downstream gateway images
whose reported version carries a "-rh…" build suffix.

- lib.sh: add openshell_installer_version() mirroring the UI derivation
  rule (trim, drop first "-"+suffix, ensure leading "v"), plus
  E2E_OPENSHELL_INSTALL / OPENSHELL_INSTALL_SCRIPT_URL /
  E2E_GATEWAY_VERSION_TIMEOUT defaults.
- e2e-openshell.sh: poll the API for gateway_version, install via the
  recommended command, and assert the installed version matches.
- e2e.yml: drop the hardcoded pinned install step.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@JuanmaBM
JuanmaBM force-pushed the feat/e2e-install-match branch from 3758d21 to 10db013 Compare August 31, 2026 07:23
@JuanmaBM

Copy link
Copy Markdown
Collaborator Author

CI status

No action needed on the e2e failures before #210 merges.

@JuanmaBM

Copy link
Copy Markdown
Collaborator Author

Update: the check gate is now green. The latest E2E run reconfirms the same expected cause — the image-swap now deploys control-plane tag 94659f7, which is simply the current main HEAD (main advanced past 04d3322); it is not an ancestor of this PR's base branch, so it still predates the gateway_version reconciler. The test correctly times out waiting for gateway_version.

No change needed here: this stays red until #210 merges into main. Plan once #210 lands: rebase onto main, mark ready, and re-run E2E to confirm the install path goes green against a control-plane image that includes the reconciler.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant