Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
ec13353
Add ACS smoke test
kurlov Jul 2, 2026
629ad02
Add auto test
kurlov Jul 6, 2026
7641694
Fix testing
kurlov Jul 6, 2026
d58a4d8
Fix auto smoke test
kurlov Jul 6, 2026
d2c4fc7
Fix env
kurlov Jul 6, 2026
16d53aa
Add manual PR trigger
kurlov Jul 6, 2026
efec9d9
Fix infra provisioning
kurlov Jul 6, 2026
3d73d43
Fix flavor
kurlov Jul 6, 2026
417c180
Drop redundant GCP auth
kurlov Jul 6, 2026
f002468
Fix infra cluster artifact fetch
kurlov Jul 6, 2026
e4e3123
Pass INFRA_TOKEN
kurlov Jul 6, 2026
190bb3f
Simplify auto smoke test
kurlov Jul 7, 2026
a8e5cd7
Apply suggestions from code review
kurlov Jul 13, 2026
140b7f7
Remove bash based test suit
kurlov Jul 14, 2026
dda9edd
Add golang based test
kurlov Jul 14, 2026
fdddf2a
Add makefile target
kurlov Jul 14, 2026
b220d9b
Address feedback
kurlov Jul 14, 2026
8d5d129
Simplify verson read
kurlov Jul 28, 2026
5a81718
Apply suggestions from code review
kurlov Jul 28, 2026
f2a9a17
Add trigger to test workflow in the PR again
kurlov Jul 28, 2026
369321a
Fix workflow test in the PR
kurlov Jul 28, 2026
94c11c8
Simplify OLM
kurlov Sep 1, 2026
8e7ac58
Add derive-input program
kurlov Sep 16, 2026
504e0c5
Remove redundant params
kurlov Sep 16, 2026
3859cd1
Combine stderr and stdout from oc cmd exec
kurlov Sep 16, 2026
d1f22a7
Review comments
kurlov Sep 16, 2026
c2f4959
Add derive-input program
kurlov Sep 16, 2026
8f7643b
Add ocp targets
kurlov Sep 16, 2026
bc975c5
Add UpgradeSuite
kurlov Sep 16, 2026
06f74de
use ocp versions for matrix
kurlov Sep 16, 2026
0c7ceb7
Merge branch 'master' into akurlov/ROX-29003-smoke-test-on-infra
kurlov Sep 16, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 84 additions & 0 deletions .github/workflows/auto-operator-index-upgrade-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: "Auto Operator Index Upgrade Test"

on:
workflow_dispatch:
inputs:
version-stream-override:
description: 'Override ACS stream version, skips bundles.yaml diff (e.g. "4.10")'
required: false
type: string
operator-index-image-override:
description: 'Override operator-index image (e.g. quay.io/rhacs-eng/stackrox-operator-index:ocp-v4-22-...)'
required: false
type: string
push:
branches: [master]
paths: ['bundles.yaml']
pull_request:
paths: ['bundles.yaml']

permissions:
contents: read

Comment thread
kurlov marked this conversation as resolved.
defaults:
run:
shell: bash

jobs:
derive-inputs:
name: Derive operator-index-upgrade test inputs
runs-on: ubuntu-latest
outputs:
version-streams: ${{ steps.derive.outputs.version-streams }}
ocp-targets: ${{ steps.derive.outputs.ocp-targets }}
steps:
- name: Check out code
uses: actions/checkout@v7
with:
fetch-depth: 0
persist-credentials: false

- name: Derive upgrade test inputs
id: derive
env:
VERSION_STREAM_OVERRIDE: ${{ inputs.version-stream-override }}
OPERATOR_INDEX_IMAGE_OVERRIDE: ${{ inputs.operator-index-image-override }}
BASE_REF: ${{ github.base_ref }}
EVENT_NAME: ${{ github.event_name }}
SHA: ${{ github.event.pull_request.head.sha || github.sha }}
run: go run ./cmd/derive-inputs >> "$GITHUB_OUTPUT"

- name: Wait for oldest-OCP operator-index image
if: steps.derive.outputs.version-streams != ''
uses: stackrox/actions/release/wait-for-image@v1
with:
image: ${{ fromJson(steps.derive.outputs.ocp-targets)[0].operator-index-image }}
interval: "60"
limit: "7200"

