Skip to content

Commit

Permalink
Tests cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: Adrian Orive <[email protected]>
  • Loading branch information
Adirio committed Jan 8, 2021
1 parent 26d7b42 commit c652c1e
Show file tree
Hide file tree
Showing 12 changed files with 393 additions and 452 deletions.
44 changes: 26 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env bash

# Copyright 2019 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -61,7 +60,7 @@ generate: generate-testdata ## Update/generate all mock data. You should run thi

.PHONY: generate-testdata
generate-testdata: ## Update/generate the testdata in $GOPATH/src/sigs.k8s.io/kubebuilder
./generate_testdata.sh
./test/testdata/generate.sh

.PHONY: lint
lint: golangci-lint ## Run golangci-lint linter
Expand All @@ -80,26 +79,35 @@ golangci-lint:

##@ Tests

.PHONY: go-test
go-test: ## Run the unit test
go test -race -v ./cmd/... ./pkg/... ./plugins/...

.PHONY: test
test: ## Run the unit tests (used in the CI)
./test.sh
test: test-unit test-integration test-testdata ## Run the unit and integration tests (used in the CI)

.PHONY: test-unit
test-unit: ## Run the unit tests
go test -race -v ./pkg/...

.PHONY: test-coverage
test-coverage: ## Run coveralls
# remove all coverage files if exists
- rm -rf *.out
# run the go tests and gen the file coverage-all used to do the integration with coverrals.io
go test -race -failfast -tags=integration -coverprofile=coverage-all.out ./cmd/... ./pkg/... ./plugins/...
test-coverage: ## Run unit tests creating the output to report coverage
- rm -rf *.out # Remove all coverage files if exists
go test -race -failfast -tags=integration -coverprofile=coverage-all.out ./pkg/...

.PHONY: test-e2e-local
test-e2e-local: ## It will run the script to install kind and run e2e tests
## To keep the same kind cluster between test runs, use `SKIP_KIND_CLEANUP=1 make test-e2e-local`
./test_e2e_local.sh
.PHONY: test-integration
test-integration: ## Run the integration tests
./test/integration.sh

.PHONY: check-testdata
check-testdata: ## Run the script to ensure that the testdata is updated
./check_testdata.sh
./test/testdata/check.sh

.PHONY: test-testdata
test-testdata: ## Run the tests of the testdata directory
./test/testdata/test.sh

.PHONY: test-e2e-local
test-e2e-local: ## Run the end-to-end tests locally
## To keep the same kind cluster between test runs, use `SKIP_KIND_CLEANUP=1 make test-e2e-local`
./test/e2e/local.sh

.PHONY: test-e2e-ci
test-e2e-ci: ## Run the end-to-end tests (used in the CI)`
./test/e2e/ci.sh
204 changes: 0 additions & 204 deletions common.sh

This file was deleted.

Loading

0 comments on commit c652c1e

Please sign in to comment.