-
Notifications
You must be signed in to change notification settings - Fork 72
Add support for multiarch dedicated tests #5124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
df14125
Support multi-arch dedicated tests
hmeir c590c3a
Fix collection for multiarch tests
hmeir 15d2a8b
docs: update MULTIARCH.md with full heterogeneous cluster guide
hmeir cf72b7f
Add tox check for multiarch
hmeir cfd1845
Updated README and cluster_info
hmeir 4656d10
Add multiarch unnitest
hmeir File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,93 @@ | ||
| # Multi-Architecture (Heterogeneous) Clusters | ||
|
|
||
| Currently supported architectures for multi-arch runs: `amd64` and `arm64`. | ||
| A heterogeneous cluster has worker nodes of more than one CPU architecture — for example, amd64 and arm64 workers coexisting on the same cluster. The test framework detects this automatically. | ||
|
|
||
| On clusters where nodes have different CPU architectures, you must pass `--cpu-arch` to select the architecture for the run. Use a single value (e.g. `--cpu-arch=amd64`) or, for tests marked with `multiarch`, a comma-separated list (e.g. `--cpu-arch=amd64,arm64`). Use the config file `tests/global_config_multiarch.py` and the `multiarch` marker for tests that run across multiple architectures. Do not pass `--cpu-arch` on homogeneous clusters. | ||
| **Supported architectures:** `amd64`, `arm64` | ||
|
|
||
| ## Overview | ||
|
|
||
| The `--cpu-arch` option selects which architecture(s) to target. Behavior depends on cluster type and the value passed: | ||
|
|
||
| | Test suite | Cluster | `--cpu-arch` | What runs | | ||
| | ---------- | ------- | ------------ | --------- | | ||
| | **Standard** | Homogeneous (single arch) | Omit — auto-detected from node labels | Standard regression tests | | ||
| | **Multiarch regression** | Heterogeneous (multiarch) | Single value — e.g. `amd64` or `arm64` | Full suite, scoped to nodes of that arch | | ||
| | **Multiarch-dedicated** | Heterogeneous (multiarch) | Comma-separated — e.g. `amd64,arm64` | Only tests marked with `multiarch` | | ||
|
|
||
| **On a heterogeneous cluster:** | ||
|
|
||
| - `--cpu-arch` is **required**. Omitting it raises `UnsupportedCPUArchitectureError`. | ||
| - Pass `--tc-file=tests/global_config.py` for regression runs (preferred — it auto-imports the multiarch config). `tests/global_config_multiarch.py` also works. | ||
| - For multiarch-dedicated tests, `--tc-file=tests/global_config_multiarch.py` is **required**. | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
|
|
||
| **On a homogeneous cluster:** | ||
|
|
||
| - Run tests normally and do **not** pass `--cpu-arch`. Passing it raises `UnsupportedCPUArchitectureError`. | ||
|
|
||
| ## Multiarch regression | ||
|
|
||
| Run the existing test suite against one architecture's nodes at a time. | ||
|
|
||
| ```bash | ||
| # amd64 regression | ||
| uv run pytest --tc-file=tests/global_config.py --cpu-arch=amd64 ... | ||
|
|
||
| # arm64 regression | ||
| uv run pytest --tc-file=tests/global_config.py --cpu-arch=arm64 ... | ||
| ``` | ||
|
|
||
| ## Multiarch-dedicated tests | ||
|
|
||
| Run tests that exercise behavior requiring multiple architectures simultaneously (e.g., golden image import across both archs, cross-arch scheduling). | ||
|
|
||
| ```bash | ||
| uv run pytest --tc-file=tests/global_config_multiarch.py --cpu-arch=amd64 ... | ||
| uv run pytest --tc-file=tests/global_config_multiarch.py --cpu-arch=amd64,arm64 \ | ||
| -m "iuo and multiarch" ... | ||
| ``` | ||
|
|
||
| ## Limitations | ||
| ### Run requirements | ||
|
|
||
| - The cluster must be heterogeneous. | ||
| - `--cpu-arch` must list multiple architectures (e.g. `amd64,arm64`) | ||
| - Every collected test must have the `multiarch` marker — use `-m multiarch`, or point pytest at a path that contains only multiarch tests (e.g. a `multiarch/` subdirectory). If any non-multiarch test is collected, pytest raises `UnsupportedCPUArchitectureError`. | ||
|
|
||
| ### Writing dedicated tests | ||
|
hmeir marked this conversation as resolved.
|
||
|
|
||
| Multiarch-dedicated tests should be isolated from regular tests. Avoid modifying existing fixtures and functions — prefer creating dedicated ones for multiarch tests to reduce the risk of breaking regression suites. | ||
|
|
||
| Mark the entire file or specific classes with the `multiarch` marker: | ||
|
|
||
| ```python | ||
| # Module-level (preferred — marks the whole file) | ||
| pytestmark = [pytest.mark.multiarch] | ||
|
|
||
| # Class-level | ||
| @pytest.mark.multiarch | ||
| class TestMultiarchFeature: | ||
| ... | ||
| ``` | ||
|
|
||
| The `multiarch` marker is **required** on any test that runs in multiarch-dedicated mode. It also prevents the test from being collected on homogeneous clusters. | ||
|
|
||
| Place multiarch tests in a `multiarch/` subdirectory or use `_multiarch` in the filename (repo convention, not enforced by pytest): | ||
|
|
||
| ``` | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| tests/ | ||
| install_upgrade_operators/ | ||
| hco_enablement_golden_image_updates/ | ||
| multiarch/ | ||
| test_multiarch_golden_images_support.py | ||
| network/ | ||
| connectivity/ | ||
| test_pod_network_multiarch.py | ||
| ``` | ||
|
|
||
| ### Framework constraints | ||
|
|
||
| Multiarch-dedicated runs (`--cpu-arch=amd64,arm64`) do not set a single target architecture. Tests must not rely on the helpers that regression runs provide: | ||
|
|
||
| `*_os_matrix` variables are not created for multi-arch runs (when `--cpu-arch` contains multiple architectures, e.g. `--cpu-arch=amd64,arm64`). | ||
| | Helper | Multiarch regression | Multiarch-dedicated | | ||
| | ------ | -------------------- | ------------------- | | ||
| | `py_config["cpu_arch"]` | Set to selected arch | **Not set** | | ||
| | OS matrix keys in `py_config` (e.g. `latest_rhel_os_dict`) | Generated for selected arch | **Not generated** | | ||
| | `schedulable_nodes` | Nodes of selected arch only | All schedulable nodes — filter by arch in the test | | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.