- name: Wait for newest-OCP operator-index image
if: steps.derive.outputs.version-streams != '' && fromJson(steps.derive.outputs.ocp-targets)[1] != null
uses: stackrox/actions/release/wait-for-image@v1
with:
image: ${{ fromJson(steps.derive.outputs.ocp-targets)[1].operator-index-image }}
interval: "60"
limit: "7200"

run-upgrade-tests:
name: Run operator-index upgrade tests
needs: derive-inputs
if: needs.derive-inputs.outputs.version-streams != ''
strategy:
matrix:
version-stream: ${{ fromJson(needs.derive-inputs.outputs.version-streams) }}
ocp-target: ${{ fromJson(needs.derive-inputs.outputs.ocp-targets) }}
# if any matrix job fails, continue to run the rest of the jobs
fail-fast: false
uses: ./.github/workflows/operator-index-upgrade-test.yml
with:
operator-index-image: ${{ matrix.ocp-target.operator-index-image }}
version-stream: ${{ matrix.version-stream }}
ocp-version: ${{ matrix.ocp-target.ocp-version }}
cluster-lifespan: 3h
secrets:
INFRA_TOKEN: ${{ secrets.INFRA_TOKEN }}
158 changes: 158 additions & 0 deletions .github/workflows/operator-index-upgrade-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
name: "Operator Index Upgrade Test"

on:
workflow_dispatch:
inputs:
operator-index-image:
description: 'ACS Operator index image (e.g., quay.io/rhacs-eng/stackrox-operator-index:ocp-v4-22-...)'
required: true
type: string
version-stream:
description: 'ACS version stream under test (e.g. 4.10). Determines channel and Y-2 oldest.'
required: true
type: string
ocp-version:
description: 'OCP version for the infra cluster (e.g. 4.22). Derived from operator-index-image tag if not set.'
required: false
default: ''
type: string
Comment on lines +14 to +18

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.

Why do we need ocp-version on the inputs if we can derive it from the index image tag?

cluster-lifespan:
description: 'Cluster lifespan (e.g., 2h, 4h, 8h)'
required: false
default: '2h'
type: string
workflow_call:
inputs:
operator-index-image:
description: 'ACS Operator index image'
required: true
type: string
version-stream:
description: 'ACS minor version under test (e.g. 4.10). Determines channel and Y-2 oldest.'
required: true
type: string
ocp-version:
description: 'OCP version for the infra cluster (e.g. 4.22). Derived from operator-index-image tag if not set.'
required: false
default: ''
type: string
cluster-lifespan:
description: 'Cluster lifespan (e.g., 2h, 4h, 8h)'
required: false
default: '2h'
type: string
secrets:
INFRA_TOKEN:
required: true

permissions:
contents: read

defaults:
run:
shell: bash

env:
CLUSTER_NAME: upgrade-test-${{ github.run_id }}-${{ github.run_attempt }}

run-name: >-
${{ format('Operator Index Upgrade Test v{0}', inputs.version-stream) }}

jobs:
create-cluster:
name: Create OpenShift cluster
runs-on: ubuntu-latest
steps:
- name: Set cluster args
id: ocp
env:
OCP_VERSION: ${{ inputs.ocp-version }}
run: |
if [[ -n "$OCP_VERSION" ]]; then
echo "infra-args=openshift-version=ocp/stable-${OCP_VERSION}" >> "$GITHUB_OUTPUT"
Comment thread
tommartensen marked this conversation as resolved.
else
echo "infra-args=" >> "$GITHUB_OUTPUT"
fi

- name: Create OpenShift cluster
uses: stackrox/actions/infra/create-cluster@v1
with:
token: ${{ secrets.INFRA_TOKEN }}
flavor: openshift-4
name: ${{ env.CLUSTER_NAME }}
lifespan: ${{ inputs.cluster-lifespan }}
wait: true
Comment on lines +79 to +84

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.

If we use the action like this, we don't know which OCP version we will get. It will default to stable channel, but this repository may already be at the next pre-GA OCP version (example of today: v4-23 is pre-GA, but stable points to 4.22). We would then attempt to deploy an incompatible operator-index image.

Please add the target OCP version as an argument to the create-cluster call.
See as an example how Moritz did it for e2e tests: https://github.com/stackrox/stackrox/pull/21056/changes#diff-fae363d12badfb7e0eddf7c1ef733703d27c9a4dad762d4c928288e049f438e0R30.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Added as an argument

