|
53 | 53 | config_default_storage_class, |
54 | 54 | deploy_run_in_progress_config_map, |
55 | 55 | deploy_run_in_progress_namespace, |
56 | | - generate_os_matrix_dicts, |
57 | 56 | get_artifactory_server_url, |
58 | 57 | get_base_matrix_name, |
59 | 58 | get_cnv_version_explorer_url, |
|
65 | 64 | separator, |
66 | 65 | skip_if_pytest_flags_exists, |
67 | 66 | stop_if_run_in_progress, |
| 67 | + update_cpu_arch_related_config, |
68 | 68 | update_latest_os_config, |
| 69 | + validate_collected_tests_arch_params, |
69 | 70 | ) |
70 | 71 |
|
71 | 72 | LOGGER = logging.getLogger(__name__) |
|
86 | 87 | "numa", |
87 | 88 | "cclm", |
88 | 89 | "mtv", |
| 90 | + "multiarch", |
89 | 91 | ] |
90 | 92 |
|
91 | 93 | TEAM_MARKERS = { |
|
114 | 116 | def pytest_addoption(parser): |
115 | 117 | matrix_group = parser.getgroup(name="Matrix") |
116 | 118 | os_group = parser.getgroup(name="OS") |
| 119 | + arch_group = parser.getgroup(name="Architecture") |
117 | 120 | install_upgrade_group = parser.getgroup(name="Upgrade") |
118 | 121 | storage_group = parser.getgroup(name="Storage") |
119 | 122 | cluster_sanity_group = parser.getgroup(name="ClusterSanity") |
@@ -217,6 +220,15 @@ def pytest_addoption(parser): |
217 | 220 | help="Run matrix tests with latest CentOS", |
218 | 221 | ) |
219 | 222 |
|
| 223 | + arch_group.addoption( |
| 224 | + "--cpu-arch", |
| 225 | + help=""" |
| 226 | + CPU architecture to use when running tests on heterogeneous clusters. |
| 227 | + Single arch (e.g. amd64) or comma-separated combination (e.g. amd64,arm64). |
| 228 | + Defines what OS matrix params to use and what CPU architecture to use for VMs. |
| 229 | + """, |
| 230 | + ) |
| 231 | + |
220 | 232 | # Storage addoption |
221 | 233 | storage_group.addoption( |
222 | 234 | "--default-storage-class", |
@@ -783,7 +795,7 @@ def pytest_sessionstart(session): |
783 | 795 | # with runtime storage_class_matrix value(s) |
784 | 796 | py_config["system_storage_class_matrix"] = py_config.get("storage_class_matrix", []) |
785 | 797 |
|
786 | | - generate_os_matrix_dicts(os_dict=py_config) |
| 798 | + update_cpu_arch_related_config(cpu_arch_option=session.config.getoption("--cpu-arch") or "") |
787 | 799 | update_latest_os_config(session_config=session.config) |
788 | 800 |
|
789 | 801 | matrix_addoptions = [matrix for matrix in session.config.invocation_params.args if "-matrix=" in matrix] |
@@ -834,6 +846,7 @@ def pytest_sessionstart(session): |
834 | 846 |
|
835 | 847 |
|
836 | 848 | def pytest_collection_finish(session): |
| 849 | + validate_collected_tests_arch_params(session=session) |
837 | 850 | if session.config.getoption("--collect-tests-markers"): |
838 | 851 | get_tests_cluster_markers(items=session.items, filepath=session.config.getoption("--tests-markers-file")) |
839 | 852 | pytest.exit(reason="Run with --collect-tests-markers. no tests are executed", returncode=0) |
|
0 commit comments