Skip to content

[FOSS] Fix tests for usage_data:generate_ci_template_events

What does this MR do and why?

Fixes the tests on FOSS for the rake task usage_data:generate_ci_template_events. EE-only templates can expand to nil on FOSS and should not have events generated.

As pointed out by @smcgivern in #377698 (comment 1133335120)

It seems like Verify/Browser-Performance.gitlab-ci.yml gets expanded to nil. I'm not sure if https://gitlab.com/gitlab-org/gitlab/-/blob/5c0da4eefe8470642798241ce01049a2295b8daa/lib/gitlab/template/gitlab_ci_yml_template.rb#L42-44 is related.

This is because browser performance testing is a premium feature (the excludes are removed in EE).

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

How to set up and validate locally

Run the test in FOSS mode

FOSS_ONLY=1 bin/rspec spec/tasks/gitlab/usage_data_rake_spec.rb:72

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports