Skip to content

feat(image-tests): initial pytest-based static image validation#16947

Open
reubeno wants to merge 1 commit intomicrosoft:tomls/base/mainfrom
reubeno:first-static-tests
Open

feat(image-tests): initial pytest-based static image validation#16947
reubeno wants to merge 1 commit intomicrosoft:tomls/base/mainfrom
reubeno:first-static-tests

Conversation

@reubeno
Copy link
Copy Markdown
Member

@reubeno reubeno commented Apr 29, 2026

NOTE: I'm still reviewing some of the copilot-generated implementation details; posting for easier commenting, iteration, and early skim of general structure.


Introduce a pytest harness for offline validation of built Azure Linux images, wired into azldev via the new [test-suites] TOML config.

A small, representative set of tests is included to establish the extension pattern: shared cases live under base/images/tests/cases/ and image-specific cases under cases// (auto-restricted to that image by the pytest plugin). Image-type plumbing — VM mount via guestmount, container extract via skopeo+umoci — and shared fixtures (rootfs, os_release, installed_packages, partition_table) live under utils/, with native-tool dependencies declared next to their use and validated up-front by a preflight check.

Introduce a pytest harness for offline validation of built Azure Linux
images, wired into azldev via the new [test-suites] TOML config.

A small, representative set of tests is included to establish the
extension pattern: shared cases live under base/images/tests/cases/
and image-specific cases under cases/<image-name>/ (auto-restricted
to that image by the pytest plugin). Image-type plumbing — VM mount
via guestmount, container extract via skopeo+umoci — and shared
fixtures (rootfs, os_release, installed_packages, partition_table)
live under utils/, with native-tool dependencies declared next to
their use and validated up-front by a preflight check.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown

❌ Rendered specs are out of date

🚧🚧🚧🚧🚧

Warning

Disregard this comment.

Spec rendering is still under development and checked-in specs
should not be updated in PRs yet.
Please ignore this comment for now unless you are actively
working on the render pipeline.

🚧🚧🚧🚧🚧

FIX: — run this and commit the result:

azldev component render -a --clean-stale

Or download the fix patch and apply it:

gh run download 25133149787 -R microsoft/azurelinux -n rendered-specs-patch
git apply rendered-specs.patch
Category Count
Content diffs 4008
Extra files (untracked) 269
Missing files (deleted) 312

Content diffs

`specs/3/389-ds-base/389-ds-base.spec`
--- committed/specs/3/389-ds-base/389-ds-base.spec
+++ rendered/specs/3/389-ds-base/389-ds-base.spec
@@ -1,5 +1,5 @@
 ## START: Set by rpmautospec
-## (rpmautospec version 0.8.4)
+## (rpmautospec version 0.8.3)
 ## RPMAUTOSPEC: autorelease, autochangelog
 %define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
     release_number = 8;
@@ -1123,7 +1123,7 @@
 
 %changelog
 ## START: Generated by rpmautospec
-* Wed Apr 22 2026 azldev <azurelinux@microsoft.com> - 3.1.4-8
+* Wed Apr 29 2026 azldev <azurelinux@microsoft.com> - 3.1.4-8
 - Latest state for 389-ds-base
 
 * Fri Feb 13 2026 Viktor Ashirov <vashirov@redhat.com> - 3.1.4-7
`specs/7/7zip/7zip.spec`
--- committed/specs/7/7zip/7zip.spec
+++ rendered/specs/7/7zip/7zip.spec
@@ -1,5 +1,5 @@
 ## START: Set by rpmautospec
-## (rpmautospec version 0.8.4)
+## (rpmautospec version 0.8.3)
 ## RPMAUTOSPEC: autorelease, autochangelog
 %define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
     release_number = 2;
@@ -138,7 +138,7 @@
 
 %changelog
 ## START: Generated by rpmautospec
-* Wed Apr 22 2026 azldev <azurelinux@microsoft.com> - 25.01-2
+* Wed Apr 29 2026 azldev <azurelinux@microsoft.com> - 25.01-2
 - Latest state for 7zip
 
 * Wed Nov 26 2025 Michel Lind <salimma@fedoraproject.org> - 25.01-1
`specs/a/AMF/AMF.spec`
--- committed/specs/a/AMF/AMF.spec
+++ rendered/specs/a/AMF/AMF.spec
@@ -1,5 +1,5 @@
 ## START: Set by rpmautospec
