Automated testing: Configure GitLab CI

Created on 3 September 2023, over 1 year ago

I've noticed the mention Deprecated on module's Automated testing page at:
DrupalCI (deprecated)
https://www.drupal.org/node/1837132/qa
with a link now, at the top to "View GitLab CI pipelines for this project" linked to:
https://git.drupalcode.org/project/image_link_formatter/-/pipelines

See screenshot below:

 

Which brought me to think the DA is continuing its work and efforts to migrate all code related work to GitLab.

I found some helpful documentation on the topic: Documentation on Drupal.org: GitLab CI .

Then, found the config file template:
https://git.drupalcode.org/project/gitlab_templates/-/blob/1.0.x/gitlab-...

and then searched the entire DO project base:
https://git.drupalcode.org/search?group_id=2&scope=blobs&search=Gitlab-c...

which led to a relevant example: 📌 Configure GitLab CI Fixed , for the YouTube Field module, which seems to have a reasonably good user base and checked its pipeline page, see:
https://git.drupalcode.org/project/youtube/-/pipelines
See code file: https://git.drupalcode.org/project/youtube/-/blob/2.x/.gitlab-ci.yml

Work expected:

Transition the project to use GitLab CI pipelines instead of DrupalCI, to provide similar automated testing conditions: PHP, DB, Core versions, branches, triggers on commits, patches susbmitted in tickets, etc...

1 - The "first step is to add a .gitlab-ci.yml file to the root of the project."

2 - Configure the Automated testing pipelines on GitLabCI at:
https://git.drupalcode.org/project/image_link_formatter/-/pipelines
See existing tests configurations on modules's current automated testing page on DO.
 

Feel free to let us know if you have any suggestions, comments, or feedback on this ticket or the project in general, we would be glad to help and provide more information.
Thanks in advance!

📌 Task
Status

Fixed

Version

2.1

Component

Code

Created by

🇫🇷France dydave

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

Comments & Activities

  • Issue created by @dydave
    • DYdave committed 6230828e on 2.1.x
      Issue #3385035 by DYdave: Automated testing on GitLab CI: Added initial...
    • DYdave committed 5a52c7a2 on 2.1.x
      Issue #3385035 by DYdave: Coding standards: Fixed minor issues reported...
  • Status changed to Fixed over 1 year ago
  • 🇫🇷France dydave

    Quick follow-up on this ticket:

    As suggested in the Issue summary, added at #2 initial configuration file .gitlab-ci.yml based on template and documentation from Documentation on Drupal.org: GitLab CI , to provide automated testing with GitLab CI pipelines.

    After seeing the first pipeline being run automatically at:
    https://git.drupalcode.org/project/image_link_formatter/-/pipelines/17847
    The job for phpcs came back with a warning and coding standards errors, see:
    https://git.drupalcode.org/project/image_link_formatter/-/jobs/74233
    which were fixed in the following commit at #3.

    and the following pipeline on the second commit came back all green (passed), see:
    https://git.drupalcode.org/project/image_link_formatter/-/pipelines/17850

    The new interface on GitLab provides a lot more information on the builds and on the tests as well, see:
    https://git.drupalcode.org/project/image_link_formatter/-/pipelines/1785...

    While providing a lot more control over the testing infrastructure, it also requires quite a lot more configuration work to port existing testing jobs variables from DrupalCI.
    I haven't looked yet at the details of the DrupalCI Variables, but it looks like we should be able to run tests with the same configurations we had on DrupalCI.
    I have given it a quick test by changing the core version $CORE_SUPPORTED to 9.5.x, which seemed to work quite well and downloaded current 9.5.10, see in composer logs:
    https://git.drupalcode.org/project/image_link_formatter/-/jobs/74258#L282

    I haven't found yet how more jobs could be added to be triggered automatically on commits or patches in issues.
    I suppose this will most likely be taken care of in merge requests, issue forks branches on the GitLab side.
    Otherwise, another option would be to create Scheduled pipelines, which could run certain tests on a time basis, like every week, month and such.

    For the time being, the default configuration has been enabled for the 2.1.x, which should trigger tests automatically on commits in the branch and most likely merge requests. More tests have to be triggered manually, for example for various versions of Drupal Core, PHP, MySQL, etc... and we should be able to improve the configuration as we get a better understanding of the features provided in GitLab CI.

    Lastly, as it currently stands, it doesn't really seem necessary or interesting to backport support for GitLab CI Testing to the 2.0.x branch of the module, which was marked not recommended and will become unsupported at some point.

    Since all the work to be carried in this ticket should have been completed at this point, marking it as Fixed for now.

    Feel free to let us know if you have any questions, suggestions or comments on any of the recent commits or the project in general, we would be very happy to hear your feedback.
    Thanks in advance!

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

Production build 0.71.5 2024