Skip to content

Commit

Permalink
Merge branch 'master' into eventhub-vnet
Browse files Browse the repository at this point in the history
  • Loading branch information
jananivMS authored Mar 27, 2020
2 parents 44e8cce + e7bf15f commit bd241b1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ BUILD_ID ?= $(shell git rev-parse --short HEAD)
# best to keep the prefix as short as possible to not exceed naming limits for things like keyvault (24 chars)
TEST_RESOURCE_PREFIX ?= aso-$(BUILD_ID)

# Some parts of the test suite use Go Build Tags to ignore certain tests. Default to all tests but allow the user to pass custom tags.
BUILD_TAGS ?= all

all: manager

# Generate test certs for development
Expand All @@ -40,7 +43,7 @@ api-test: generate fmt vet manifests
# Run tests
test: generate fmt vet manifests
TEST_USE_EXISTING_CLUSTER=false TEST_CONTROLLER_WITH_MOCKS=true REQUEUE_AFTER=20 \
go test -tags all -parallel 3 -v -coverprofile=coverage.txt -covermode count \
go test -tags "$(BUILD_TAGS)" -parallel 3 -v -coverprofile=coverage.txt -covermode count \
./api/... \
./controllers/... \
-timeout 10m 2>&1 | tee testlogs.txt
Expand All @@ -49,7 +52,7 @@ test: generate fmt vet manifests

# Run tests with existing cluster
test-existing-controllers: generate fmt vet manifests
TEST_RESOURCE_PREFIX=$(TEST_RESOURCE_PREFIX) TEST_USE_EXISTING_CLUSTER=true REQUEUE_AFTER=20 go test -tags all -parallel 4 -v ./controllers/... -timeout 45m
TEST_RESOURCE_PREFIX=$(TEST_RESOURCE_PREFIX) TEST_USE_EXISTING_CLUSTER=true REQUEUE_AFTER=20 go test -tags "$(BUILD_TAGS)" -parallel 4 -v ./controllers/... -timeout 45m

unit-tests:
go test ./pkg/resourcemanager/keyvaults/unittest/
Expand Down
4 changes: 2 additions & 2 deletions docs/test.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ Testing the full project can be done in two ways:
- `make api-test` - Runs the Kubernetes API tests against the CRDs
- `make test` - Test against the Kubernetes integration testing framework.
- `make test-existing-managers` - Test the resource managers against an existing cluster. This is currently the easiest way to run tests against a kind cluster setup.
- `make test-existing-controllers` - Test the controllers against an existing cluster. By default this will run every controller test, but you can edit the `tags` parameter in the makefile to specify individual test suites. Each controller test file declares its tags in the `// +build` comment at the top of the file.

- `make test-existing-controllers` - Test the controllers against an existing cluster.

Some test suites (primarily the controller suite) have included Go Build Tags to allow selectively running tests. Users can specify individual test suites by setting the `BUILD_TAGS` parameter as an environment variable or before the make target: `make BUILD_TAGS=azuresqlservercombined test-existing-controllers`. Test files declare their tags in the `// +build` comment at the top of the file.

0 comments on commit bd241b1

Please sign in to comment.