-## (rpmautospec version 0.8.4)
+## (rpmautospec version 0.8.3)
 ## RPMAUTOSPEC: autorelease, autochangelog
 %define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
     release_number = 2;
@@ -87,7 +87,7 @@
 
 %changelog
 ## START: Generated by rpmautospec
-* Wed Apr 22 2026 azldev <azurelinux@microsoft.com> - 1:1.5.0-2
+* Wed Apr 29 2026 azldev <azurelinux@microsoft.com> - 1:1.5.0-2
 - Latest state for AMF
 
 * Fri Oct 31 2025 Simone Caronni <negativo17@gmail.com> - 1:1.5.0-1
`specs/a/aardvark-dns/aardvark-dns.spec`
--- committed/specs/a/aardvark-dns/aardvark-dns.spec
+++ rendered/specs/a/aardvark-dns/aardvark-dns.spec
@@ -1,5 +1,5 @@
 ## START: Set by rpmautospec
-## (rpmautospec version 0.8.4)
+## (rpmautospec version 0.8.3)
 ## RPMAUTOSPEC: autorelease, autochangelog
 %define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
     release_number = 2;
@@ -130,7 +130,7 @@
 
 %changelog
 ## START: Generated by rpmautospec
-* Wed Apr 22 2026 azldev <azurelinux@microsoft.com> - 2:1.17.0-2
+* Wed Apr 29 2026 azldev <azurelinux@microsoft.com> - 2:1.17.0-2
 - Latest state for aardvark-dns
 
 * Wed Nov 12 2025 Packit <hello@packit.dev> - 2:1.17.0-1
`specs/a/abseil-cpp/abseil-cpp.spec`
--- committed/specs/a/abseil-cpp/abseil-cpp.spec
+++ rendered/specs/a/abseil-cpp/abseil-cpp.spec
@@ -1,5 +1,5 @@
 ## START: Set by rpmautospec
-## (rpmautospec version 0.8.4)
+## (rpmautospec version 0.8.3)
 ## RPMAUTOSPEC: autorelease, autochangelog
 %define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
     release_number = 2;
@@ -267,7 +267,7 @@
 
 %changelog
 ## START: Generated by rpmautospec
-* Wed Apr 22 2026 azldev <azurelinux@microsoft.com> - 20250814.1-2
+* Wed Apr 29 2026 azldev <azurelinux@microsoft.com> - 20250814.1-2
 - Latest state for abseil-cpp
 
 * Tue Sep 23 2025 Benjamin A. Beasley <code@musicinmybrain.net> - 20250814.1-1
`specs/a/accountsservice/accountsservice.spec`
--- committed/specs/a/accountsservice/accountsservice.spec
+++ rendered/specs/a/accountsservice/accountsservice.spec
@@ -1,5 +1,5 @@
 ## START: Set by rpmautospec
-## (rpmautospec version 0.8.4)
+## (rpmautospec version 0.8.3)
 ## RPMAUTOSPEC: autorelease, autochangelog
 %define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
     release_number = 15;
@@ -130,7 +130,7 @@
 
 %changelog
 ## START: Generated by rpmautospec
-* Wed Apr 22 2026 azldev <azurelinux@microsoft.com> - 23.13.9-15
+* Wed Apr 29 2026 azldev <azurelinux@microsoft.com> - 23.13.9-15
 - Latest state for accountsservice
 
 * Wed Jul 23 2025 Fedora Release Engineering <releng@fedoraproject.org> - 23.13.9-9
`specs/a/adobe-source-code-pro-fonts/adobe-source-code-pro-fonts.spec`
--- committed/specs/a/adobe-source-code-pro-fonts/adobe-source-code-pro-fonts.spec
+++ rendered/specs/a/adobe-source-code-pro-fonts/adobe-source-code-pro-fonts.spec
@@ -1,5 +1,5 @@
 ## START: Set by rpmautospec
-## (rpmautospec version 0.8.4)
+## (rpmautospec version 0.8.3)
 ## RPMAUTOSPEC: autorelease, autochangelog
 %define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
     release_number = 8;
@@ -71,7 +71,7 @@
 
 %changelog
 ## START: Generated by rpmautospec
