ci(molecule): fail the run when a scenario has molecule's prerun on #479

Merged
Defame1297 merged 1 commits from ci/452-prerun-check into main 2026-11-29 17:49:48 +00:00
Owner

What and why

Closes #452

check_scenarios_load_checkout.py now merges the base config .config/molecule/config.yml into each scenario the way molecule's CLI does, using molecule's own lookup_config_file(LOCAL_CONFIG_SEARCH) and passing the result as args["base_config"]. Without that, prerun set in the base config was never seen. A scenario fails unless the merged prerun is false, and the error names the scenario and the base config, or says the base config was not found.

The Held line of the rule in .gitea/workflows/AGENTS.md and the comment in scripts/run_molecule_in_ci_image.sh now name this check. CI only, so there is no changelog fragment.

Verified

  • python -m unittest discover -s tests/scripts: 304 tests OK. The new cases are: a scenario with prerun: true fails, a missing base config fails, and a base config with prerun on fails. The existing test that a scenario loading the checkout first passes now runs against a base config with prerun: false, so it also covers the inherited case.
  • pre-commit run --all-files passes.
  • The script run over all 20 of the repository's scenarios exits 0.
  • A clean-context review against molecule 26.11.0's source found no blocking issues. It checked the lookup from the role directory and from the checkout root.
  • CI: this pull request's Molecule run.

Not verified

  • The tests now need git on PATH (git init in setUp).

  • I confirm third-party material is recorded in NOTICE and REUSE.toml, or there is none.

Assisted-by: Claude Code

## What and why Closes #452 `check_scenarios_load_checkout.py` now merges the base config `.config/molecule/config.yml` into each scenario the way molecule's CLI does, using molecule's own `lookup_config_file(LOCAL_CONFIG_SEARCH)` and passing the result as `args["base_config"]`. Without that, `prerun` set in the base config was never seen. A scenario fails unless the merged `prerun` is `false`, and the error names the scenario and the base config, or says the base config was not found. The *Held* line of the rule in `.gitea/workflows/AGENTS.md` and the comment in `scripts/run_molecule_in_ci_image.sh` now name this check. CI only, so there is no changelog fragment. ## Verified - `python -m unittest discover -s tests/scripts`: 304 tests OK. The new cases are: a scenario with `prerun: true` fails, a missing base config fails, and a base config with prerun on fails. The existing test that a scenario loading the checkout first passes now runs against a base config with `prerun: false`, so it also covers the inherited case. - `pre-commit run --all-files` passes. - The script run over all 20 of the repository's scenarios exits 0. - A clean-context review against molecule 26.11.0's source found no blocking issues. It checked the lookup from the role directory and from the checkout root. - CI: this pull request's Molecule run. ## Not verified - The tests now need `git` on PATH (`git init` in setUp). --- - [x] I confirm third-party material is recorded in `NOTICE` and `REUSE.toml`, or there is none. Assisted-by: Claude Code
Claude added this to the CI velocity (emergency) milestone 2026-11-29 17:02:44 +00:00
Claude added 1 commit 2026-11-29 17:02:45 +00:00
ci(molecule): fail the run when a scenario has molecule's prerun on
Build / build (pull_request) Successful in 37s
Lint / lint (pull_request) Successful in 5m15s
Molecule / molecule (pull_request) Successful in 36m0s
49afd900dc
check_scenarios_load_checkout.py now merges the base config the way
molecule's CLI does (its own lookup of .config/molecule/config.yml) and
fails a scenario whose merged prerun is not false, naming the base
config. Before, it built Config with no base config, so a scenario that
turned prerun back on, or a moved base config, slowed every run and
nothing failed.

Closes #452

Assisted-by: Claude Code
CODEOWNERS rules requested review from Defame1297 2026-11-29 17:02:45 +00:00
Defame1297 scheduled this pull request to auto merge when all checks succeed 2026-11-29 17:48:46 +00:00
Defame1297 approved these changes 2026-11-29 17:49:38 +00:00
Dismissed
Defame1297 approved these changes 2026-11-29 17:49:43 +00:00
Defame1297 merged commit 14c7dde464 into main 2026-11-29 17:49:48 +00:00
Defame1297 deleted branch ci/452-prerun-check 2026-11-29 17:49:51 +00:00
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mortis/Kamino#479