Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
RUN_NAMESPACE = metal3
GO_TEST_FLAGS = $(VERBOSE)
GO_TEST_FLAGS = $(TEST_FLAGS)
DEBUG = --debug
COVER_PROFILE = cover.out

Expand Down Expand Up @@ -63,7 +63,7 @@ test: generate lint manifests unit ## Run common developer tests

.PHONY: unit
unit: ## Run unit tests
go test ./... $(VERBOSE) -coverprofile $(COVER_PROFILE)
go test ./... $(GO_TEST_FLAGS) -coverprofile $(COVER_PROFILE)

.PHONY: unit-cover
unit-cover: ## Run unit tests with code coverage
Expand All @@ -72,7 +72,7 @@ unit-cover: ## Run unit tests with code coverage

.PHONY: unit-verbose
unit-verbose: ## Run unit tests with verbose output
VERBOSE=-v make unit
TEST_FLAGS=-v make unit

## --------------------------------------
## Linter Targets
Expand Down
5 changes: 3 additions & 2 deletions hack/unit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,21 @@ set -eux
IS_CONTAINER=${IS_CONTAINER:-false}
ARTIFACTS=${ARTIFACTS:-/tmp}
CONTAINER_RUNTIME="${CONTAINER_RUNTIME:-podman}"
TEST_FLAGS="${TEST_FLAGS:--v}"

if [ "${IS_CONTAINER}" != "false" ]; then
eval "$(go env)"
cd "${GOPATH}"/src/github.com/metal3-io/baremetal-operator
export XDG_CACHE_HOME="/tmp/.cache"

export VERBOSE=-v
export COVER_PROFILE="${ARTIFACTS}"/cover.out

make -e unit-cover
TEST_FLAGS=${TEST_FLAGS} make -e unit-cover

else
"${CONTAINER_RUNTIME}" run --rm \
--env IS_CONTAINER=TRUE \
--env TEST_FLAGS="${TEST_FLAGS}" \
--env DEPLOY_KERNEL_URL=http://172.22.0.1/images/ironic-python-agent.kernel \
--env DEPLOY_RAMDISK_URL=http://172.22.0.1/images/ironic-python-agent.initramfs \
--env IRONIC_ENDPOINT=http://localhost:6385/v1/ \
Expand Down