Skip to content

chore(ci): parallelize integration tests #2488

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
27 changes: 25 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ jobs:
needs:
- int-tests-api
- int-tests-kind
- int-tests-kind-ha-registry
steps:
- name: Succeed if all tests passed
run: echo "Integration tests succeeded"
Expand Down Expand Up @@ -126,12 +127,34 @@ jobs:
cache-dependency-path: "**/*.sum"
- name: Install kind
run: |
curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.27.0/kind-linux-amd64
curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.29.0/kind-linux-amd64
chmod +x ./kind
sudo mv ./kind /usr/local/bin/kind
- name: Run tests
run: |
make -C tests/integration test-kind
make -C tests/integration test-kind SHORT=true

int-tests-kind-ha-registry:
name: Integration tests (kind) HA registry
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache-dependency-path: "**/*.sum"
- name: Install kind
run: |
curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.29.0/kind-linux-amd64
chmod +x ./kind
sudo mv ./kind /usr/local/bin/kind
- name: Run tests
run: |
make -C tests/integration/kind test-registry RUN=TestRegistry_EnableHAAirgap
Copy link
Member

Choose a reason for hiding this comment

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

going to be hard to remember to update the name of the test here if it gets changed in the test file

Copy link
Member Author

Choose a reason for hiding this comment

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

do you have an alternative suggestion?

Copy link
Member

@screspod screspod Jul 15, 2025

Choose a reason for hiding this comment

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

Perhaps a comment on the TestRegistry_EnableHAAirgap function signature that includes a link to this file would be a good temporary solution.

Copy link
Member Author

Choose a reason for hiding this comment

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

updated. an alternative would be to run individual test packages here, e.g. make -C tests/integration/kind test-openebs test-velero etc...


dryrun-tests:
name: Dryrun tests
Expand Down
1 change: 1 addition & 0 deletions tests/integration/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ SHELL := /bin/bash
DEBUG ?=
PARALLEL ?= 2
RUN ?=
SHORT ?= false

.PHONY: test
test: test-kind
Expand Down
13 changes: 9 additions & 4 deletions tests/integration/kind/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ SHELL := /bin/bash

DEBUG ?=
RUN ?=
SHORT ?= false

GO_BUILD_TAGS ?= containers_image_openpgp,exclude_graphdriver_btrfs,exclude_graphdriver_devicemapper,exclude_graphdriver_overlay

Expand All @@ -13,7 +14,8 @@ test-openebs: openebs.test
DEBUG=$(DEBUG) ./openebs.test \
-test.v \
-test.timeout=5m \
-test.run='$(value RUN)'
-test.run='$(value RUN)' \
-test.short=$(SHORT)

.PHONY: test-registry
test-registry: registry.test
Expand All @@ -22,21 +24,24 @@ test-registry: registry.test
DEBUG=$(DEBUG) SKIP_OPERATOR_IMAGE_BUILD=1 ./registry.test \
-test.v \
-test.timeout=15m \
-test.run='$(value RUN)'
-test.run='$(value RUN)' \
-test.short=$(SHORT)

.PHONY: test-velero
test-velero: velero.test
DEBUG=$(DEBUG) ./velero.test \
-test.v \
-test.timeout=5m \
-test.run='$(value RUN)'
-test.run='$(value RUN)' \
-test.short=$(SHORT)

.PHONY: test-adminconsole
test-adminconsole: adminconsole.test
DEBUG=$(DEBUG) ./adminconsole.test \
-test.v \
-test.timeout=5m \
-test.run='$(value RUN)'
-test.run='$(value RUN)' \
-test.short=$(SHORT)

.PHONY: clean
clean:
Expand Down
6 changes: 6 additions & 0 deletions tests/integration/kind/registry/ha_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,13 @@ import (
"github.com/stretchr/testify/require"
)

// If this function name is changed, the .github/workflows/ci.yaml file needs to be updated
// to match the new function name.
func TestRegistry_EnableHAAirgap(t *testing.T) {
if testing.Short() {
t.Skip("skipping test in short mode")
}

ctx := t.Context()

buildOperatorImage(t)
Expand Down
Loading