ci(molecule): run two scenarios at a time by default

A full run on main took 34 minutes with 2 lanes and 35 with 4: with 4 every scenario ran
about twice as slowly, so the runner is full at two, and two leave it room for pull request
jobs. The duration list now holds the 2-lane run's times and adds nfs_client.

Closes #432

Assisted-by: Claude Code
This commit is contained in:
Defame1297 committed 2026-11-28 23:23:45 +00:00
1 parent 716baa19c7
commit 40d5c49e33
2 files changed
+24 -22

No files matched your search

+23 -21
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
# The Molecule workflow's "Run the scenarios" step: `molecule test` for each scenario directory on
# stdin, MOLECULE_LANES (default 4, also when empty) at a time, longest first, each with its own
# stdin, MOLECULE_LANES (default 2, also when empty) at a time, longest first, each with its own
# log and ANSIBLE_HOME under <work-dir>/<n>/ (no collection is installed there:
# .config/molecule/config.yml sets prerun false).
# Exit 1 on a failure.
@@ -8,7 +8,8 @@
# scripts/run_molecule_scenarios.sh <work-dir> < scenario-dirs
set -euo pipefail
lanes="${MOLECULE_LANES:-4}"
# 2: the runner is full at two; a full run took as long with 4 lanes, each scenario twice as slow.
lanes="${MOLECULE_LANES:-2}"
if ! [[ "$lanes" =~ ^[1-9][0-9]*$ ]]; then
echo "MOLECULE_LANES must be a positive integer, not '$lanes'" >&2
exit 2
@@ -83,25 +84,26 @@ mkdir -p "$work"
# `finished <label>: exit 0 after S s` lines, each label mapped back to its directory. A scenario
# missing here is assumed long and starts first.
declare -A last_seconds=(
[roles/system_baseline/molecule/default]=1127
[roles/ufw/molecule/default]=907
[roles/traefik/molecule/default]=886
[roles/gitea_runner/molecule/default]=762
[roles/cloudflared/molecule/default]=673
[roles/docker/molecule/default]=612
[roles/tailscale/molecule/default]=509
[roles/fail2ban/molecule/default]=337
[roles/systemd_hardening/molecule/default]=335
[roles/gitea/molecule/default]=301
[roles/user_management/molecule/default]=270
[roles/_binary_update/molecule/default]=248
[roles/pihole/molecule/default]=228
[roles/sshd/molecule/default]=163
[roles/pve_lxc/molecule/default]=157
[roles/network_interfaces/molecule/default]=129
[roles/_binary_update/molecule/check_mode]=81
[extensions/molecule/image-smoke]=47
[extensions/molecule/image-smoke-2604]=46
[roles/system_baseline/molecule/default]=568
[roles/ufw/molecule/default]=525
[roles/traefik/molecule/default]=484
[roles/gitea_runner/molecule/default]=398
[roles/docker/molecule/default]=352
[roles/cloudflared/molecule/default]=305
[roles/tailscale/molecule/default]=220
[roles/fail2ban/molecule/default]=161
[roles/gitea/molecule/default]=137
[roles/systemd_hardening/molecule/default]=134
[roles/_binary_update/molecule/default]=132
[roles/nfs_client/molecule/default]=126
[roles/user_management/molecule/default]=115
[roles/pihole/molecule/default]=112
[roles/sshd/molecule/default]=65
[roles/pve_lxc/molecule/default]=44
[roles/_binary_update/molecule/check_mode]=42
[roles/network_interfaces/molecule/default]=36
[extensions/molecule/image-smoke]=25
[extensions/molecule/image-smoke-2604]=21
)
# The indices of dirs in start order; ties keep the selection order (a stable sort).
mapfile -t start_order < <(