Skip to content

Commit

Permalink
chore: adapt Makefile command to run unit tests (#2072)
Browse files Browse the repository at this point in the history
Signed-off-by: odubajDT <ondrej.dubaj@dynatrace.com>
  • Loading branch information
odubajDT committed Sep 19, 2023
1 parent a5977ad commit 2db2569
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ jobs:

- name: Unit Test ${{ matrix.config.name }}
working-directory: ./${{ matrix.config.folder }}
run: make test
run: make unit-test

- name: Report code coverage
uses: codecov/codecov-action@v3
Expand Down
4 changes: 2 additions & 2 deletions klt-cert-manager/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ fmt: ## Run go fmt against code.
vet: ## Run go vet against code.
go vet ./...

.PHONY: test
test: manifests generate fmt vet envtest ## Run tests.
.PHONY: unit-test
unit-test: manifests generate fmt vet envtest ## Run tests.
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test ./... -coverprofile cover.out

##@ Build
Expand Down
4 changes: 2 additions & 2 deletions lifecycle-operator/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ fmt: ## Run go fmt against code.
vet: ## Run go vet against code.
go vet ./...

.PHONY: test
test: manifests fmt vet generate envtest ## Run tests.
.PHONY: unit-test
unit-test: manifests fmt vet generate envtest ## Run tests.
go test ./cmd/... -v -coverprofile cover-cmd.out
go test ./apis/... -v -coverprofile cover-apis.out
go test ./controllers/... -v -coverprofile cover-pkg.out
Expand Down
4 changes: 2 additions & 2 deletions metrics-operator/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ fmt: ## Run go fmt against code.
vet: ## Run go vet against code.
go vet ./...

.PHONY: test
test: manifests generate fmt vet envtest ## Run tests.
.PHONY: unit-test
unit-test: manifests generate fmt vet envtest ## Run tests.
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" go test ./... -coverprofile cover.out

##@ Build
Expand Down
5 changes: 2 additions & 3 deletions scheduler/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,10 @@ vet: ## Run go vet against code.
e2e-test: manifests envtest ## Run tests.
go test ./test/e2e -v -coverprofile cover.out

.PHONY: test
test: manifests fmt vet envtest## Run tests.
.PHONY: unit-test
unit-test: manifests fmt vet envtest## Run tests.
go test ./pkg/... -coverprofile cover-pkg.out
go test ./cmd/scheduler -coverprofile cover-main.out
go test ./test/... -v -ginkgo.skip-file="e2e"
sed -i '/mode: set/d' cover-pkg.out
sed -i '/mode: set/d' cover-main.out
echo "mode: set" > cover.out
Expand Down

0 comments on commit 2db2569

Please sign in to comment.