Skip to content

Commit

Permalink
Merge pull request kata-containers#1257 from chavafg/topic/parallel-d…
Browse files Browse the repository at this point in the history
…ocker

docker: Run tests in parallel
  • Loading branch information
grahamwhaley authored Mar 6, 2019
2 parents 87739c1 + a59331a commit 662b7a2
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
20 changes: 19 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ ARCH_DIR = arch
ARCH_FILE_SUFFIX = -options.mk
ARCH_FILE = $(ARCH_DIR)/$(ARCH)$(ARCH_FILE_SUFFIX)

# Number of processor units available
NPROCS := $(shell grep -c ^processor /proc/cpuinfo)
# Number of `go test` processes that ginkgo will spawn.
GINKGO_NODES := $(shell echo $(NPROCS)\-2 | bc)

# Load architecture-dependent settings
ifneq ($(wildcard $(ARCH_FILE)),)
include $(ARCH_FILE)
Expand All @@ -49,8 +54,21 @@ endif
docker: ginkgo
ifeq ($(RUNTIME),)
$(error RUNTIME is not set)
endif

ifeq ($(KATA_HYPERVISOR),firecracker)
./ginkgo -v -focus "${FOCUS}" -skip "${SKIP}" \
./integration/docker/ -- -runtime=${RUNTIME} -timeout=${TIMEOUT}
else ifeq ($(ARCH),aarch64)
./ginkgo -v -focus "${FOCUS}" -skip "${SKIP}" \
./integration/docker/ -- -runtime=${RUNTIME} -timeout=${TIMEOUT}
else
./ginkgo -v -focus "${FOCUS}" -skip "${SKIP}" ./integration/docker/ -- -runtime=${RUNTIME} -timeout=${TIMEOUT}
# Run tests in parallel, skip tests that need to be run serialized
./ginkgo -nodes=${GINKGO_NODES} -v -focus "${FOCUS}" -skip "${SKIP}" -skip "\[Serial Test\]" \
./integration/docker/ -- -runtime=${RUNTIME} -timeout=${TIMEOUT}
# Now run serialized tests
./ginkgo -v -focus "${FOCUS}" -focus "\[Serial Test\]" -skip "${SKIP}" \
./integration/docker/ -- -runtime=${RUNTIME} -timeout=${TIMEOUT}
bash sanity/check_sanity.sh
endif

Expand Down
4 changes: 2 additions & 2 deletions integration/docker/cp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ var _ = Describe("docker cp", func() {
})
})

var _ = Describe("docker cp with volume attached", func() {
var _ = Describe("[Serial Test] docker cp with volume attached", func() {
var (
id string
exitCode int
Expand Down Expand Up @@ -102,7 +102,7 @@ var _ = Describe("docker cp with volume attached", func() {
})
})

var _ = Describe("docker cp with volume", func() {
var _ = Describe("[Serial Test] docker cp with volume", func() {
var (
id string
exitCode int
Expand Down
2 changes: 1 addition & 1 deletion integration/docker/volume_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
. "github.com/onsi/gomega"
)

var _ = Describe("docker volume", func() {
var _ = Describe("[Serial Test] docker volume", func() {
var (
args []string
id string = randomDockerName()
Expand Down

0 comments on commit 662b7a2

Please sign in to comment.