summaryrefslogtreecommitdiff
path: root/tools/functional/conftest.py
diff options
context:
space:
mode:
authorNejc Habjan <nejc.habjan@siemens.com>2020-10-10 17:24:57 +0200
committerNejc Habjan <nejc.habjan@siemens.com>2020-10-12 18:29:06 +0200
commitf4e79501f1be1394873042dd65beda49e869afb8 (patch)
tree83dceff9d3571778a533978ac89d2a3f309fc73a /tools/functional/conftest.py
parent375b29d3ab393f7b3fa734c5320736cdcba5df8a (diff)
downloadgitlab-fix/cli-binary-data.tar.gz
test(cli): add test for job artifacts downloadfix/cli-binary-data
Diffstat (limited to 'tools/functional/conftest.py')
-rw-r--r--tools/functional/conftest.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/tools/functional/conftest.py b/tools/functional/conftest.py
index 0cca3e3..675dba9 100644
--- a/tools/functional/conftest.py
+++ b/tools/functional/conftest.py
@@ -132,6 +132,36 @@ def gl(gitlab_config):
return instance
+@pytest.fixture(scope="session")
+def gitlab_runner(gl):
+ container = "gitlab-runner-test"
+ runner_name = "python-gitlab-runner"
+ token = "registration-token"
+ url = "http://gitlab"
+
+ docker_exec = ["docker", "exec", container, "gitlab-runner"]
+ register = [
+ "register",
+ "--run-untagged",
+ "--non-interactive",
+ "--registration-token",
+ token,
+ "--name",
+ runner_name,
+ "--url",
+ url,
+ "--clone-url",
+ url,
+ "--executor",
+ "shell",
+ ]
+ unregister = ["unregister", "--name", runner_name]
+
+ yield check_output(docker_exec + register).decode()
+
+ check_output(docker_exec + unregister).decode()
+
+
@pytest.fixture(scope="module")
def group(gl):
"""Group fixture for group API resource tests."""