Skip to content

Commit f974b0c

Browse files
committed
update kueue to v0.11 and add testing code
Signed-off-by: Qing Hao <qhao@redhat.com>
1 parent e88f330 commit f974b0c

23 files changed

Lines changed: 3117 additions & 90 deletions

File tree

.github/workflows/e2e.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
- name: Setup Go
3030
uses: actions/setup-go@v5
3131
with:
32-
go-version: 1.23
32+
go-version: 1.24
3333

3434
- name: Test E2E
3535
run: |

.github/workflows/post.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ jobs:
115115
- name: install Go
116116
uses: actions/setup-go@v5
117117
with:
118-
go-version: '1.23'
118+
go-version: '1.24'
119119
- name: install imagebuilder
120120
run: go install github.com/openshift/imagebuilder/cmd/imagebuilder@v1.2.16
121121
- name: pull base image

.github/workflows/releaseimage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77

88
env:
99
# Common versions
10-
GO_VERSION: '1.23'
10+
GO_VERSION: '1.24'
1111
GO_REQUIRED_MIN_VERSION: ''
1212
GOPATH: '/home/runner/work/addon-contrib/addon-contrib/go'
1313
GITHUB_REF: ${{ github.ref }}

.github/workflows/test.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
- name: Set up Go
3535
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5
3636
with:
37-
go-version: 1.23
37+
go-version: 1.24
3838
# See: https://github.com/actions/setup-go/issues/424
3939
# go-version-file: go.work
4040
cache-dependency-path: "**/go.sum"
@@ -47,10 +47,14 @@ jobs:
4747
id: build
4848
run: cd ${{ inputs.repo }} && make build
4949

50-
- name: Test
51-
id: test
50+
- name: Unit Test
51+
id: unit-test
5252
run: cd ${{ inputs.repo }} && make test-unit
5353

54+
- name: Integration Test
55+
id: integration-test
56+
run: cd ${{ inputs.repo }} && make test-integration
57+
5458
test-chart:
5559
name: Run Helm Chart Tests
5660
runs-on: ubuntu-latest

kueue-addon/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.23-bullseye AS builder
1+
FROM golang:1.24-bullseye AS builder
22
ARG OS=linux
33
ARG ARCH=amd64
44
WORKDIR /go/src/open-cluster-management.io/addon-contrib/kueue-addon

kueue-addon/Makefile

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,46 @@ $(KUSTOMIZE):
7979
curl $(KUSTOMIZE_INSTALL_SCRIPT) | bash -s -- $(subst v,,$(KUSTOMIZE_VERSION)) $(LOCALBIN)
8080

