Skip to content

Commit a594b6d

Browse files
committed
[FAB-2485] clean up docker-compose within unit tests
https://jira.hyperledger.org/browse/FAB-2485 This patch adds cleanup for docker-compose unit tests to the Makefile. The following changes were made: Makefile: add unit-test-clean target that runs docker-compose down Ensures unit-test-clean is called prior to running unit tests and for the clean target. Change-Id: I7d667993a1c4709cf5313fcafb317d81298e1271 Signed-off-by: Troy Ronda <[email protected]>
1 parent 397f5de commit a594b6d

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

Makefile

+8-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
# - unit-test - runs the go-test based unit tests
2424
# - test-cmd - generates a "go test" string suitable for manual customization
2525
# - behave - runs the behave test
26-
# - behave-deps - ensures pre-requisites are availble for running behave manually
26+
# - behave-deps - ensures pre-requisites are available for running behave manually
2727
# - gotools - installs go tools like golint
2828
# - linter - runs all code checks
2929
# - native - ensures all native binaries are available
@@ -33,6 +33,7 @@
3333
# - protos - generate all protobuf artifacts based on .proto files
3434
# - clean - cleans the build area
3535
# - dist-clean - superset of 'clean' that also removes persistent state
36+
# - unit-test-clean - cleans unit test state (particularly from docker)
3637

3738
PROJECT_NAME = hyperledger/fabric
3839
BASE_VERSION = 1.0.0
@@ -114,7 +115,7 @@ testenv: build/image/testenv/$(DUMMY)
114115

115116
couchdb: build/image/couchdb/$(DUMMY)
116117

117-
unit-test: peer-docker testenv couchdb
118+
unit-test: unit-test-clean peer-docker testenv couchdb
118119
cd unit-test && docker-compose up --abort-on-container-exit --force-recreate && docker-compose down
119120

120121
unit-tests: unit-test
@@ -267,9 +268,13 @@ protos: buildenv
267268
docker-clean: $(patsubst %,%-docker-clean, $(IMAGES))
268269

269270
.PHONY: clean
270-
clean: docker-clean
271+
clean: docker-clean unit-test-clean
271272
-@rm -rf build ||:
272273

273274
.PHONY: dist-clean
274275
dist-clean: clean gotools-clean
275276
-@rm -rf /var/hyperledger/* ||:
277+
278+
.PHONY: unit-test-clean
279+
unit-test-clean:
280+
cd unit-test && docker-compose down

0 commit comments

Comments
 (0)