Skip to content

Commit

Permalink
Simpler tests
Browse files Browse the repository at this point in the history
  • Loading branch information
majst01 committed Apr 13, 2023
1 parent 53c9b08 commit 81ba0f8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 31 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:

jobs:
build:
name: Test Build
name: Test and Lint
runs-on: ubuntu-latest

steps:
Expand All @@ -25,6 +25,10 @@ jobs:
with:
go-version: '1.20.x'

- name: Check (lint) and Test
run: |
make test-in-docker
- name: Lint
uses: golangci/golangci-lint-action@v3
with:
args: --build-tags integration -p bugs -p unused --timeout=3m

- name: Test
run: make test
28 changes: 1 addition & 27 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,6 @@ clean:
check-generate:
@$(REPO_ROOT)/vendor/github.com/gardener/gardener/hack/check-generate.sh $(REPO_ROOT)

.PHONY: check
check: $(GOIMPORTS) $(GOLANGCI_LINT) $(HELM)
@$(REPO_ROOT)/vendor/github.com/gardener/gardener/hack/check.sh --golangci-lint-config=./.golangci.yaml ./cmd/... ./pkg/...
@$(REPO_ROOT)/vendor/github.com/gardener/gardener/hack/check-charts.sh ./charts

.PHONY: generate
generate: $(HELM)
@$(REPO_ROOT)/vendor/github.com/gardener/gardener/hack/generate.sh ./charts/... ./cmd/... ./pkg/...
Expand All @@ -101,30 +96,9 @@ generate-in-docker: revendor $(HELM)
# && make install generate \
&& chown -R $(shell id -u):$(shell id -g) ."

.PHONY: format
format: $(GOIMPORTS)
@$(REPO_ROOT)/vendor/github.com/gardener/gardener/hack/format.sh ./cmd ./pkg

.PHONY: test
test:
@$(REPO_ROOT)/vendor/github.com/gardener/gardener/hack/test.sh ./cmd/... ./pkg/...

.PHONY: test-in-docker
test-in-docker: revendor $(HELM)
docker run --rm -i$(DOCKER_TTY_ARG) -v $(PWD):/go/src/github.com/fi-ts/gardener-extension-authn golang:1.19.4 \
sh -c "cd /go/src/github.com/fi-ts/gardener-extension-authn \
&& make install check # add back test target as soon as there are test files"

.PHONY: test-cov
test-cov:
@$(REPO_ROOT)/vendor/github.com/gardener/gardener/hack/test-cover.sh ./cmd/... ./pkg/...

.PHONY: test-clean
test-clean:
@$(REPO_ROOT)/vendor/github.com/gardener/gardener/hack/test-cover-clean.sh

.PHONY: verify
verify: check format test
go test -v ./...

.PHONY: push-to-gardener-local
push-to-gardener-local:
Expand Down

0 comments on commit 81ba0f8

Please sign in to comment.