Skip to content

Commit 02d76d4

Browse files
committed
fix(test): fix snapshot artifact discovery on aarch64
Two bugs were preventing cross-kernel restore tests from running: 1. The glob pattern only searched one level deep under snapshot_artifacts/, but Phase 1 artifacts are nested under an additional test-name directory. Use recursive glob (**/) to find snapshot directories regardless of nesting depth. 2. The "None" CPU template was only added to the search list on x86_64, so on aarch64 instances where get_supported_cpu_templates() returns an empty list (e.g. Neoverse N1), the loop yielded zero pytest parameters and the test was silently skipped. Always include "None" in the search list. Signed-off-by: Jack Thomson <jackabt@amazon.com>
1 parent 3bd1eee commit 02d76d4

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

tests/integration_tests/functional/test_snapshot_restore_cross_kernel.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
import json
77
import logging
8-
import platform
98
from pathlib import Path
109

1110
import pytest
@@ -71,12 +70,9 @@ def get_snapshot_dirs():
7170
"""Get all the snapshot directories"""
7271
snapshot_root_name = "snapshot_artifacts"
7372
snapshot_root_dir = Path(FC_WORKSPACE_DIR) / snapshot_root_name
74-
cpu_templates = []
75-
if platform.machine() == "x86_64":
76-
cpu_templates = ["None"]
77-
cpu_templates += get_supported_cpu_templates()
73+
cpu_templates = ["None"] + get_supported_cpu_templates()
7874
for cpu_template in cpu_templates:
79-
for snapshot_dir in snapshot_root_dir.glob(f"*_{cpu_template}_guest_snapshot"):
75+
for snapshot_dir in snapshot_root_dir.glob(f"**/*_{cpu_template}_guest_snapshot"):
8076
assert snapshot_dir.is_dir()
8177
yield pytest.param(snapshot_dir, id=snapshot_dir.name)
8278

0 commit comments

Comments
 (0)