args: ${{ steps.ocp.outputs.infra-args }}

run-upgrade-tests:
name: Run operator-index upgrade tests
needs: create-cluster
runs-on: ubuntu-latest
container:
image: quay.io/stackrox-io/apollo-ci:stackrox-test-stable
steps:
- name: Check out code
uses: actions/checkout@v7
with:
persist-credentials: false

- name: Install infractl
uses: stackrox/actions/infra/install-infractl@v1

- name: Download cluster kubeconfig
env:
INFRA_TOKEN: ${{ secrets.INFRA_TOKEN }}
run: |
infractl artifacts --download-dir=./artifacts "$CLUSTER_NAME"
echo "KUBECONFIG=${{ github.workspace }}/artifacts/kubeconfig" >> "$GITHUB_ENV"

- name: "Test 1: upgrade oldest-supported → provided"
env:
OPERATOR_INDEX_IMAGE: ${{ inputs.operator-index-image }}
VERSION_STREAM: ${{ inputs.version-stream }}
run: make upgrade-test-oldest

- name: "Test 2: install provided → optionally upgrade to latest GA"
env:
OPERATOR_INDEX_IMAGE: ${{ inputs.operator-index-image }}
VERSION_STREAM: ${{ inputs.version-stream }}
run: make upgrade-test-latest

delete-test-cluster:
name: Delete infra test cluster
needs: [create-cluster, run-upgrade-tests]
runs-on: ubuntu-latest
if: always() && needs.create-cluster.result != 'cancelled'
env:
INFRA_TOKEN: ${{ secrets.INFRA_TOKEN }}
steps:
- name: Install infractl
uses: stackrox/actions/infra/install-infractl@v1

- name: Delete cluster
run: infractl delete "${CLUSTER_NAME}"

report-status:
name: Report test status
needs: [create-cluster, run-upgrade-tests, delete-test-cluster]
runs-on: ubuntu-latest
if: always()
steps:
- name: Write summary
run: |
cat <<'EOF' >> "$GITHUB_STEP_SUMMARY"
# Operator Index Upgrade Test Results

| Field | Value |
|-------|-------|
| **Operator image** | `${{ inputs.operator-index-image }}` |
Comment thread
kurlov marked this conversation as resolved.
| **ACS version** | `${{ inputs.version-stream }}` |
| **Cluster** | `${{ env.CLUSTER_NAME }}` |
| **Create cluster** | ${{ needs.create-cluster.result }} |
| **Upgrade tests** | ${{ needs.run-upgrade-tests.result }} |
| **Delete cluster** | ${{ needs.delete-test-cluster.result }} |

## Tests run:
1. **Test 1** — install oldest supported ACS version, upgrade to the provided operator-index image
2. **Test 2** — install provided operator-index image, upgrade to latest GA if provided ACS version is behind
EOF
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,18 @@ catalog-template.yaml: bundles.yaml $(wildcard $(GENERATE_SCRIPT_FOLDER)/*.go)
go-test:
@$(GO) test -cover -v ./cmd/...

# Operator index upgrade tests — require OPERATOR_INDEX_IMAGE and ACS_VERSION env vars.
# Example: make upgrade-test-oldest OPERATOR_INDEX_IMAGE=quay.io/rhacs-eng/stackrox-operator-index:... ACS_VERSION=4.11
.PHONY: upgrade-test-oldest upgrade-test-latest upgrade-test

upgrade-test-oldest:
$(GO) test -v -count=1 -run 'TestUpgradeSuite/TestUpgradeOldest' -timeout 45m ./operator-index-upgrade-test/

upgrade-test-latest:
$(GO) test -v -count=1 -run 'TestUpgradeSuite/TestUpgradeLatest' -timeout 30m ./operator-index-upgrade-test/

upgrade-test: upgrade-test-oldest upgrade-test-latest
Comment on lines +39 to +49

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.

Why did you decide to have separate targets for each test as opposed to just running go test pointed at ./operator-index-upgrade-test/ so that it runs everything it finds there?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

they have different timeouts and also it should be more explicit in the logs which test failed instead of go test failure


$(OPM):
mkdir -p "$$(dirname $@)"
os_name="$$(uname | tr '[:upper:]' '[:lower:]')"; \
Expand Down
Loading