Skip to content

Commit

Permalink
[test/integration] Add provisioning ACC tests
Browse files Browse the repository at this point in the history
  • Loading branch information
trasc committed Oct 5, 2023
1 parent 11e8246 commit 65f3ad4
Show file tree
Hide file tree
Showing 5 changed files with 528 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ test: generate gotestsum ## Run tests.
$(GOTESTSUM) --junitfile $(ARTIFACTS)/junit.xml -- $(GO_TEST_FLAGS) $(shell $(GO_CMD) list ./... | grep -v '/test/') -coverpkg=./... -coverprofile $(ARTIFACTS)/cover.out

.PHONY: test-integration
test-integration: manifests generate envtest ginkgo mpi-operator-crd ray-operator-crd jobset-operator-crd kf-training-operator-crd ## Run tests.
test-integration: manifests generate envtest ginkgo mpi-operator-crd ray-operator-crd jobset-operator-crd kf-training-operator-crd cluster-autoscaler-crd ## Run tests.
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" \
$(GINKGO) $(GINKGO_ARGS) --junit-report=junit.xml --output-dir=$(ARTIFACTS) -v $(INTEGRATION_TARGET)

Expand Down Expand Up @@ -337,3 +337,10 @@ JOBSETROOT = $(shell $(GO_CMD) list -m -f "{{.Dir}}" sigs.k8s.io/jobset)
jobset-operator-crd:
mkdir -p $(PROJECT_DIR)/dep-crds/jobset-operator/
cp -f $(JOBSETROOT)/config/components/crd/bases/* $(PROJECT_DIR)/dep-crds/jobset-operator/


CAROOT = $(shell $(GO_CMD) list -m -f "{{.Dir}}" k8s.io/autoscaler/cluster-autoscaler)
.PHONY: cluster-autoscaler-crd
cluster-autoscaler-crd:
mkdir -p $(PROJECT_DIR)/dep-crds/cluster-autoscaler/
cp -f $(CAROOT)/config/crd/* $(PROJECT_DIR)/dep-crds/cluster-autoscaler/
19 changes: 19 additions & 0 deletions pkg/util/testing/wrappers.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,11 @@ func (p *PodSetWrapper) Request(r corev1.ResourceName, q string) *PodSetWrapper
return p
}

func (p *PodSetWrapper) Iamage(image string) *PodSetWrapper {
p.Template.Spec.Containers[0].Image = image
return p
}

func (p *PodSetWrapper) SetMinimumCount(mc int32) *PodSetWrapper {
p.MinCount = &mc
return p
Expand Down Expand Up @@ -578,6 +583,20 @@ func MakeAdmissionCheck(name string) *AdmissionCheckWrapper {
}
}

func (ac *AdmissionCheckWrapper) ControllerName(c string) *AdmissionCheckWrapper {
ac.Spec.ControllerName = c
return ac
}

func (ac *AdmissionCheckWrapper) Parameters(apigroup, kind, name string) *AdmissionCheckWrapper {
ac.Spec.Parameters = &kueue.AdmissionCheckParametersReference{
APIGroup: apigroup,
Kind: kind,
Name: name,
}
return ac
}

func (ac *AdmissionCheckWrapper) Obj() *kueue.AdmissionCheck {
return &ac.AdmissionCheck
}
Expand Down

0 comments on commit 65f3ad4

Please sign in to comment.