Potential to integrate with GitLab's CI/CD tool

A forum for discussion on the software for the WMT River Control System
Post Reply
hamishmb
Posts: 1891
Joined: 16/05/2017, 16:41

Potential to integrate with GitLab's CI/CD tool

Post by hamishmb »

I've been playing around with GitLab's Continuous Integration tool lately, and have got it working with one of my personal projects.

This tool can run things like automated tests or generate documentation for each commit to check things work (and provide downloadable files). In this way it may help us ensure ongoing software quality as we get next to each commit (prominently):
  • A green tick if all jobs pass.
  • A yellow exclamation if any jobs fail but we have told it to ignore failures for those jobs.
  • A red cross if any jobs fail that aren't ignored (eg unit tests)
I feel this could be useful as it's easy to forget to do things like run unit tests and check the documentation still generates. We get (at least) 400 free CI minutes every month, and there's no automatic fee if we go over. It's possible more or negotiable if needed because this is all open-source and for a charity. I think I could adapt the settings for my personal project with minimal difficulty in some free time.

Any thoughts?
Hamish
PatrickW
Posts: 146
Joined: 25/11/2019, 13:34

Re: Potential to integrate with GitLab's CI/CD tool

Post by PatrickW »

In principle I like the idea of doing this sort of thing automatically.

From your words, it sounds like it's quite easy to set up. I'm pretty sure most ways of hosting a Git repository leave open the opportunity to do things like this (although not necessarily in the same way, or with the same manner of configuration), so the risk of platform lock-in is slight.

In the case of testing, what happens when a new test is created? Does someone have to add it to a list of things GitLab will run, or can it be made to pick it up automatically?

Git itself has some features for doing things like this. Using those, you can also run things before each commit, on the developer's machine, although I think each user might have to set that up for themself rather than it being something that gets set up when you clone the repository. (Not 100% sure.) I wonder if GitLab has built on top of Git's features, or done its own thing.
hamishmb
Posts: 1891
Joined: 16/05/2017, 16:41

Re: Potential to integrate with GitLab's CI/CD tool

Post by hamishmb »

I think the git things (hooks maybe?) can be configured in-repo, but don't quote me on that. In our case, the unit tests task several minutes to run so we wouldn't want that I don't think.

We can have it run the unittest.py file with the -a flag - any new test suites added will be run automatically. I have added your stagepi unit tests under a new flag (and -a) there too, in the latest commits.

Wrt lock-in, I believe you're right. I'm pretty sure GitHub at least can do it. One can also run GitLab (and it's Runners that power the CI) on your own systems, so it avoids having to use GitLab.com if we need that at some point.
Hamish
TerryJC
Posts: 2616
Joined: 16/05/2017, 17:17

Re: Potential to integrate with GitLab's CI/CD tool

Post by TerryJC »

All this sounds very useful if it can be implemented without too much additional work and stress.

We used some automated testing when I was working (not tied to the source control tool that we used) and it was very good from the point of view of time saved over the life of the project and increased confidence in the quality of the product.
Terry
hamishmb
Posts: 1891
Joined: 16/05/2017, 16:41

Re: Potential to integrate with GitLab's CI/CD tool

Post by hamishmb »

Note: The river system software was integrated with the CI/CD tool, but I forgot to post an update here.
Hamish
Post Reply