Replace participant calls with stubbing to prevent test pollution

What does this MR do and why?

Replace model.participant calls with participant_attrs stubbing to eliminate test pollution that was causing Resolvers::Users::ParticipantsResolver specs to fail with undefined method foo errors: https://gitlab.com/gitlab-org/gitlab/-/jobs/12771436355.

The pollution occurred when participant attributes added to anonymous model classes in spec/models/concerns/participable_spec.rb leaked into subsequent test runs, causing Issue instances to be called with non-existent methods like :foo and :bar.

This addresses the broken master incident: gitlab-org/quality/engineering-productivity/master-broken-incidents#20737 (closed).

References

How to set up and validate locally

  1. bin/rspec spec/models/concerns/participable_spec.rb spec/graphql/resolvers/users/participants_resolver_spec.rb -fp

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.

Edited by Agnes Slota

Merge request reports

Loading