Fixes gitlab-rspec test failures on stable branches
What does this MR do and why?
Fixes flaky test failures in gitlab-rspec gem's TestMetrics.pipeline_type specs by adding missing stub_env('CI_MERGE_REQUEST_TARGET_BRANCH_NAME', nil) to three test contexts. The tests were failing because they didn't stub this environment variable, causing the actual CI environment value (a stable branch pattern) to leak through and trigger the backport_merge_request_pipeline condition before the intended conditions were evaluated. This ensures proper test isolation regardless of the pipeline environment running the tests.
References
- Pipeline failures on backport: https://gitlab.com/gitlab-org/gitlab/-/jobs/13743991244
- Backport MR: !229844 (merged)
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.