Problem/Motivation

As per slack conversation here https://drupal.slack.com/archives/C03P8AM3B0Q/p1700075674883899

It'd be great if the test-only job would be easier/quicker to access, instead of waiting for the first steps of the pipeline and the first child pipeline to start running, to be able to trigger it.

This was also made worse by the need of constant rebases, but that was addressed and fixed here #3401971: Test-only job shouldn't require constant rebases to detect which files were changed.

Steps to reproduce

Try to run the test-only job for any MR... then think how it could be improved

Proposed resolution

Maybe have a "Test-only (defaults)" job in the parent pipeline that can be triggered as soon as the pipeline is open, and that will use the default PHP and DB version. For individual "Test-only" jobs, you can still go to each child pipeline and then trigger it from there.

Remaining tasks

MR

User interface changes

API changes

Data model changes

Release notes snippet

Issue fork drupal-3402203

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

fjgarlin created an issue. See original summary.

fjgarlin’s picture

StatusFileSize
new160.98 KB

This is what I suggest.
pipeline

The Test-only job would be accessible straightaway when opening the main pipeline, so you don’t need to navigate to the children ones (where it’s still available).

I also renamed the jobs so that the DEFAULT - … ones are always on top.

Pipeline: https://git.drupalcode.org/issue/drupal-3402203/-/pipelines/51092

The code is just a POC put together, far from the final version, so no need to check the code yet, just functionality.
Feedback is welcome whether this is an improvement or not.

catch’s picture

I like the idea of an easily accessible version in the parent pipeline.

longwave’s picture

+1 this makes it much easier to find.

fjgarlin’s picture

Title: [Investigation] See if the test-only job can be made easier to trigger » Improve the test-only job workflow
Status: Active » Needs review

I am going to go ahead and put this as "Needs review".

I tried at first to not repeat yml template blocks, but gitlabci does not expand anchors from included files, nor allows "!reference" in the ways that we need them here.

I still simplified as much as possible the new "Test only" pipeline and was able to abstract/reuse two big blocks of code into bash files. I think this actually makes some bits easier to maintain and that way we don't need to repeat the code in more places.

https://git.drupalcode.org/issue/drupal-3402203/-/pipelines/52966 contains one run with changes to test files (to test the new test-only pipeline).

Feedback is welcomed.

smustgrave’s picture

Status: Needs review » Needs work

Wanted to say we just added this feature and people just started finding out where it is, Moving it may cause some confusion.

Moving to NW because before I could click into the PHP8.2 and Mysql8 job and run the test-only feature there. Now that it's out of that job what parameters is it running with? Sometimes we may want to run with different versions.

fjgarlin’s picture

Status: Needs work » Needs review

We are not "moving" it. We are adding a new one in a more convenient place.

The "old" ones will remain where they are, unchanged, and the "new" one is just placed in a handy location to trigger it quicker with the same default DB and PHP versions as the default pipeline. I just added the versions to the name to make it more obvious anyway.

You can still run the "Test-only" job for any of the other versions of PHP+DB.

Marking as "Needs review" again hoping that I answered your question.

smustgrave’s picture

It'll be a longer string but can the label be updated to include what the "Default" test-only is running with. Default test will change and I'm not sure it's going to be clear to people what test-only default ran with.

fjgarlin’s picture

StatusFileSize
new92.99 KB

I did exactly that in the last commit here: https://git.drupalcode.org/project/drupal/-/merge_requests/5435/diffs?co...

-'DEFAULT: Test-only':
+'DEFAULT: Test-only (PHP 8.2 MySQL 8):'

Example of what I meant before, the "new" one and also the current ones (ie: for SQLite):
pipeline

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

In that case think this is good.

longwave’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs reroll

Looks good and I was about to commit but this now needs rebasing against 11.x.

fjgarlin’s picture

Status: Needs work » Reviewed & tested by the community

Rebased and pipeline running: https://git.drupalcode.org/issue/drupal-3402203/-/pipelines/54183

Marking as RTBC as that was the previous state. The conflict on rebase was on #3403420: Test reports contain absolute path and link leads nowhere, which is applied in this one after the rebase (and in the new pipeline file too).

longwave’s picture

Version: 11.x-dev » 10.2.x-dev
Status: Reviewed & tested by the community » Fixed
Issue tags: -Needs reroll

Committed and pushed 0d44d1f7b0 to 11.x and 8f5fa56905 to 10.2.x. Thanks!

  • longwave committed 8f5fa569 on 10.2.x
    Issue #3402203 by fjgarlin: Improve the test-only job workflow
    
    (cherry...

  • longwave committed 0d44d1f7 on 11.x
    Issue #3402203 by fjgarlin: Improve the test-only job workflow
    
longwave’s picture

Version: 11.x-dev » 10.2.x-dev
Status: Reviewed & tested by the community » Fixed
Issue tags: -Needs reroll

fjgarlin’s picture

Version: 10.2.x-dev » 11.x-dev
Status: Fixed » Needs review

The very last commit I made was lost on the rebase (my bad), so here is a new MR that brings it back: https://git.drupalcode.org/project/drupal/-/merge_requests/5588/diffs

Please review.

longwave’s picture

Status: Needs review » Fixed

Committing from NR as this is a one line change to a text string visible only in CI.

Also fixing issue credit as the commit bot overwrote the change last time.

Committed and pushed 52c25c27b5 to 11.x and 2131d24946 to 10.2.x. Thanks!

  • longwave committed 2131d249 on 10.2.x
    Issue #3402203 followup by fjgarlin: Improve the test-only job workflow...

  • longwave committed 52c25c27 on 11.x
    Issue #3402203 followup by fjgarlin: Improve the test-only job workflow
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.