-* Wed Apr 22 2026 azldev <azurelinux@microsoft.com> - 2.042.1.062.1.026-8
+* Wed Apr 29 2026 azldev <azurelinux@microsoft.com> - 2.042.1.062.1.026-8
 - Latest state for adobe-source-code-pro-fonts
 
 * Wed Jul 23 2025 Fedora Release Engineering <releng@fedoraproject.org> - 2.042.1.062.1.026-7
`specs/a/adwaita-icon-theme-legacy/adwaita-icon-theme-legacy.spec`
--- committed/specs/a/adwaita-icon-theme-legacy/adwaita-icon-theme-legacy.spec
+++ rendered/specs/a/adwaita-icon-theme-legacy/adwaita-icon-theme-legacy.spec
@@ -1,5 +1,5 @@
 ## START: Set by rpmautospec
-## (rpmautospec version 0.8.4)
+## (rpmautospec version 0.8.3)
 ## RPMAUTOSPEC: autorelease, autochangelog
 %define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
     release_number = 6;
@@ -87,7 +87,7 @@
 
 %changelog
 ## START: Generated by rpmautospec
-* Wed Apr 22 2026 azldev <azurelinux@microsoft.com> - 46.2-6
+* Wed Apr 29 2026 azldev <azurelinux@microsoft.com> - 46.2-6
 - Latest state for adwaita-icon-theme-legacy
 
 * Wed Jul 23 2025 Fedora Release Engineering <releng@fedoraproject.org> - 46.2-4
`specs/a/adwaita-icon-theme/adwaita-icon-theme.spec`
--- committed/specs/a/adwaita-icon-theme/adwaita-icon-theme.spec
+++ rendered/specs/a/adwaita-icon-theme/adwaita-icon-theme.spec
@@ -1,5 +1,5 @@
 ## START: Set by rpmautospec
-## (rpmautospec version 0.8.4)
+## (rpmautospec version 0.8.3)
 ## RPMAUTOSPEC: autorelease, autochangelog
 %define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
     release_number = 4;
@@ -93,7 +93,7 @@
 
 %changelog
 ## START: Generated by rpmautospec
-* Wed Apr 22 2026 azldev <azurelinux@microsoft.com> - 49.0-4
+* Wed Apr 29 2026 azldev <azurelinux@microsoft.com> - 49.0-4
 - Latest state for adwaita-icon-theme
 
 * Mon Sep 15 2025 Michael Catanzaro <mcatanzaro@gnome.org> - 49.0-1
`specs/a/afflib/afflib.spec`
--- committed/specs/a/afflib/afflib.spec
+++ rendered/specs/a/afflib/afflib.spec
@@ -1,5 +1,5 @@
 ## START: Set by rpmautospec
-## (rpmautospec version 0.8.4)
+## (rpmautospec version 0.8.3)
 ## RPMAUTOSPEC: autorelease, autochangelog
 %define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
     release_number = 16;
@@ -223,7 +223,7 @@
 
 %changelog
 ## START: Generated by rpmautospec
-* Wed Apr 22 2026 azldev <azurelinux@microsoft.com> - 3.7.20-16
+* Wed Apr 29 2026 azldev <azurelinux@microsoft.com> - 3.7.20-16
 - Latest state for afflib
 
 * Wed Jul 23 2025 Fedora Release Engineering <releng@fedoraproject.org> - 3.7.20-15

… and 3998 more file(s). Run the remediation command above to see all changes.

Files to add

