Add --update-to-tag=2019.2.x parameter for pytest to define mcp-version explicitly
Change-Id: I424d5af7309d861a6de7a8edcd209196efefecbd
diff --git a/tcp_tests/tests/system/conftest.py b/tcp_tests/tests/system/conftest.py
index 2ea36cf..0dabd4d 100644
--- a/tcp_tests/tests/system/conftest.py
+++ b/tcp_tests/tests/system/conftest.py
@@ -83,8 +83,7 @@
def pytest_addoption(parser):
- parser.addoption("--dont-switch-to-proposed",
- action="store_true",
- help="Skips switching Jenkins on cluster-under-test to "
- "the proposed branch before the applying "
- "the MCP updates")
+ parser.addoption("--update-to-tag",
+ action="store",
+ default=None,
+ help="For mcp_update test")
diff --git a/tcp_tests/tests/system/test_mcp_update.py b/tcp_tests/tests/system/test_mcp_update.py
index db2cb26..1ff1294 100644
--- a/tcp_tests/tests/system/test_mcp_update.py
+++ b/tcp_tests/tests/system/test_mcp_update.py
@@ -67,14 +67,14 @@
@pytest.fixture(scope='class')
-def dont_switch_to_proposed(request):
- return request.config.getoption("--dont-switch-to-proposed")
+def update_to_tag(request):
+ return request.config.getoption("--update-to-tag")
@pytest.fixture(scope='class')
def switch_to_proposed_pipelines(reclass_actions, salt_actions,
- dont_switch_to_proposed):
- if dont_switch_to_proposed:
+ update_to_tag):
+ if update_to_tag:
return True
reclass = reclass_actions
@@ -168,6 +168,7 @@
@pytest.mark.usefixtures("switch_to_proposed_pipelines",
+ "update_to_tag",
"wa_for_galera_clustercheck_password_prod35705",
"wa_for_alerta_password_prod35958")
class TestUpdateMcpCluster(object):
@@ -180,7 +181,7 @@
@pytest.mark.parametrize("_", [settings.ENV_NAME])
@pytest.mark.run_mcp_update
def test_update_drivetrain(self, salt_actions, drivetrain_actions,
- show_step, _):
+ show_step, update_to_tag, _):
"""Updating DriveTrain component to release/proposed/2019.2.0 version
Scenario:
@@ -206,7 +207,8 @@
show_step(2)
job_name = 'git-mirror-downstream-mk-pipelines'
job_parameters = {
- 'BRANCHES': 'release/proposed/2019.2.0'
+ 'BRANCHES': '*' or
+ 'release/proposed/2019.2.0'
}
job_result, job_description = dt.start_job_on_jenkins(
job_name=job_name,
@@ -219,7 +221,8 @@
show_step(3)
job_name = 'git-mirror-downstream-pipeline-library'
job_parameters = {
- 'BRANCHES': 'release/proposed/2019.2.0'
+ 'BRANCHES': '*' or
+ 'release/proposed/2019.2.0'
}
job_result, job_description = dt.start_job_on_jenkins(
job_name=job_name,
@@ -233,9 +236,8 @@
job_name = 'upgrade-mcp-release'
job_parameters = {
- 'GIT_REFSPEC': 'release/proposed/2019.2.0',
- 'MK_PIPELINES_REFSPEC': 'release/proposed/2019.2.0',
- 'TARGET_MCP_VERSION': '2019.2.0',
+ 'GIT_REFSPEC': update_to_tag or 'release/proposed/2019.2.0',
+ 'TARGET_MCP_VERSION': update_to_tag or '2019.2.0',
"DRIVE_TRAIN_PARAMS": {
"OS_DIST_UPGRADE": True,
"OS_UPGRADE": True,