8181
# test
82+
TEST_TMP :=/tmp
83+
export KUBEBUILDER_ASSETS ?=$(TEST_TMP)/kubebuilder/bin
84+
85+
K8S_VERSION ?=1.30.0
86+
GOHOSTOS ?=$(shell go env GOHOSTOS)
87+
GOHOSTARCH ?=$(shell go env GOHOSTARCH)
88+
KB_TOOLS_ARCHIVE_NAME :=kubebuilder-tools-$(K8S_VERSION)-$(GOHOSTOS)-$(GOHOSTARCH).tar.gz
89+
KB_TOOLS_ARCHIVE_PATH := $(TEST_TMP)/$(KB_TOOLS_ARCHIVE_NAME)
90+
GO_TEST_PACKAGES :=./pkg/...
91+
GO_TEST_FLAGS := -race -coverprofile=coverage.out
92+
93+
# download the kubebuilder-tools to get kube-apiserver binaries from it
94+
ensure-kubebuilder-tools:
95+
ifeq "" "$(wildcard $(KUBEBUILDER_ASSETS))"
96+
$(info Downloading kube-apiserver into '$(KUBEBUILDER_ASSETS)')
97+
mkdir -p '$(KUBEBUILDER_ASSETS)'
98+
curl -s -f -L https://storage.googleapis.com/kubebuilder-tools/$(KB_TOOLS_ARCHIVE_NAME) -o '$(KB_TOOLS_ARCHIVE_PATH)'
99+
tar -C '$(KUBEBUILDER_ASSETS)' --strip-components=2 -zvxf '$(KB_TOOLS_ARCHIVE_PATH)'
100+
else
101+
$(info Using existing kube-apiserver from "$(KUBEBUILDER_ASSETS)")
102+
endif
103+
.PHONY: ensure-kubebuilder-tools
104+
105+
clean-integration-test:
106+
$(RM) '$(KB_TOOLS_ARCHIVE_PATH)'
107+
rm -rf $(TEST_TMP)/kubebuilder
108+
$(RM) ./*integration.test
109+
.PHONY: clean-integration-test
110+
111+
clean: clean-integration-test
112+
82113
test-unit:
83-
go test ./...
114+
go test $(GO_TEST_FLAGS) $(GO_TEST_PACKAGES)
84115
.PHONY: test-unit
85116

117+
test-integration: ensure-kubebuilder-tools
118+
go test -c ./test/integration -o ./kueue-integration.test -tags=integration
119+
./kueue-integration.test -ginkgo.slow-spec-threshold=15s -ginkgo.v -ginkgo.fail-fast ${ARGS}
120+
.PHONY: test-integration
121+
86122
test-e2e:
87123
echo "TODO: Implement e2e tests"
88124
.PHONY: test-e2e

kueue-addon/go.mod

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
module open-cluster-management.io/addon-contrib/kueue-addon
22

3-
go 1.23.6
3+
go 1.24.5
44

55
require (
6+
github.com/onsi/ginkgo/v2 v2.23.4
7+
github.com/onsi/gomega v1.37.0
68
github.com/openshift/library-go v0.0.0-20250228164547-bad2d1bf3a37
79
github.com/spf13/cobra v1.9.1
810
github.com/spf13/pflag v1.0.6
@@ -12,12 +14,13 @@ require (
1214
k8s.io/component-base v0.32.4
1315
k8s.io/klog/v2 v2.130.1
1416
k8s.io/utils v0.0.0-20241210054802-24370beab758
15-
open-cluster-management.io/api v0.16.2-0.20250425084048-6c5efe2ab15d
17+
open-cluster-management.io/api v1.0.0
1618
open-cluster-management.io/cluster-permission v0.13.1-0.20250526133535-587622ddceb0
1719
open-cluster-management.io/managed-serviceaccount v0.8.1-0.20250529020500-f25dcf870662
18-
open-cluster-management.io/ocm v0.16.1-0.20250430081522-df87f528d7d7
19-
open-cluster-management.io/sdk-go v0.16.1-0.20250428032116-875454003818
20-
sigs.k8s.io/kueue v0.9.1
20+
open-cluster-management.io/ocm v1.0.0
21+
open-cluster-management.io/sdk-go v1.0.0
22+
sigs.k8s.io/controller-runtime v0.20.3
23+
sigs.k8s.io/kueue v0.11.8
2124
)
2225

2326
require (
@@ -34,6 +37,7 @@ require (
3437
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
3538
github.com/emicklei/go-restful/v3 v3.12.2 // indirect
3639
github.com/evanphx/json-patch v5.9.11+incompatible // indirect
40+
github.com/evanphx/json-patch/v5 v5.9.11 // indirect
3741
github.com/felixge/fgprof v0.9.4 // indirect
3842
github.com/felixge/httpsnoop v1.0.4 // indirect
3943
github.com/fsnotify/fsnotify v1.8.0 // indirect
@@ -43,6 +47,7 @@ require (
4347
github.com/go-openapi/jsonpointer v0.21.1 // indirect
4448
github.com/go-openapi/jsonreference v0.21.0 // indirect
4549
github.com/go-openapi/swag v0.23.1 // indirect
50+
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
4651
github.com/gogo/protobuf v1.3.2 // indirect
4752
github.com/golang/protobuf v1.5.4 // indirect
4853
github.com/google/btree v1.1.3 // indirect
@@ -87,17 +92,19 @@ require (
8792
go.opentelemetry.io/otel/sdk v1.33.0 // indirect
8893
go.opentelemetry.io/otel/trace v1.35.0 // indirect
8994
go.opentelemetry.io/proto/otlp v1.4.0 // indirect
95+
go.uber.org/automaxprocs v1.6.0 // indirect
9096
go.uber.org/multierr v1.11.0 // indirect
9197
go.uber.org/zap v1.27.0 // indirect
92-
golang.org/x/crypto v0.36.0 // indirect
98+
golang.org/x/crypto v0.37.0 // indirect
9399
golang.org/x/exp v0.0.0-20250305212735-054e65f0b394 // indirect
94-
golang.org/x/net v0.37.0 // indirect
100+
golang.org/x/net v0.38.0 // indirect
95101
golang.org/x/oauth2 v0.28.0 // indirect
96-
golang.org/x/sync v0.12.0 // indirect
102+
golang.org/x/sync v0.13.0 // indirect
97103
golang.org/x/sys v0.32.0 // indirect
98-
golang.org/x/term v0.30.0 // indirect
99-
golang.org/x/text v0.23.0 // indirect
104+
golang.org/x/term v0.31.0 // indirect
105+
golang.org/x/text v0.24.0 // indirect
100106
golang.org/x/time v0.11.0 // indirect
107+
golang.org/x/tools v0.31.0 // indirect
101108
google.golang.org/genproto/googleapis/api v0.0.0-20241219192143-6b3ec007d9bb // indirect
102109
google.golang.org/genproto/googleapis/rpc v0.0.0-20241219192143-6b3ec007d9bb // indirect
103110
google.golang.org/grpc v1.69.2 // indirect
@@ -106,13 +113,12 @@ require (
106113
gopkg.in/inf.v0 v0.9.1 // indirect
107114
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
108115
gopkg.in/yaml.v3 v3.0.1 // indirect
109-
k8s.io/apiextensions-apiserver v0.32.2 // indirect
116+
k8s.io/apiextensions-apiserver v0.32.3 // indirect
110117
k8s.io/apiserver v0.32.4 // indirect
111118
k8s.io/kms v0.32.4 // indirect
112119
k8s.io/kube-aggregator v0.32.1 // indirect
113-
k8s.io/kube-openapi v0.0.0-20250304201544-e5f78fe3ede9 // indirect
120+
k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff // indirect
114121
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.1 // indirect
115-
sigs.k8s.io/controller-runtime v0.20.3 // indirect
116122
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 // indirect
117123
sigs.k8s.io/kube-storage-version-migrator v0.0.6-0.20230721195810-5c8923c5ff96 // indirect
118124
sigs.k8s.io/randfill v1.0.0 // indirect

0 commit comments

Comments
 (0)