These files are produced by azldev component render but are missing from your branch. Add them.

  • specs/7/7zip/7z-dont-echo-password.diff
  • specs/a/aurorae/README.md
  • specs/b/blosc/blosc-CMake4.0.patch
  • specs/c/cinnamon/Use_DesktopAppInfo_from_GioUnix.patch
  • specs/c/cinnamon/fix_mount_applet.patch
  • specs/c/colm/colm-libfsm-ac_check_lib.diff
  • specs/c/cpp-httplib/cpp-httplib-cpp11-test.patch
  • specs/c/cpp-httplib/cpp-httplib-test-issue2301-online.patch
  • specs/d/dejavu-fonts/.fmf/version
  • specs/d/dejavu-fonts/57-dejavu-sans-fonts.xml
  • specs/d/dejavu-fonts/57-dejavu-sans-mono-fonts.xml
  • specs/d/dejavu-fonts/57-dejavu-serif-fonts.xml
  • specs/d/dejavu-fonts/58-dejavu-lgc-sans-fonts.xml
  • specs/d/dejavu-fonts/58-dejavu-lgc-sans-mono-fonts.xml
  • specs/d/dejavu-fonts/58-dejavu-lgc-serif-fonts.xml
  • specs/d/dejavu-fonts/plans/dejavu-lgc-sans-fonts.fmf
  • specs/d/dejavu-fonts/plans/dejavu-lgc-sans-mono-fonts.fmf
  • specs/d/dejavu-fonts/plans/dejavu-lgc-serif-fonts.fmf
  • specs/d/dejavu-fonts/plans/dejavu-sans-fonts.fmf
  • specs/d/dejavu-fonts/plans/dejavu-sans-mono-fonts.fmf
  • specs/d/dejavu-fonts/plans/dejavu-serif-fonts.fmf
  • specs/d/dhcpcd/roy-marples.name.asc
  • specs/d/dns-root-data/registry-admin.key
  • specs/d/dnsmasq/dnsmasq-2.92-dnssec-wildcard.patch
  • specs/d/dos2unix/38C1F572B12725BE.asc
  • specs/e/ed/antoniodiazdiaz-keyring.asc
  • specs/e/ethtool/ethtool-netlink-fix-missing-headers.diff
  • specs/f/ffmpeg/ffmpeg-CVE-2025-22921.patch
  • specs/f/ffmpeg/ffmpeg-support-evc-base-libraries.patch
  • specs/f/fontawesome-fonts/60-fontawesome-6-brands-fonts.conf
  • specs/f/fontawesome-fonts/60-fontawesome-6-free-fonts.conf
  • specs/f/fontawesome-fonts/changelog
  • specs/f/fontforge/Fix_Splinefont_shell_invocation.patch
  • specs/g/geometry-hpp/geometry-hpp-optional-benchmarks.patch
  • specs/g/ghc-Glob/Glob-0.10.2.cabal
  • specs/g/ghc-HTTP/HTTP-4000.4.1.cabal
  • specs/g/ghc-HaXml/HaXml-1.25.14.cabal
  • specs/g/ghc-Only/Only-0.1.cabal
  • specs/g/ghc-aeson/aeson-2.2.3.0.cabal
  • specs/g/ghc-asn1-encoding/asn1-encoding-0.9.6.cabal
  • specs/g/ghc-assoc/assoc-1.1.1.cabal
  • specs/g/ghc-async/async-2.2.5.cabal
  • specs/g/ghc-attoparsec-iso8601/attoparsec-iso8601-1.1.1.0.cabal
  • specs/g/ghc-attoparsec/attoparsec-0.14.4.cabal
  • specs/g/ghc-base16-bytestring/base16-bytestring-1.0.2.0.cabal
  • specs/g/ghc-base64-bytestring/base64-bytestring-1.2.1.0.cabal
  • specs/g/ghc-bifunctors/bifunctors-5.6.2.cabal
  • specs/g/ghc-blaze-html/blaze-html-0.9.2.0.cabal
  • specs/g/ghc-blaze-markup/blaze-markup-0.8.3.0.cabal
  • specs/g/ghc-bsb-http-chunked/bsb-http-chunked-0.0.0.4.cabal

… and 219 more file(s).

Files to remove

