Skip to content

Commit

Permalink
* [e2e] update fixture to compatible with new RKE1/RKE2 version
Browse files Browse the repository at this point in the history
  • Loading branch information
lanfon72 committed Jul 3, 2023
1 parent c01b217 commit d73ef66
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
5 changes: 0 additions & 5 deletions harvester_e2e_tests/fixtures/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,6 @@ def expected_settings():
}


@pytest.fixture(scope="session")
def k8s_version(request):
return request.config.getoption("--kubernetes-version")


@pytest.fixture(autouse=True)
def skip_version_before(request, api_client):
mark = request.node.get_closest_marker("skip_version_before")
Expand Down
6 changes: 6 additions & 0 deletions harvester_e2e_tests/fixtures/rancher_api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,9 @@ def rancher_api_client(request):
api.session.verify = ssl_verify

return api


@pytest.fixture(scope="session")
def k8s_version(request):
return (request.config.getoption("--RKE2-version")
or request.config.getoption("--kubernetes-version"))
6 changes: 5 additions & 1 deletion harvester_e2e_tests/integration/test_rancher_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@ def rke2_cluster_name(unique_name):


@pytest.fixture(scope='module')
def rke1_k8s_version(k8s_version, rancher_api_client):
def rke1_k8s_version(request, k8s_version, rancher_api_client):
configured = request.config.getoption("--RKE1-version")
if configured:
return configured

# `v1.24.11+rke2r1` -> `v1.24.11-rancher2-1`
version = re.sub(r'\+rke(\d+)r(\d+)', lambda g: "-rancher%s-%s" % g.groups(), k8s_version)

Expand Down

0 comments on commit d73ef66

Please sign in to comment.