From 5b8c306c6a7f90db6fe7880326083f4735df3a89 Mon Sep 17 00:00:00 2001 From: Xu Ning Date: Wed, 19 Apr 2017 10:25:43 -0700 Subject: [PATCH] Speed up test --- .travis.yml | 2 +- Makefile | 15 ++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index dde731ce..4573b64f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -70,7 +70,7 @@ install: - export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:`pwd`" script: - - EMBEDROCKSDB=0 make cover_ci + - EMBEDROCKSDB=0 make -j2 cover_ci after_success: - export BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo $TRAVIS_PULL_REQUEST_BRANCH; fi) diff --git a/Makefile b/Makefile index 086c32e3..a265fc2c 100644 --- a/Makefile +++ b/Makefile @@ -101,19 +101,20 @@ cherami-store-tool: $(DEPS) bins: cherami-server cherami-replicator-server cherami-cli cherami-admin cherami-replicator-tool cherami-cassandra-tool cherami-store-tool cover_profile: lint bins - @echo Running tests: @mkdir -p $(BUILD) @echo "mode: atomic" > $(BUILD)/cover.out - @for dir in $(PKG_TEST_DIRS); do \ + + @echo Running integration tests: + @time for dir in $(INTEG_TEST_DIRS); do \ mkdir -p $(BUILD)/"$$dir"; \ - go test $(EMBED) "$$dir" $(TEST_ARG) -coverprofile=$(BUILD)/"$$dir"/coverage.out || exit 1; \ + go test $(EMBED) "$$dir" $(TEST_ARG) $(GOCOVERPKG_ARG) -coverprofile=$(BUILD)/"$$dir"/coverage.out || exit 1; \ cat $(BUILD)/"$$dir"/coverage.out | grep -v "mode: atomic" >> $(BUILD)/cover.out; \ done - - @echo Running integration tests: - @for dir in $(INTEG_TEST_DIRS); do \ + + @echo Running tests: + @time for dir in $(PKG_TEST_DIRS); do \ mkdir -p $(BUILD)/"$$dir"; \ - go test $(EMBED) "$$dir" $(TEST_ARG) $(GOCOVERPKG_ARG) -coverprofile=$(BUILD)/"$$dir"/coverage.out || exit 1; \ + go test $(EMBED) "$$dir" $(TEST_ARG) -coverprofile=$(BUILD)/"$$dir"/coverage.out || exit 1; \ cat $(BUILD)/"$$dir"/coverage.out | grep -v "mode: atomic" >> $(BUILD)/cover.out; \ done