These files are in your branch but are not produced by render. Remove them.

  • specs/a/azurelinux-release/proc-version-override.service
  • specs/a/azurelinux-release/proc-version-override.sh
  • specs/c/chromium/0001-Add-PPC64-support-for-boringssl.patch
  • specs/c/chromium/0001-Add-ppc64-target-to-libaom.patch
  • specs/c/chromium/0001-Add-pregenerated-config-for-libaom-on-ppc64.patch
  • specs/c/chromium/0001-Enable-ppc64-pointer-compression.patch
  • specs/c/chromium/0001-Force-baseline-POWER8-AltiVec-VSX-CPU-features-when-.patch
  • specs/c/chromium/0001-Implement-support-for-PPC64-on-Linux.patch
  • specs/c/chromium/0001-Implement-support-for-ppc64-on-Linux.patch
  • specs/c/chromium/0001-add-xnn-ppc64el-support.patch
  • specs/c/chromium/0001-sandbox-Enable-seccomp_bpf-for-ppc64.patch
  • specs/c/chromium/0001-swiftshader-fix-build.patch
  • specs/c/chromium/0001-third_party-angle-Include-missing-header-cstddef-in-.patch
  • specs/c/chromium/0001-third_party-libvpx-Properly-generate-gni-on-ppc64.patch
  • specs/c/chromium/0001-third_party-pffft-Include-altivec.h-on-ppc64-with-SI.patch
  • specs/c/chromium/0002-Add-PPC64-generated-files-for-boringssl.patch
  • specs/c/chromium/0002-Add-ppc64-trap-instructions.patch
  • specs/c/chromium/0002-regenerate-xnn-buildgn.patch
  • specs/c/chromium/0002-third_party-libvpx-Remove-bad-ppc64-config.patch
  • specs/c/chromium/0002-third_party-lss-kernel-structs.patch
  • specs/c/chromium/0003-third_party-libvpx-Add-ppc64-generated-config.patch
  • specs/c/chromium/0004-third_party-crashpad-port-curl-transport-ppc64.patch
  • specs/c/chromium/0004-third_party-libvpx-work-around-ambiguous-vsx.patch
  • specs/c/chromium/0009-sandbox-ignore-byte-span-error.patch
  • specs/c/chromium/HACK-debian-clang-disable-base-musttail.patch
  • specs/c/chromium/HACK-debian-clang-disable-pa-musttail.patch
  • specs/c/chromium/HACK-third_party-libvpx-use-generic-gnu.patch
  • specs/c/chromium/README.fedora
  • specs/c/chromium/Rtc_base-system-arch.h-PPC.patch
  • specs/c/chromium/add-ppc64-architecture-string.patch
  • specs/c/chromium/add-ppc64-architecture-to-extensions.diff
  • specs/c/chromium/add-ppc64-pthread-stack-size.patch
  • specs/c/chromium/chromium-107-proprietary-codecs.patch
  • specs/c/chromium/chromium-108-system-opus.patch
  • specs/c/chromium/chromium-115-initial_prefs-etc-path.patch
  • specs/c/chromium/chromium-117-widevine-other-locations.patch
  • specs/c/chromium/chromium-117-workaround_for_crash_on_BTI_capable_system.patch
  • specs/c/chromium/chromium-118-dma_buf_export_sync_file-conflict.patch
  • specs/c/chromium/chromium-118-sigtrap_system_ffmpeg.patch
  • specs/c/chromium/chromium-121-system-libxml.patch
  • specs/c/chromium/chromium-122-clang-build-flags.patch
  • specs/c/chromium/chromium-123-fstack-protector-strong.patch
  • specs/c/chromium/chromium-123-screen-ai-service.patch
  • specs/c/chromium/chromium-124-el8-arm64-memory_tagging.patch
  • specs/c/chromium/chromium-124-qt6.patch
  • specs/c/chromium/chromium-127-aarch64-duplicate-case-value.patch
  • specs/c/chromium/chromium-127-el8-ifunc-header.patch
  • specs/c/chromium/chromium-130-hardware_destructive_interference_size.patch
  • specs/c/chromium/chromium-131-fix-qt-ui.pach
  • specs/c/chromium/chromium-132-el8-unsupport-rustc-flags.patch

… and 262 more file(s).

@reubeno reubeno changed the title [Not ready] feat(image-tests): initial pytest-based static image validation feat(image-tests): initial pytest-based static image validation Apr 30, 2026
@reubeno reubeno marked this pull request as ready for review May 1, 2026 15:47
@reubeno reubeno requested a review from ddstreetmicrosoft as a code owner May 1, 2026 15:47
Copilot AI review requested due to automatic review settings May 1, 2026 15:47
@reubeno reubeno requested a review from christopherco as a code owner May 1, 2026 15:47
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an initial pytest-based framework for offline/static validation of built Azure Linux VM and container images, and wires it into azldev via a new static-image-checks test suite defined in base/images/images.toml.

Changes:

  • Introduces a standalone pytest project under base/images/tests/ (pyproject + plugin) with custom CLI options, marker logic, and native-tool preflight checks.
  • Adds utilities for mounting/extracting images (VM via libguestfs, containers via skopeo+umoci) and parsing common metadata (os-release, rpm package list, disk partitions).
  • Adds a small starter set of shared and image-specific pytest cases, and attaches the suite to vm-base and container-base images.

Reviewed changes

