From bbf65dc1bbe31bd23d73a942f8b4859508a05037 Mon Sep 17 00:00:00 2001 From: Matthew Heon Date: Wed, 20 Sep 2017 12:54:12 -0400 Subject: [PATCH] Add Makefile target to run unit & integration tests Also adds unit tests to Travis Signed-off-by: Matthew Heon --- .travis.yml | 3 ++- Makefile | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 9ebe8b0c..32467599 100644 --- a/.travis.yml +++ b/.travis.yml @@ -53,8 +53,9 @@ jobs: - make docs - make go: tip - - stage: Integration Test + - stage: Unit and Integration Tests script: + - make testunit - make integration go: 1.8.x diff --git a/Makefile b/Makefile index e3e5050b..19f245a2 100644 --- a/Makefile +++ b/Makefile @@ -45,6 +45,8 @@ help: @echo @echo " * 'install' - Install binaries to system locations" @echo " * 'binaries' - Build crio, conmon and crioctl" + @echo " * 'test' - Execute unit and integration tests" + @echo " * 'testunit' - Execute unit tests" @echo " * 'integration' - Execute integration tests" @echo " * 'clean' - Clean artifacts" @echo " * 'lint' - Execute the source code linter" @@ -113,6 +115,9 @@ crioimage: dbuild: crioimage docker run --name=${CRIO_INSTANCE} --privileged ${CRIO_IMAGE} -v ${PWD}:/go/src/${PROJECT} --rm make binaries +test: crioimage + docker run -e STORAGE_OPTS="--storage-driver=vfs" -e TESTFLAGS -e TRAVIS -t --privileged --rm -v ${CURDIR}:/go/src/${PROJECT} ${CRIO_IMAGE} make -k testunit localintegration + integration: crioimage docker run -e STORAGE_OPTS="--storage-driver=vfs" -e TESTFLAGS -e TRAVIS -t --privileged --rm -v ${CURDIR}:/go/src/${PROJECT} ${CRIO_IMAGE} make localintegration