Skip to content

Commit

Permalink
Makefile: Add Makefile targets to run e2e/integration tests in Docker
Browse files Browse the repository at this point in the history
  • Loading branch information
Chance Zibolski committed Mar 13, 2019
1 parent 3b869bd commit 683ffcb
Showing 1 changed file with 41 additions and 3 deletions.
44 changes: 41 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,10 @@ metering-src-docker-build: Dockerfile.src
metering-operator-docker-build: $(METERING_OPERATOR_DOCKERFILE)
$(MAKE) docker-build DOCKERFILE=$< IMAGE_NAME=$(METERING_OPERATOR_IMAGE_REPO) DOCKER_BUILD_CONTEXT=$(ROOT_DIR)

# Runs gofmt on all files in project except vendored source and Hive Thrift definitions
fmt:
find . -name '*.go' -not -path "./vendor/*" -not -path "./pkg/hive/hive_thrift/*" | xargs gofmt -w

# Update dependencies
vendor: Gopkg.toml
dep ensure -v
Expand All @@ -266,12 +270,46 @@ unit-docker: metering-src-docker-build
integration:
hack/integration.sh

integration-docker: metering-src-docker-build
docker run \
--name metering-integration-docker \
-t \
-e METERING_NAMESPACE \
-e METERING_OPERATOR_DEPLOY_REPO -e METERING_OPERATOR_DEPLOY_TAG \
-e REPORTING_OPERATOR_DEPLOY_REPO -e REPORTING_OPERATOR_DEPLOY_TAG \
-e KUBECONFIG=/kubeconfig \
-e TEST_OUTPUT_PATH=/out \
-w /go/src/github.com/operator-framework/operator-metering \
-v $(KUBECONFIG):/kubeconfig \
-v $(PWD):/go/src/github.com/operator-framework/operator-metering \
-v /out \
$(METERING_SRC_IMAGE_REPO):$(IMAGE_TAG) \
make integration
rm -rf bin/integration-docker-test-output
docker cp metering-integration-docker:/out bin/integration-docker-test-output
docker rm metering-integration-docker

e2e:
hack/e2e.sh

# Runs gofmt on all files in project except vendored source and Hive Thrift definitions
fmt:
find . -name '*.go' -not -path "./vendor/*" -not -path "./pkg/hive/hive_thrift/*" | xargs gofmt -w
e2e-docker: metering-src-docker-build
docker run \
--name metering-e2e-docker \
-t \
-e METERING_NAMESPACE \
-e METERING_OPERATOR_DEPLOY_REPO -e METERING_OPERATOR_DEPLOY_TAG \
-e REPORTING_OPERATOR_DEPLOY_REPO -e REPORTING_OPERATOR_DEPLOY_TAG \
-e KUBECONFIG=/kubeconfig \
-e TEST_OUTPUT_PATH=/out \
-w /go/src/github.com/operator-framework/operator-metering \
-v $(KUBECONFIG):/kubeconfig \
-v $(PWD):/go/src/github.com/operator-framework/operator-metering \
-v /out \
$(METERING_SRC_IMAGE_REPO):$(IMAGE_TAG) \
make e2e
rm -rf bin/e2e-docker-test-output
docker cp metering-e2e-docker:/out bin/e2e-docker-test-output
docker rm metering-e2e-docker

# validates no unstaged changes exist in $(VERIFY_FILE_PATHS)
verify: verify-codegen all-charts metering-manifests fmt
Expand Down

0 comments on commit 683ffcb

Please sign in to comment.