diff --git a/tests/conftest.py b/tests/conftest.py index ab4ae863..60d945a6 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -24,6 +24,7 @@ from xdist.scheduler import LoadScopeScheduling DOCKER_FOR_E2E_OPTION = "--use-docker-for-e2e" +E2E_K8S_VERSION_OPTION = "--e2e-k8s-version" pytest_plugins = ['helpers_namespace'] @@ -156,6 +157,14 @@ def pytest_xdist_make_scheduler(config, log): def pytest_addoption(parser): parser.addoption(DOCKER_FOR_E2E_OPTION, action="store_true", help="Run FDD using the latest docker container when executing E2E tests") + parser.addoption(E2E_K8S_VERSION_OPTION, action="store", + default="v1.22.4", + help="Run e2e tests against a kind cluster using this Kubernetes version") + + +@pytest.fixture(scope="session") +def k8s_version(request): + return request.config.getoption(E2E_K8S_VERSION_OPTION) @pytest.fixture(scope="session") diff --git a/tests/fiaas_deploy_daemon/conftest.py b/tests/fiaas_deploy_daemon/conftest.py index efb9e50a..1f39296a 100644 --- a/tests/fiaas_deploy_daemon/conftest.py +++ b/tests/fiaas_deploy_daemon/conftest.py @@ -187,16 +187,3 @@ def _mock_namespace_file_open(name, *args, **kwargs): with mock.patch("__builtin__.open") as mock_open: mock_open.side_effect = _mock_namespace_file_open yield mock_open - - -@pytest.fixture(scope="session", params=( - "v1.15.12", - "v1.16.15", - "v1.18.19", - "v1.19.11", - "v1.20.7", - "v1.21.2", - pytest.param("v1.22.4", marks=pytest.mark.e2e_latest) -)) -def k8s_version(request): - yield request.param