From 15940c93199dc8bfaf87cf3ea44a09c18abe64be Mon Sep 17 00:00:00 2001 From: Lantao Liu Date: Fri, 5 Jan 2018 07:07:55 +0000 Subject: [PATCH] Add travis integration test for plugin mode. Signed-off-by: Lantao Liu --- .travis.yml | 11 +++++++++++ Makefile | 10 ++++++++++ 2 files changed, 21 insertions(+) diff --git a/.travis.yml b/.travis.yml index bcdd794d2..70cadd641 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,11 +32,13 @@ jobs: - make install.tools - make .gitvalidation - make binaries + - make plugin go: 1.9.x - script: - make install.tools - make .gitvalidation - make binaries + - make plugin go: tip - stage: Test script: @@ -51,3 +53,12 @@ jobs: - cat /tmp/test-cri/cri-containerd.log - cat /tmp/test-cri/containerd.log go: 1.9.x + - script: + - make install.deps COOK_CONTAINERD=true + - make test-integration STANDALONE_CRI_CONTAINERD=false + - make test-cri STANDALONE_CRI_CONTAINERD=false + after_script: + # Abuse travis to preserve the log. + - cat /tmp/test-integration/containerd.log + - cat /tmp/test-cri/containerd.log + go: 1.9.x diff --git a/Makefile b/Makefile index 2ee79d3e9..a7cd6d277 100644 --- a/Makefile +++ b/Makefile @@ -30,6 +30,7 @@ TARBALL := $(TARBALL_PREFIX)-$(VERSION).$(GOOS)-$(GOARCH).tar.gz BUILD_TAGS := seccomp apparmor GO_LDFLAGS := -X $(PROJECT)/pkg/version.CRIContainerdVersion=$(VERSION) SOURCES := $(shell find cmd/ pkg/ vendor/ -name '*.go') +PLUGIN_SOURCES := $(shell ls *.go) INTEGRATION_SOURCES := $(shell find integration/ -name '*.go') all: binaries @@ -41,6 +42,7 @@ help: @echo @echo " * 'install' - Install binaries to system locations" @echo " * 'binaries' - Build cri-containerd" + @echo " * 'plugin' - Build cri-containerd as a plugin package" @echo " * 'static-binaries - Build static cri-containerd" @echo " * 'release' - Build release tarball" @echo " * 'push' - Push release tarball to GCS" @@ -107,6 +109,13 @@ clean: binaries: $(BUILD_DIR)/cri-containerd +# TODO(random-liu): Make this only build when source files change and +# add this to target all. +plugin: $(PLUGIN_SOURCES) $(SOURCES) + $(GO) build -tags '$(BUILD_TAGS)' \ + -ldflags '$(GO_LDFLAGS)' \ + -gcflags '$(GO_GCFLAGS)' \ + static-binaries: GO_LDFLAGS += -extldflags "-fno-PIC -static" static-binaries: $(BUILD_DIR)/cri-containerd @@ -156,6 +165,7 @@ install.tools: .install.gitvalidation .install.gometalinter .PHONY: \ binaries \ static-binaries \ + plugin \ release \ push \ boiler \