Testing GitLab CI templates

I’m just curious to know whether anyone has tried to build a pipeline that tests CI templates that are intended to be used in other repos? In see GitLab uses some RSpec tests for this, or manual QA, but I was hoping to try something more automated.

My vague idea is to keep some test data around and trigger downstream child pipelines for each template.

Is there a recipe for this anywhere?

Thanks,

Sarah

Yes, I’ve done that.

Unfortunately the project is private, but the basic recipe I used was to trigger a downstream project that is used to test the job.

When I did it, I had to have the dedicated project because there wasn’t a way to dynamically run different pipelines. Since 12.9 though, there’s the ability to trigger a child pipeline with generated ci jobs (see Keyword reference for the .gitlab-ci.yml file | GitLab) which would be a much nicer fit.

–Harley

1 Like

Thanks @hstenzel good to know it’s a viable option!