Copilot reviewed 17 out of 20 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
base/images/tests/utils/types.py Adds dataclasses for disk/partition metadata shared across fixtures/tests.
base/images/tests/utils/tools.py Adds native-tool registry + PATH preflight helpers and a CLI status command.
base/images/tests/utils/pytest_plugin.py Implements pytest plugin: CLI options, markers, tool preflight, and auto image-dir test routing.
base/images/tests/utils/parsers.py Adds parsers for /etc/os-release and rpm package queries via rpm --root.
base/images/tests/utils/extract.py Implements VM mount (guestmount) and container rootfs extraction (skopeo+umoci) plus cleanup helpers.
base/images/tests/utils/disk.py Adds VM disk inspection via virt-inspector and XML parsing into dataclasses.
base/images/tests/utils/init.py Declares utils as a package for the installed pytest plugin/utilities.
base/images/tests/pyproject.toml Defines the pytest project, dependencies, and registers the pytest11 entry point.
base/images/tests/conftest.py Provides session-scoped fixtures for image inputs, rootfs access, and parsed metadata.
base/images/tests/cases/vm-base/test_partitions.py VM-specific partition layout checks.
base/images/tests/cases/vm-base/test_kernel.py VM-specific kernel modules presence check.
base/images/tests/cases/vm-base/init.py Package marker for vm-base test subdir.
base/images/tests/cases/test_packages.py Shared package presence/blocklist tests gated by capability.
base/images/tests/cases/test_os_release.py Shared /etc/os-release validation tests.
base/images/tests/cases/container-base/test_container.py Container-specific kernel-module exclusion check.
base/images/tests/cases/container-base/init.py Package marker for container-base test subdir.
base/images/tests/cases/init.py Package marker for shared cases directory.
base/images/tests/README.md Documents invocation via azldev/manual runs, layout, fixtures, and tool prerequisites.
base/images/tests/.gitignore Ignores per-suite virtualenv/cache/work artifacts and uv.lock.
base/images/images.toml Wires static-image-checks into vm-base/container-base and defines the pytest suite config.

Comment on lines +118 to +124
rc = subprocess.run(
["buildah", "unshare", "rm", "-rf", str(p)],
check=False,
capture_output=True,
text=True,
)
if rc.returncode != 0:
Copy link

Copilot AI May 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

subprocess.run(["buildah", ...]) will raise FileNotFoundError if buildah isn't installed (even with check=False), which would error the entire session during teardown. Since this cleanup path runs for all images (including VM-only runs where buildah isn't preflight-checked), wrap the call in try/except FileNotFoundError and fall back to shutil.rmtree, or gate the buildah path behind an availability check (e.g., shutil.which).

Suggested change
rc = subprocess.run(
["buildah", "unshare", "rm", "-rf", str(p)],
check=False,
capture_output=True,
text=True,
)
if rc.returncode != 0:
use_fallback_cleanup = True
if shutil.which("buildah") is not None:
rc = subprocess.run(
["buildah", "unshare", "rm", "-rf", str(p)],
check=False,
capture_output=True,
text=True,
)
use_fallback_cleanup = rc.returncode != 0
if use_fallback_cleanup:

Copilot uses AI. Check for mistakes.

Test selection follows standard pytest positional arguments. Tests
under `cases/<image-name>/` auto-skip when `--image-name` doesn't match
(via the `image` marker, applied in each subdirectory's `conftest.py`).
Copy link

Copilot AI May 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The README says image-specific tests are restricted via an image marker "applied in each subdirectory's conftest.py", but the implementation actually auto-applies the marker in utils.pytest_plugin.pytest_collection_modifyitems (and there are no per-subdir conftest files). Update this description to match the actual mechanism to avoid confusing contributors.

Suggested change
(via the `image` marker, applied in each subdirectory's `conftest.py`).
(via the `image` marker, auto-applied during collection by
`utils.pytest_plugin.pytest_collection_modifyitems`).

Copilot uses AI. Check for mistakes.
Comment on lines +168 to +171
from pathlib import Path

for item in items:
parts = Path(str(item.fspath)).parts
Copy link

Copilot AI May 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

item.fspath is the legacy py.path API and is deprecated in newer pytest versions (the modern attribute is item.path, a pathlib.Path). Using item.path here will avoid deprecation warnings and future breakage while keeping the same behavior.

Suggested change
from pathlib import Path
for item in items:
parts = Path(str(item.fspath)).parts
for item in items:
parts = item.path.parts

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants