service package unit tests do not compile on master
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
Research direction
Start with the four reported test locations: service/access_control_service_test.go, service/namespace_service_test.go, service/project_service_test.go, and service/worker_slice_gateway_service_test.go. Update the three obsolete client references and the ObjectMeta literal as proposed, then run go test -c -o /dev/null ./service/ to verify that the service tests compile.
Written by the indexing model from the issue text.
Description
📜 Description
The service package's tests do not compile on master, so any run of them fails before a single test executes. Four references in test files point at symbols that no longer exist after dependency upgrades.
👟 Reproduction steps
git checkout master
go test -c -o /dev/null ./service/
make unit-test and docker build -f unit_tests.dockerfile . hit the same failure. go vet ./service/... reports only the first error, since vet stops at one error per package.
👍 Expected behavior
The service unit tests compile and run.
👎 Actual Behavior
The test binary fails to build. All four errors:
service/access_control_service_test.go:1273:61: undefined: util.Client
service/namespace_service_test.go:180:67: undefined: util.Client
service/project_service_test.go:279:65: undefined: util.Client
service/worker_slice_gateway_service_test.go:554:4: unknown field ClusterName in struct literal of type "k8s.io/apimachinery/pkg/apis/meta/v1".ObjectMeta
Both look like dependency drift that only touched test files, which is why the non-test build is unaffected:
util.Clientno longer exists;utilusesclient.Clientfrom controller-runtime.ObjectMeta.ClusterNamewas removed from apimachinery in Kubernetes 1.25, and this repo is on the 1.32 client libraries.
CI does exercise this package — unit_tests.dockerfile runs go test against /build/service — but cannot report the failure, for reasons already tracked in #336 (; exit 0 masks the exit code) and #330 (the image is Go 1.19 while the module requires 1.24). This issue is the underlying compile break those two would surface once fixed.
🐚 Relevant log output
$ go test -c -o /dev/null ./service/
# github.com/kubeslice/kubeslice-controller/service [github.com/kubeslice/kubeslice-controller/service.test]
service/access_control_service_test.go:1273:61: undefined: util.Client
service/namespace_service_test.go:180:67: undefined: util.Client
service/project_service_test.go:279:65: undefined: util.Client
service/worker_slice_gateway_service_test.go:554:4: unknown field ClusterName in struct literal of type "k8s.io/apimachinery/pkg/apis/meta/v1".ObjectMeta
Version
master at 4137061e
🖥️ What operating system are you seeing the problem on?
Linux
✅ Proposed Solution
Change the three util.Client parameters to client.Client and drop the ClusterName field from the ObjectMeta literal. Happy to raise a PR if that approach is agreeable.
Fixing this alongside #336 and #330 would make the failure visible in CI rather than silent.
- Dominant language
- Go
- Stars
- 73
- Forks
- 48
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 8
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from kubeslice/kubeslice-controller
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
-
Difficulty 1/5 Under an hour Newbie friendliness 86/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
kubeslice/kubeslice-controller#355 · 1 comment ·
All issues in kubeslice/kubeslice-controller
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 84/100
-
enhancement needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
kind/cleanup
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
kubernetes-sigs/kueue#15947 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
sympozium-ai/sympozium#627 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100