Module: check_mk
Branch: master
Commit: fbce681255154e4e2b30410f0b0d2b229452a990
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=fbce681255154e…
Author: Jukka Aro <ja(a)mathias-kettner.de>
Date: Thu Jan 25 15:25:03 2018 +0100
Adjust Windows integration tests for Jenkins
* Pass WORKSPACE variable to sudo in chroot.
* Add JUnit xml output for Jenkins build.
---
agents/windows/Makefile.am | 13 +++++++++++--
agents/windows/make-agent | 2 +-
2 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/agents/windows/Makefile.am b/agents/windows/Makefile.am
index 4e0df39..13b65f3 100644
--- a/agents/windows/Makefile.am
+++ b/agents/windows/Makefile.am
@@ -15,6 +15,10 @@ WindowsAgentTest_LDADD = libcheck_mk_agent.a -lgtest -lgmock
$(LD_COMMON)
wmitest_LDADD = $(LD_COMMON)
+pytest = /usr/bin/env pytest
+pytest_options = --cache-clear --maxfail=10
+pytest_jenkins = $(pytest_options) --junitxml=$$WORKSPACE/results/junit.xml
+
build_version: $(check_mk_agent_SOURCES:.cc=.o)
echo $$(( $$(cat $(VPATH)/build_version) + 1 )) > $(VPATH)/build_version
@@ -36,8 +40,13 @@ unittest: WindowsAgentTest$(EXEEXT)
integrationtest: install-strip
cd $(bindir)/it ; \
- pytest --maxfail=10 ; \
- cd -
+ rm -f remote.pyc ; \
+ if [[ $$SUDO_USER == jenkins ]] ; then \
+ $(pytest) $(pytest_jenkins) ; \
+ else \
+ $(pytest) $(pytest_options) ; \
+ fi ; \
+ cd -
libcheck_mk_agent_a_SOURCES = \
Configuration.cc \
diff --git a/agents/windows/make-agent b/agents/windows/make-agent
index 41af275..1c744ee 100755
--- a/agents/windows/make-agent
+++ b/agents/windows/make-agent
@@ -96,4 +96,4 @@ echo "[MAKE-CHROOT LOCK] released"
# Build the Windows agent within chroot by calling the 'build-agent' script as
# $SUDO_USER.
./do-chroot \
- "/bin/su - $SUDO_USER -c bash -c 'CHROOT_NAME=$CHROOT_NAME
CHROOT_PATH=$CHROOT_PATH CHROOT_BUILD_DIR=$CHROOT_BUILD_DIR NEW_VERSION=$NEW_VERSION
SSH_AUTH_SOCK=$SSH_AUTH_SOCK /$CHROOT_BUILD_DIR/agents/windows/build-agent -j${njobs}
$targets'"
+ "/bin/su - $SUDO_USER -c bash -c 'CHROOT_NAME=$CHROOT_NAME
CHROOT_PATH=$CHROOT_PATH CHROOT_BUILD_DIR=$CHROOT_BUILD_DIR NEW_VERSION=$NEW_VERSION
WORKSPACE=$WORKSPACE /$CHROOT_BUILD_DIR/agents/windows/build-agent -j${njobs}
$targets'"