← Back to team overview

sts-sponsors team mailing list archive

[Merge] ~adam-collard/maas-ci/+git/system-tests:image-to-test-fixture-rework into ~maas-committers/maas-ci/+git/system-tests:master

 

Adam Collard has proposed merging ~adam-collard/maas-ci/+git/system-tests:image-to-test-fixture-rework into ~maas-committers/maas-ci/+git/system-tests:master.

Commit message:
image_to_test: each invocation gets a single image to test

albeit generated from a list

Requested reviews:
  MAAS Committers (maas-committers)

For more details, see:
https://code.launchpad.net/~adam-collard/maas-ci/+git/system-tests/+merge/443648
-- 
Your team MAAS Committers is requested to review the proposed merge of ~adam-collard/maas-ci/+git/system-tests:image-to-test-fixture-rework into ~maas-committers/maas-ci/+git/system-tests:master.
diff --git a/systemtests/conftest.py b/systemtests/conftest.py
index fa1724c..0b9fac9 100644
--- a/systemtests/conftest.py
+++ b/systemtests/conftest.py
@@ -288,9 +288,9 @@ def hardware_sync_machine(
 
 
 @pytest.fixture(scope="module")
-def images_to_test(request: Any) -> Iterator[TestableImage]:
-    images: TestableImage = getattr(request, "param")
-    yield images
+def image_to_test(request: pytest.FixtureRequest) -> Iterator[TestableImage]:
+    image: TestableImage = request.param
+    yield image
 
 
 def generate_images(config: dict[str, Any]) -> list[TestableImage]:
@@ -344,11 +344,8 @@ def pytest_generate_tests(metafunc: Metafunc) -> None:
         ]
         metafunc.parametrize("instance_config", instance_config, ids=str, indirect=True)
 
-    if "images_to_test" in metafunc.fixturenames:
+    if "image_to_test" in metafunc.fixturenames:
         if images_to_test := [image for image in generate_images(cfg) if image.url]:
-            LOG.info(
-                f"Testing images: {', '.join(str(image) for image in images_to_test)}"
-            )
             metafunc.parametrize(
-                "images_to_test", images_to_test, ids=str, indirect=True
+                "image_to_test", images_to_test, ids=str, indirect=True
             )
diff --git a/systemtests/tests_per_machine/test_machine.py b/systemtests/tests_per_machine/test_machine.py
index 4631504..02bf72b 100644
--- a/systemtests/tests_per_machine/test_machine.py
+++ b/systemtests/tests_per_machine/test_machine.py
@@ -38,7 +38,7 @@ def test_full_circle(
     zone: str,
     pool: str,
     tag_all: str,
-    images_to_test: TestableImage,
+    image_to_test: TestableImage,
 ) -> Iterator[None]:
     maas_ip_ranges = maas_api_client.list_ip_ranges()
     reserved_ranges = []
@@ -113,7 +113,7 @@ def test_full_circle(
     yield
 
     deploy_osystem = (
-        machine_config.osystem if not images_to_test else images_to_test.osystem
+        machine_config.osystem if not image_to_test else image_to_test.osystem
     )
 
     maas_api_client.deploy_machine(

Follow ups