Skip to content

Consolidate test workflow infrastructure in CI#3254

Open
C-Achard wants to merge 6 commits intomainfrom
cy/centralize-test-workflow
Open

Consolidate test workflow infrastructure in CI#3254
C-Achard wants to merge 6 commits intomainfrom
cy/centralize-test-workflow

Conversation

@C-Achard
Copy link
Copy Markdown
Collaborator

@C-Achard C-Achard commented Mar 23, 2026

Summary

This PR consolidates CI test execution so that dependency installation and test/script execution live in a single reusable workflow, instead of being split across multiple jobs with partially duplicated setup logic and different dependencies.
The main goal is to reduce drift between the fast/targeted lane and the full matrix lane, while preserving the current intelligent test-selection behavior.

Requires

Motivation

Before this change, CI test execution was spread across two workflows/jobs:

  • the fast lane installed and ran tests/scripts one way
  • the full matrix installed and ran them another way

This made it easy for the two paths to drift over time, especially around:

  • Python/package dependency installation
  • TensorFlow-related setup
  • system dependencies such as ffmpeg
  • how pytest and functional scripts were invoked

In practice, this meant the fast lane could fail for environment reasons that were unrelated to the code under test, simply because its runtime setup no longer matched the full test workflow.
This PR addresses that by making the reusable Python test workflow the single place where CI test environments are setup and where pytest / functional scripts are executed.

What changed

CI architecture

Refactored the reusable Python test workflow so it can serve both:

  • full matrix execution
  • targeted/fast execution

Updated the intelligent test-selection workflow so it acts primarily as a planner/router:

  • it still determines whether to run skip, docs, fast, or full
  • but it now delegates actual test execution to the shared reusable workflow

Dependency/setup consolidation

  • Centralized dependency installation in one location (ffmpeg installation notably)

This PR does not change the high-level test selection policy itself.
In particular:

  • the selector still decides between skip, docs, fast, and full
  • full-suite triggers remain unchanged
  • category-based routing remains unchanged

@C-Achard C-Achard self-assigned this Mar 23, 2026
@C-Achard C-Achard added tests dependencies Pull requests that update a dependency file CI Related to CI/CD jobs and automated testing labels Mar 23, 2026
@C-Achard C-Achard requested a review from Copilot March 23, 2026 18:24
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR consolidates Python CI test execution so both the targeted “fast” lane and the full matrix run through the same reusable workflow, reducing duplicated setup logic and drift between lanes.

Changes:

  • Refactors the reusable python-package.yml workflow to accept a JSON-defined matrix and to run either full-suite or targeted pytest/functional selections.
  • Updates intelligent-testing.yml to delegate fast and full execution to the reusable workflow instead of running bespoke steps.
  • Updates selector documentation/comments to reflect the “mode/workflow” terminology.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
tools/test_selector.py Updates selector documentation/comments to align with the refactored CI execution model.
.github/workflows/python-package.yml Makes the reusable test workflow parameter-driven (matrix + selected tests) and centralizes installs/execution.
.github/workflows/intelligent-testing.yml Converts fast/full lanes into calls to the shared reusable workflow with appropriate inputs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@C-Achard C-Achard requested a review from deruyter92 March 24, 2026 16:19
@C-Achard C-Achard marked this pull request as ready for review March 25, 2026 16:04
Base automatically changed from jaap/reformat_codebase to main March 30, 2026 16:45
@C-Achard C-Achard added the lint required Please run pre-commit hooks to ensure your formatting is up-to-date label Mar 30, 2026
Replace inline fast/full test job steps with the reusable ./.github/workflows/python-package.yml workflow as the dedicated "running test" workflow and add support for targeted test execution. Introduces new inputs (matrix_json, pytest_paths_json, functional_scripts_json, full_suite) so fast-tests can run a targeted pytest/functional subset while full-tests run a full matrix. Also cleans up shells/flags, installs ffmpeg non-interactively, consolidates TensorFlow installs per-OS, and adds platform-aware filtering for TensorFlow functional scripts to avoid running unsupported combinations on Windows. This centralizes CI logic and makes test selection configurable and DRY.
Update documentation and comments to replace ambiguous "lane" terminology with clearer wording and refine output descriptions. Changes include: swapping "lane" for "mode" in the module docstring, rewording the GitHub output help text for run_skip/run_docs/run_fast/run_full to better describe their intent (docs build, targeted tests, full suite/matrix), and clarifying the LaneSelection.fast comment to mention targeted pytest + optional functional scripts in the test workflow. No functional logic changes.
Normalize indentation for the fast-tests and full-tests job blocks in .github/workflows/intelligent-testing.yml. The changes adjust whitespace only (reindent job keys like name, needs, uses, with, etc.) for consistent YAML formatting; no functional changes to workflow logic or inputs.
@C-Achard C-Achard force-pushed the cy/centralize-test-workflow branch from 07b1bb5 to 623a3d4 Compare March 30, 2026 18:11
@C-Achard
Copy link
Copy Markdown
Collaborator Author

Rebased as per #3263

@C-Achard C-Achard removed the lint required Please run pre-commit hooks to ensure your formatting is up-to-date label Mar 30, 2026
@deruyter92
Copy link
Copy Markdown
Collaborator

@C-Achard, I've opened two small PRs targeting this branch: #3266 #3265
These could improve the consolidation even further a bit. Let me know what you think. Let's discuss

deruyter92 and others added 2 commits March 31, 2026 11:37
…3265)

* Update CI: Change windows ffmpeg installation from build instead of chocolatey

* Update .github/workflows/python-package.yml

Co-authored-by: Cyril Achard <cyril.achard@epfl.ch>

* Update .github/workflows/python-package.yml

Co-authored-by: Cyril Achard <cyril.achard@epfl.ch>

* Update .github/workflows/python-package.yml

Co-authored-by: Cyril Achard <cyril.achard@epfl.ch>

---------

Co-authored-by: Cyril Achard <cyril.achard@epfl.ch>
…3266)

* update format.yml workflow: fix checkout for forked PRs

* Limit workflow permissions and checkout creds

Restrict the workflow to read-only access and prevent persisting checkout credentials. Adds permissions.contents: read and sets actions/checkout persist-credentials: false to avoid exposing the default GITHUB_TOKEN and set clear permissions.

---------

Co-authored-by: Cyril Achard <cyril.achard@epfl.ch>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI Related to CI/CD jobs and automated testing dependencies Pull requests that update a dependency file tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants