зеркало из https://github.com/microsoft/docker.git
Merge pull request #5477 from vmarmol/add-testdirs
Add a TESTDIRS variable to the test bundle to control which directories are unit tested
This commit is contained in:
Коммит
a96cac4d7d
2
Makefile
2
Makefile
|
@ -10,7 +10,7 @@ DOCKER_IMAGE := docker$(if $(GIT_BRANCH),:$(GIT_BRANCH))
|
||||||
DOCKER_DOCS_IMAGE := docker-docs$(if $(GIT_BRANCH),:$(GIT_BRANCH))
|
DOCKER_DOCS_IMAGE := docker-docs$(if $(GIT_BRANCH),:$(GIT_BRANCH))
|
||||||
DOCKER_MOUNT := $(if $(BINDDIR),-v "$(CURDIR)/$(BINDDIR):/go/src/github.com/dotcloud/docker/$(BINDDIR)")
|
DOCKER_MOUNT := $(if $(BINDDIR),-v "$(CURDIR)/$(BINDDIR):/go/src/github.com/dotcloud/docker/$(BINDDIR)")
|
||||||
|
|
||||||
DOCKER_RUN_DOCKER := docker run --rm -it --privileged -e TESTFLAGS -e DOCKER_GRAPHDRIVER -e DOCKER_EXECDRIVER $(DOCKER_MOUNT) "$(DOCKER_IMAGE)"
|
DOCKER_RUN_DOCKER := docker run --rm -it --privileged -e TESTFLAGS -e TESTDIRS -e DOCKER_GRAPHDRIVER -e DOCKER_EXECDRIVER $(DOCKER_MOUNT) "$(DOCKER_IMAGE)"
|
||||||
# to allow `make DOCSDIR=docs docs-shell`
|
# to allow `make DOCSDIR=docs docs-shell`
|
||||||
DOCKER_RUN_DOCS := docker run --rm -it $(if $(DOCSDIR),-v $(CURDIR)/$(DOCSDIR):/$(DOCSDIR)) -e AWS_S3_BUCKET
|
DOCKER_RUN_DOCS := docker run --rm -it $(if $(DOCSDIR),-v $(CURDIR)/$(DOCSDIR):/$(DOCSDIR)) -e AWS_S3_BUCKET
|
||||||
|
|
||||||
|
|
|
@ -17,8 +17,13 @@ bundle_test() {
|
||||||
{
|
{
|
||||||
date
|
date
|
||||||
|
|
||||||
|
# Run all the tests if no TESTDIRS were specified.
|
||||||
|
if [ -z "$TESTDIRS" ]; then
|
||||||
|
TESTDIRS=$(find_dirs '*_test.go')
|
||||||
|
fi
|
||||||
|
|
||||||
TESTS_FAILED=()
|
TESTS_FAILED=()
|
||||||
for test_dir in $(find_dirs '*_test.go'); do
|
for test_dir in $TESTDIRS; do
|
||||||
echo
|
echo
|
||||||
|
|
||||||
if ! LDFLAGS="$LDFLAGS $LDFLAGS_STATIC_DOCKER" go_test_dir "$test_dir"; then
|
if ! LDFLAGS="$LDFLAGS $LDFLAGS_STATIC_DOCKER" go_test_dir "$test_dir"; then
|
||||||
|
|
Загрузка…
Ссылка в новой задаче