Move unit tests to a 'unit tests' stage

Created on 27 March 2025, 7 months ago

Problem/Motivation

We moved unit tests to the 'lint' stage to allow immediate testing on multiple PHP versions without having to run the entire pipeline.

However someone in slack (can't remember who, it was a couple of weeks ago) suggested moving them to their own stage, this would help for two reasons:

1. We can set that stage to not block the other tests, this would allow functional/kernel tests to run even if unit tests fail and if/when unit tests are slower than the lint steps the overall pipeline would finish quicker.

2. The stage name would be more accurate.

3. It might look nicer in the gitlab UI, we'll find out.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

📌 Task
Status

Active

Version

11.0 🔥

Component

phpunit

Created by

🇬🇧United Kingdom catch

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @catch
  • 🇮🇹Italy mondrake 🇮🇹

    Related, 📌 [PP-1][CI] Spin off Drupal Components tests in a job of their own Postponed .

    We are talking about a job stage, not a child pipeline here, right?

  • 🇬🇧United Kingdom catch

    Yeah just a job stage. Also we should explicitly postpone this issue on that one.

  • 🇦🇺Australia mstrelan

    Thanks for opening this, I was the one who suggested this in Slack. I had a bit of a tinker but I couldn't figure out the relationship between the child pipeline and the initial stage(s). Will be following this issue.

  • 🇮🇹Italy mondrake 🇮🇹

    Somehow though, this will reopen the discussion from #3484966-6: Allow executing unit tests on multiple PHP images without having to duplicate unit tests across all environment combinations because then the tests results will be split in two places - the 'main' pipeline for unit tests and the children pipelines for kernel/functional/etc.

    https://gitlab.com/gitlab-org/gitlab/-/issues/363019 is the upstream issue to keep watching - still no timeline there.

  • 🇬🇧United Kingdom catch

    My idea here was a separate stage without a child pipeline.

    However I think what @mstrelan is referring to is that the child pipeline depends on the entire parent pipeline, not a stage, so yeah it's (inadvertently) re-opening that discussion because I forgot this is hard to do.

  • 🇮🇹Italy mondrake 🇮🇹

    Blocker went in.

  • 🇮🇹Italy mondrake 🇮🇹

    Here's another GitLab upstream issue to watch for child/parent pipeline relationship https://gitlab.com/groups/gitlab-org/-/epics/4019, looks like it's actively pursued.

  • 🇫🇷France andypost

    After last mess with parent child access in Gitlab I find it bad idea to bet on getting artifacts/results from child pipeline

  • Merge request !12025Closes #3515704 → (Open) created by mondrake
  • Pipeline finished with Failed
    5 months ago
    Total: 646s
    #487546
  • 🇳🇱Netherlands bbrala Netherlands

    Agree with Andy. Might even advocate stop using child pipelines all together.

  • Pipeline finished with Failed
    5 months ago
    Total: 689s
    #487562
  • Pipeline finished with Success
    5 months ago
    Total: 771s
    #487567
  • 🇮🇹Italy mondrake 🇮🇹

    The MR is now splitting the unit tests in a stage of its own - still the new stage's jobs are set to start without waiting for the 'Lint' stage to end.

  • 🇳🇱Netherlands bbrala Netherlands

    Not sure why we would remove "Unit tests" from the title here, i understand it's now in a "Unit test" stage. But lets consider;

    - Running locally would mean running "Core on PHP 8.3"
    - If tests fail "Core on PHP 8.3" is the title of the job.
    - All other jobs are things like "PHPUnit Functional"

    I'd probably opt to call them something like:

    "Core Unit tests on PHP 8.3"
    "Component Unit tests on PHP 8.3"

    Or maybe:
    "PHPUnit Unit Core (PHP 8.3)"
    "PHPUnit Unit Components (PHP 8.3)"
    "Unit tests: Core (PHP 8.3)"
    "Unit tests: Components (PHP 8.3)"

    Know this is pretty nitpicky, but we are gonna look at those a lot :)

  • 🇳🇱Netherlands bbrala Netherlands
  • 🇮🇹Italy mondrake 🇮🇹

    Let’s have opinions on the best naming from #13 before making changes.

    Meanwhile, better wait for 🐛 [CI] Components tests coverage metrics differ by PHP version Active to get in.

  • 🇳🇱Netherlands bbrala Netherlands

    For the record. I'd pick:

    "Unit tests: Core (PHP 8.3)"
    "Unit tests: Components (PHP 8.3)"

  • Pipeline finished with Canceled
    5 months ago
    Total: 100s
    #492422
  • Pipeline finished with Success
    5 months ago
    Total: 541s
    #492426
  • Pipeline finished with Success
    5 months ago
    Total: 519s
    #492435
  • 🇮🇹Italy mondrake 🇮🇹
  • Pipeline finished with Failed
    5 months ago
    #499706
  • Pipeline finished with Failed
    5 months ago
    #499707
  • Pipeline finished with Failed
    5 months ago
    #499710
  • Pipeline finished with Failed
    5 months ago
    #499711
  • Pipeline finished with Failed
    5 months ago
    #499715
  • Pipeline finished with Failed
    5 months ago
    #499716
  • Pipeline finished with Failed
    5 months ago
    Total: 99s
    #499717
  • Pipeline finished with Failed
    5 months ago
    Total: 749s
    #499719
  • Status changed to Postponed 3 months ago
  • 🇮🇹Italy mondrake 🇮🇹
  • Pipeline finished with Failed
    14 days ago
    Total: 189s
    #610132
  • Pipeline finished with Failed
    13 days ago
    Total: 175s
    #610661
  • Pipeline finished with Failed
    13 days ago
    Total: 127s
    #610688
  • Pipeline finished with Failed
    13 days ago
    Total: 355s
    #610689
  • Pipeline finished with Failed
    13 days ago
    Total: 139s
    #610701
  • Pipeline finished with Failed
    13 days ago
    Total: 126s
    #610716
  • Pipeline finished with Failed
    13 days ago
    Total: 274s
    #610726
  • Pipeline finished with Failed
    13 days ago
    #610735
  • Pipeline finished with Failed
    13 days ago
    Total: 996s
    #610739
  • Pipeline finished with Success
    13 days ago
    Total: 600s
    #610758
  • Pipeline finished with Canceled
    13 days ago
    Total: 244s
    #610914
  • Pipeline finished with Success
    13 days ago
    Total: 6291s
    #610915
  • Status changed to Needs review 13 days ago
  • Pipeline finished with Success
    11 days ago
    #612557
Production build 0.71.5 2024