← Back to team overview

sts-sponsors team mailing list archive

Re: [Merge] ~lloydwaltersj/maas-ci/+git/system-tests:system-test-image-test into ~maas-committers/maas-ci/+git/system-tests:master

 


Diff comments:

> diff --git a/systemtests/conftest.py b/systemtests/conftest.py
> index 0db6532..78c27c9 100644
> --- a/systemtests/conftest.py
> +++ b/systemtests/conftest.py
> @@ -329,3 +343,9 @@ def pytest_generate_tests(metafunc: Metafunc) -> None:
>              if len(instance.devices_config) > 0
>          ]
>          metafunc.parametrize("instance_config", instance_config, ids=str, indirect=True)
> +
> +    # if we're testing im

comment is redundant (and incomplete) let's just nuke it

> +    if "images_to_test" in metafunc.fixturenames:
> +        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)
> diff --git a/utils/gen_config.py b/utils/gen_config.py
> index 4a8a5b5..18ad8c0 100755
> --- a/utils/gen_config.py
> +++ b/utils/gen_config.py
> @@ -224,11 +251,19 @@ def main(argv: list[str]) -> int:
>  
>      if hardware:
>          if args.architecture:
> +            # if running custom image tests, only use compatible machines
> +            target_arches = (
> +                args.architecture
> +                if not args.image_tests
> +                else [
> +                    image["architecture"] for _, image in config["image-tests"].items()

since we're not using the key (_) we can just iterate over the values, e.g.

[image["architecture"] for image in config["image-tests"].values()]

> +                ]
> +            )
>              # Filter out machines with architectures not matching specified ones.
>              machines["hardware"] = {
>                  name: details
>                  for name, details in hardware.items()
> -                if details.get("architecture", "amd64") in args.architecture
> +                if details.get("architecture", "amd64") in target_arches
>              }
>  
>          if args.machine:


-- 
https://code.launchpad.net/~lloydwaltersj/maas-ci/+git/system-tests/+merge/443284
Your team MAAS Committers is requested to review the proposed merge of ~lloydwaltersj/maas-ci/+git/system-tests:system-test-image-test into ~maas-committers/maas-ci/+git/system-tests:master.



References