[PP-1][CI] Spin off Drupal Components tests in a job of their own

Created on 1 November 2024, 5 months ago

Problem/Motivation

Follow-up of ๐Ÿ“Œ [CI] Introduce a separate stage for unit tests Active .

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

๐Ÿ“Œ Task
Status

Postponed

Version

11.0 ๐Ÿ”ฅ

Component

phpunit

Created by

๐Ÿ‡ฎ๐Ÿ‡นItaly mondrake ๐Ÿ‡ฎ๐Ÿ‡น

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

Merge Requests

Comments & Activities

  • Issue created by @mondrake
  • Merge request !10027Closes #3485069 โ†’ (Open) created by mondrake
  • Pipeline finished with Canceled
    5 months ago
    Total: 446s
    #326752
  • Pipeline finished with Failed
    5 months ago
    Total: 495s
    #326756
  • Pipeline finished with Failed
    5 months ago
    Total: 670s
    #346186
  • Pipeline finished with Failed
    5 months ago
    Total: 616s
    #346206
  • Pipeline finished with Failed
    5 months ago
    Total: 803s
    #346277
  • Pipeline finished with Failed
    5 months ago
    Total: 1098s
    #346303
  • Pipeline finished with Failed
    5 months ago
    Total: 682s
    #346318
  • Status changed to Active 26 days ago
  • ๐Ÿ‡ฎ๐Ÿ‡นItaly mondrake ๐Ÿ‡ฎ๐Ÿ‡น
  • Pipeline finished with Failed
    26 days ago
    Total: 768s
    #445016
  • Pipeline finished with Failed
    26 days ago
    Total: 553s
    #445026
  • Pipeline finished with Success
    26 days ago
    Total: 702s
    #445036
  • ๐Ÿ‡ฎ๐Ÿ‡นItaly mondrake ๐Ÿ‡ฎ๐Ÿ‡น
  • Pipeline finished with Success
    25 days ago
    Total: 405s
    #445860
  • Pipeline finished with Failed
    25 days ago
    Total: 1121s
    #446357
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    Unit tests are falling under linting stage now though?

  • ๐Ÿ‡ฎ๐Ÿ‡นItaly mondrake ๐Ÿ‡ฎ๐Ÿ‡น

    #5 yes, but not introduced here. See ๐Ÿ“Œ [CI] Introduce a separate stage for unit tests Active .

  • Pipeline finished with Canceled
    23 days ago
    Total: 113s
    #447807
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    Going to go on a limb and say letโ€™s try it

  • Pipeline finished with Success
    23 days ago
    Total: 11032s
    #447809
  • ๐Ÿ‡ช๐Ÿ‡ธSpain penyaskito Seville ๐Ÿ’ƒ, Spain ๐Ÿ‡ช๐Ÿ‡ธ, UTC+2 ๐Ÿ‡ช๐Ÿ‡บ

    Should we have a report on coverage with the artifacts generated, aside of the output?

  • Pipeline finished with Success
    23 days ago
    Total: 505s
    #447953
  • ๐Ÿ‡ฎ๐Ÿ‡นItaly mondrake ๐Ÿ‡ฎ๐Ÿ‡น

    #8 I tried to configure coverage reporting, but it does not seem to produce any effect?

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom catch

    Looks like this is still in progress.

  • Pipeline finished with Failed
    22 days ago
    Total: 539s
    #448674
  • Pipeline finished with Success
    22 days ago
    Total: 366s
    #448688
  • Pipeline finished with Failed
    22 days ago
    Total: 471s
    #448699
  • Pipeline finished with Failed
    22 days ago
    #448708
  • Pipeline finished with Failed
    22 days ago
    #448709
  • Pipeline finished with Canceled
    22 days ago
    Total: 455s
    #448904
  • ๐Ÿ‡ฎ๐Ÿ‡นItaly mondrake ๐Ÿ‡ฎ๐Ÿ‡น
  • Pipeline finished with Failed
    22 days ago
    Total: 127s
    #448910
  • Pipeline finished with Failed
    22 days ago
    Total: 457s
    #448913
  • ๐Ÿ‡ฎ๐Ÿ‡นItaly mondrake ๐Ÿ‡ฎ๐Ÿ‡น

    With regards to #8, we already have had coverage visualization configured in the MR.
    This is producing inline display of the covered line in the merge request diffs. It's not visible in this MR as it does include changes to components code, but an example is here: ๐Ÿ“Œ Introduce a @return-type-will-be-added annotation to indicate return type addition in next major; enforce with a PHPStan rule Active : in the MR visualization of changes https://git.drupalcode.org/project/drupal/-/merge_requests/10111/diffs#7... you can see that the covered code has a green sideline close to the line numbers.

    When it comes to summary metrics, IMHO the standard GitLab solution with adding a coverage key to the job yaml is insufficient, for the following reasons:

    1. trivial but annoying: it is not compatible with color output by PHPUnit's coverage text reporting. If you set --colors=always to PHPUnit CLI command, the coverage text report includes ANSI color codes that the regex in coverage cannot cope with.
    2. more importantly: the standard approach is limited to reporting line coverage only and averages results from different jobs - this would lead to meaningless figures if we were later to, say, have code coverage for core too as it will make simple average without any weighting etc.

    So I will try to take cue from the work in ๐Ÿ“Œ [CI] Report PHPStan baseline statistics in job Active , and see if with some postprocessing of the coverage text report, we can get a metrics report that can be more tuned to Drupal.

  • Pipeline finished with Failed
    22 days ago
    #448984
  • Pipeline finished with Failed
    22 days ago
    #448985
  • Pipeline finished with Canceled
    22 days ago
    Total: 379s
    #448986
  • Pipeline finished with Canceled
    22 days ago
    Total: 299s
    #449061
  • Pipeline finished with Success
    22 days ago
    Total: 490s
    #449065
  • Pipeline finished with Success
    22 days ago
    Total: 578s
    #449096
  • ๐Ÿ‡ฎ๐Ÿ‡นItaly mondrake ๐Ÿ‡ฎ๐Ÿ‡น

    Added a small script that processes PHPUnit's coverage text report into an OpenMetrics file with the relevant metrics included.

    See file attached with a screenshot of the resulting report in the MR.

  • ๐Ÿ‡ฎ๐Ÿ‡นItaly mondrake ๐Ÿ‡ฎ๐Ÿ‡น

    Added a small script that processes PHPUnit's coverage text report into an OpenMetrics file with the relevant metrics included.

    See file attached with a screenshot of the resulting report in the MR.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    Are the metrics suppose to be clickable?

  • ๐Ÿ‡ฎ๐Ÿ‡นItaly mondrake ๐Ÿ‡ฎ๐Ÿ‡น
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    Guess it's still neat to have that info though it would be cool to know what classes aren't being covered. Maybe would start a new initiative :)

    But having the info is a net improvement.

  • ๐Ÿ‡ฎ๐Ÿ‡นItaly mondrake ๐Ÿ‡ฎ๐Ÿ‡น

    #17 thatโ€™s just the summary. All the details are visible in the raw logs https://git.drupalcode.org/issue/drupal-3485069/-/jobs/4674359 and as artifacts.

    Obviously a code coverage analisys service (e.g. Codecov or the likes of it) would provide full interactive reporting, trends etc but I suppose itโ€™s well beyond the scope of this issue.

  • Pipeline finished with Success
    5 days ago
    Total: 466s
    #462190
Production build 0.71.5 2024