ci(molecule): start the longest scenarios first and pass the lane count in
Part of #432. A long scenario started late sets the end of a full run, so run_molecule_scenarios.sh now starts scenarios by the durations of the last full run, longest first, with an unlisted scenario first; the log groups keep the selection order. A workflow_dispatch input `lanes` reaches the script as MOLECULE_LANES, so full runs with different lane counts can be compared; an empty value keeps the default of 4. The shared molecule config enables ansible.posix.profile_tasks (summary only) and ansible.posix.timer, so each scenario's log shows where its time goes. Assisted-by: Claude Code
This commit is contained in:
1 parent
a2ab13a6e1
commit
ef840c8952
6 files changed
+123
-8
No files matched your search
@@ -24,7 +24,13 @@ on: # yamllint disable-line rule:truthy
|
||||
# drift in the others (a package mirror) would otherwise go unseen. After Renovate's 03:17 run.
|
||||
schedule:
|
||||
- cron: "43 4 * * *"
|
||||
workflow_dispatch: {}
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
lanes:
|
||||
description: Scenarios run at a time (empty for the default of run_molecule_scenarios.sh)
|
||||
required: false
|
||||
type: string
|
||||
default: ""
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
@@ -123,6 +129,8 @@ jobs:
|
||||
EVENT_NAME: ${{ github.event_name }}
|
||||
# The workflow only runs for pull requests to main; lint.yml uses the same constant.
|
||||
BASE_REF: origin/main
|
||||
# Empty outside a dispatch, which the run script reads as its default.
|
||||
MOLECULE_LANES: ${{ inputs.lanes }}
|
||||
run: |
|
||||
# The selector comes from the base branch, so a pull request cannot edit the rules it is
|
||||
# judged by (lint.yml does the same for check_bot_pr_diff.py); the first pull request that
|
||||
@@ -154,7 +162,7 @@ jobs:
|
||||
-v /var/run/docker.sock:/var/run/docker.sock -v "$docker_cli:/usr/local/bin/docker:ro" \
|
||||
-v "$ac_root:$ac_root" -v "$ac_root/passwd:/etc/passwd:ro" -w "$PWD" \
|
||||
-e "AC_ROOT=$ac_root" -e "HOME=$ac_root/home" -e "USER=$(id -un)" \
|
||||
-e MOLECULE_IMAGE -e MOLECULE_IMAGE_2604 -e KAMINO_RUN_ID \
|
||||
-e MOLECULE_IMAGE -e MOLECULE_IMAGE_2604 -e KAMINO_RUN_ID -e MOLECULE_LANES \
|
||||
"$CI_IMAGE" scripts/run_molecule_in_ci_image.sh <<< "$selected"
|
||||
|
||||
# A cancelled run can leave its containers running when the docker client is killed.
|
||||
|
||||
Reference in new issue
Block a user