Skip to content

Refactor the test examples to parametrize per installer type#1266

Open
lrandersson wants to merge 1 commit into
conda:mainfrom
lrandersson:dev-ra-838
Open

Refactor the test examples to parametrize per installer type#1266
lrandersson wants to merge 1 commit into
conda:mainfrom
lrandersson:dev-ra-838

Conversation

@lrandersson

Copy link
Copy Markdown
Contributor

Description

Solves #1146. The file test_examples.py runs every applicable installer type for an example in a single constructor call and loops over them, which interleaves build/run output and gives no test isolation. When one type fails, the others are masked or skipped, making CI failures painful to debug.

This PR adds the infrastructure to run each installer type as its own pytest item:

  • A flag --installer-type to allow testing a specific installer type via the CLI
  • Removes the for-loop for iterating over installer types - now uses pytest parametrization (which is based on the installer_types field in each example recipe).
  • For demonstrating the changes, this PR migrates only test_example_miniforge (split into miniforge and miniforge-mamba2, each parametrized over its own recipe's types).

The remaining example tests are intentionally left unchanged here to keep this PR small and easy to review. A follow-up PR is expected once this is approved and merged.

Checklist - did you ...

  • Add a file to the news directory (using the template) for the next release's release notes?
  • Add / update necessary tests?
  • Add / update outdated documentation?

@lrandersson lrandersson self-assigned this Jun 18, 2026
@conda-bot conda-bot added the cla-signed [bot] added once the contributor has signed the CLA label Jun 18, 2026
@github-project-automation github-project-automation Bot moved this to 🆕 New in 🔎 Review Jun 18, 2026
@lrandersson

Copy link
Copy Markdown
Contributor Author

We can now see in the macOS CI output (as an example):

tests/test_examples.py::test_example_miniforge[sh] PASSED                [ 18%]
tests/test_examples.py::test_example_miniforge[pkg] PASSED               [ 20%]
tests/test_examples.py::test_example_miniforge_mamba2[sh] PASSED         [ 22%]
tests/test_examples.py::test_example_miniforge_mamba2[pkg] PASSED        [ 24%]

@lrandersson lrandersson marked this pull request as ready for review June 18, 2026 16:13
@lrandersson lrandersson requested a review from a team as a code owner June 18, 2026 16:13
@lrandersson lrandersson changed the title Refactor the test examples to parametrize based on supported installer types Refactor the test examples to parametrize per installer type Jun 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed [bot] added once the contributor has signed the CLA

Projects

Status: 🆕 New

Development

Successfully merging this pull request may close these issues.

2 participants