Skip to content

Commit 8e5707d

Browse files
committed
unit-tests: allow running individual tests
1 parent ad4d0c7 commit 8e5707d

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,11 @@ install:
8686
# go install -v
8787
@out=`mktemp`; if ! go install -v > $$out 2>&1; then cat $$out; rm -f $$out; echo "\nBuild failed\n"; exit 1; else rm -f $$out; fi
8888

89-
test: prepare swagger etcd-install ## Run unit tests
89+
test: prepare swagger etcd-install ## Run unit tests (add TEST=regex to specify which tests to run)
9090
@echo "\e[33m\e[1mStarting etcd ...\e[0m"
9191
@mkdir -p /tmp/aptly-etcd-data; system/t13_etcd/start-etcd.sh > /tmp/aptly-etcd-data/etcd.log 2>&1 &
9292
@echo "\e[33m\e[1mRunning go test ...\e[0m"
93-
go test -v ./... -gocheck.v=true -coverprofile=unit.out; echo $$? > .unit-test.ret
93+
go test -v ./... -gocheck.v=true -check.f "$(TEST)" -coverprofile=unit.out; echo $$? > .unit-test.ret
9494
@echo "\e[33m\e[1mStopping etcd ...\e[0m"
9595
@pid=`cat /tmp/etcd.pid`; kill $$pid
9696
@rm -f /tmp/aptly-etcd-data/etcd.log
@@ -176,13 +176,13 @@ docker-shell: ## Run aptly and other commands in docker container
176176
docker-deb: ## Build debian packages in docker container
177177
@docker run -it --rm -v ${PWD}:/work/src aptly-dev /work/src/system/docker-wrapper dpkg DEBARCH=amd64
178178

179-
docker-unit-test: ## Run unit tests in docker container
179+
docker-unit-test: ## Run unit tests in docker container (add TEST=regex to specify which tests to run)
180180
@docker run -it --rm -v ${PWD}:/work/src aptly-dev /work/src/system/docker-wrapper \
181181
azurite-start \
182182
AZURE_STORAGE_ENDPOINT=http://127.0.0.1:10000/devstoreaccount1 \
183183
AZURE_STORAGE_ACCOUNT=devstoreaccount1 \
184184
AZURE_STORAGE_ACCESS_KEY="Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==" \
185-
test \
185+
test TEST=$(TEST) \
186186
azurite-stop
187187

188188
docker-system-test: ## Run system tests in docker container (add TEST=t04_mirror or TEST=UpdateMirror26Test to run only specific tests)

0 commit comments

Comments
 (0)