Module: check_mk
Branch: master
Commit: c24c045b5cb5ac47074e31e3b64bd617607a5af9
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c24c045b5cb5ac…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Sep 10 16:35:54 2018 +0200
Integration tests: Use branch daily version as it was intended
An integration test e.g. for the 1.5.0 branch should use the 1.5.0 daily
build by default. The branch was hard coded previously.
Change-Id: I759100216698e11b861aa67a4c89f4158e0e9997
---
tests/conftest.py | 2 +-
tests/testlib/__init__.py | 5 +++++
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/tests/conftest.py b/tests/conftest.py
index 9b39812..8721826 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -217,7 +217,7 @@ def _get_site_object():
return os.environ.get("EDITION", testlib.CMKVersion.CEE)
def site_branch():
- return os.environ.get("BRANCH", "master")
+ return os.environ.get("BRANCH", testlib.current_branch_name())
def reuse_site():
return os.environ.get("REUSE", "1") == "1"
diff --git a/tests/testlib/__init__.py b/tests/testlib/__init__.py
index 42a1dd3..977cd62 100644
--- a/tests/testlib/__init__.py
+++ b/tests/testlib/__init__.py
@@ -60,6 +60,11 @@ def virtualenv_path():
return None
+def current_branch_name():
+ branch_name = subprocess.check_output(["git", "rev-parse",
"--abbrev-ref", "HEAD"]).split("\n", 1)[0]
+ return branch_name.decode("utf-8")
+
+
class APIError(Exception):
pass