From 2d92714b6ecee8f555243c5e01df2b351cae5cd1 Mon Sep 17 00:00:00 2001 From: Rudy Zhang Date: Thu, 14 Mar 2019 15:03:09 +0800 Subject: [PATCH] test: make test run faster build integration test binary to run test. Signed-off-by: Rudy Zhang --- Makefile | 8 +++++++- hack/testing/run_daemon_integration.sh | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 8439a442c..98af7cf89 100644 --- a/Makefile +++ b/Makefile @@ -212,6 +212,12 @@ build-daemon-integration: modules plugin ## build PouchContainer daemon integrat -cover -covermode=atomic -coverpkg ${COVERAGE_PACKAGES_LIST} \ -o bin/${DAEMON_INTEGRATION_BINARY_NAME} +build-integration-test: modules plugin ## build PouchContainer integration test-case binary + @echo $@ + @mkdir -p bin + go test -c \ + -o bin/${INTEGRATION_TESTCASE_BINARY_NAME} github.com/alibaba/pouch/test + modules: ## run modules to generate volume related code @echo "build volume $@" @./hack/module --clean @@ -281,7 +287,7 @@ unit-test: modules plugin ## run go unit-test done ) .PHONY: integration-test -integration-test: build-daemon-integration ## run daemon integration-test +integration-test: build-daemon-integration build-integration-test ## run daemon integration-test @echo $@ @mkdir -p coverage ./hack/testing/run_daemon_integration.sh ${INTEGRATION_FLAGS} diff --git a/hack/testing/run_daemon_integration.sh b/hack/testing/run_daemon_integration.sh index 2dac9406f..7d0a9125f 100755 --- a/hack/testing/run_daemon_integration.sh +++ b/hack/testing/run_daemon_integration.sh @@ -33,7 +33,7 @@ integration::run_daemon_test_cases() { local testcases testcases=$(cat "${REPO_BASE}/test/testcase.list.${job_id}") for one in ${testcases}; do - go test -check.v -check.f "${one}" + "${REPO_BASE}/bin/pouchd-integration-test" -test.v -check.v -check.f "${one}" ret=$? if [[ ${ret} -ne 0 ]]; then code=${ret}