Skip to content

CI: fan out Azure pipelines on Python version (parallel matrix) - speedup x5#5013

Draft
GuillemSeCa wants to merge 1 commit into
aboutcode-org:developfrom
GuillemSeCa:ci/parallel-python-matrix
Draft

CI: fan out Azure pipelines on Python version (parallel matrix) - speedup x5#5013
GuillemSeCa wants to merge 1 commit into
aboutcode-org:developfrom
GuillemSeCa:ci/parallel-python-matrix

Conversation

@GuillemSeCa
Copy link
Copy Markdown
Contributor

Problem

In etc/ci/azure-posix.yml and etc/ci/azure-win.yml, python_versions are iterated as a sequential template loop inside a single job's steps:, instead of being part of strategy.matrix. So each (os, test_suite) runs all Python versions back-to-back on the same agent VM.

Two visible consequences:

  1. Long wall-clock time — e.g. ubuntu24_cpython all runs 3.10 → 3.11 → 3.12 → 3.13 → 3.14 in series (~10 min each = ~50 min total).
  2. Cascading skips — if the first Python version's tests fail (recently happened on the *_latest_from_pip matrix because of a click 8.2 error-message change), all later Python versions are marked skipped instead of also running, hiding whether they're affected too.

Example from a recent UV PR run:

Python Result
3.10 failed
3.11 skipped
3.12 skipped
3.13 skipped
3.14 skipped

Change

Move python_version into strategy.matrix (alongside test_suite) in both templates so each (python_version, test_suite) combination runs as its own parallel job on its own agent VM.

Matrix keys are of the form py3_10_all, py3_11_misc_and_scancode, etc. (Azure matrix keys must be alphanumeric+underscore, so dots in version strings are replaced).

No changes to caller pipelines in azure-pipelines.yml — the python_versions and test_suites parameters keep the same shape.

Tradeoffs

Aspect Before After
Wall-clock for ubuntu24_cpython all (5 pyvers) ~50 min ~10 min
Visibility of multi-version failures Stops at first fail All versions reported
Concurrent agent slots needed 1 per (os, suite) N per (os, suite), where N = #pyvers
Setup overhead Configure once per agent Configure per (pyver, suite) pair

⚠️ Capacity caveat: This expands the total number of concurrent jobs. The free Azure DevOps OSS tier provides ~10 concurrent agents. If the project's available concurrency can't absorb the fan-out, jobs will queue instead of running in parallel and overall wall-clock won't improve. Maintainers should confirm available capacity before merging.

Marked as draft for that reason — merge at your discretion.

Guillem Serra Cazorla gserracazorla@gmail.com

Previously, each (os, test_suite) pair ran as a single Azure Pipelines
job and iterated over python_versions as a template loop inside that
job's steps:

    strategy:
        matrix:
            <test_suite>: {...}
    steps:
        - ${{ each pyver in parameters.python_versions }}:
            - install python pyver
            - configure
            - run test_suite

Consequence: all Python versions for a given (os, test_suite) ran
sequentially on the same agent. If the first Python version failed
(e.g. an env-specific test failure on the *_latest_from_pip matrix),
all subsequent Python versions were skipped instead of also running
and showing whether they were affected.

Move python_version into the strategy.matrix so each
(python_version, test_suite) combination runs as its own parallel
job on its own agent VM. Each job becomes shorter (one Python
install + configure + test run instead of N of each) and an issue
affecting one Python version no longer hides results for the others.

Matrix keys are of the form 'py3_10_all' / 'py3_11_misc_and_scancode'
etc. (matrix keys must be alphanumeric+underscore, so dots in version
strings are replaced).

No changes to the per-job test command or to the caller pipelines in
azure-pipelines.yml -- the python_versions and test_suites parameters
keep the same shape.

Signed-off-by: Guillem Serra Cazorla <gserracazorla@gmail.com>
@GuillemSeCa GuillemSeCa force-pushed the ci/parallel-python-matrix branch from 8a3752d to 175da9b Compare May 18, 2026 13:38
@GuillemSeCa GuillemSeCa changed the title CI: fan out Azure pipelines on Python version (parallel matrix) - speedup x10 CI: fan out Azure pipelines on Python version (parallel matrix) - speedup x5 May 18, 2026
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.

1 participant