Skip to content

Commit

Permalink
Add makefile commands for unit testing (#395)
Browse files Browse the repository at this point in the history
  • Loading branch information
skmcgrail authored Oct 22, 2022
1 parent a308d23 commit ef69929
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ REPOTOOLS_CMD_CHANGELOG = ${REPOTOOLS_MODULE}/cmd/changelog@${REPOTOOLS_VERSION}
REPOTOOLS_CMD_TAG_RELEASE = ${REPOTOOLS_MODULE}/cmd/tagrelease@${REPOTOOLS_VERSION}
REPOTOOLS_CMD_MODULE_VERSION = ${REPOTOOLS_MODULE}/cmd/moduleversion@${REPOTOOLS_VERSION}

UNIT_TEST_TAGS=
BUILD_TAGS=

ifneq ($(PRE_RELEASE_VERSION),)
REPOTOOLS_CMD_CALCULATE_RELEASE_ADDITIONAL_ARGS += -preview=${PRE_RELEASE_VERSION}
endif
Expand All @@ -27,6 +30,37 @@ smithy-build:
smithy-clean:
cd codegen && ./gradlew clean

##################
# Linting/Verify #
##################
.PHONY: verify vet

verify: vet

vet:
go vet ${BUILD_TAGS} --all ./...

################
# Unit Testing #
################
.PHONY: unit unit-race unit-test unit-race-test

unit: verify
go vet ${BUILD_TAGS} --all ./... && \
go test ${BUILD_TAGS} ${RUN_NONE} ./... && \
go test -timeout=1m ${UNIT_TEST_TAGS} ./...

unit-race: verify
go vet ${BUILD_TAGS} --all ./... && \
go test ${BUILD_TAGS} ${RUN_NONE} ./... && \
go test -timeout=1m ${UNIT_TEST_TAGS} -race -cpu=4 ./...

unit-test: verify
go test -timeout=1m ${UNIT_TEST_TAGS} ./...

unit-race-test: verify
go test -timeout=1m ${UNIT_TEST_TAGS} -race -cpu=4 ./...

#####################
# Release Process #
#####################
Expand Down

0 comments on commit ef69929

Please sign in to comment.