Skip to content

Resolve "Failing spec: Pipeline Quota with no quota shows correct group quota info"

What does this MR do?

Reworks a set of failing specs to eliminate the observed cause of failure

Are there points in the code the reviewer needs to double check?

Did I correctly capture all the test cases that were present before this change?

Should we add any more now that the framework is there?

Why was this MR needed?

In these specs, we had the following (anti-)pattern:

describe x do
  let(:namespace) { ... }

  context y do
    let(:namespace) { ... }
  end
end

In a relatively low percentage of spec runs, we were seeing the outer let run for specs in context y, rather than the inner let, causing intermittent spec failures.

There is also a second issue whereby we were creating multiple namespaces with the same owner_id - which was was returned by the has_one :namespace call in app/models/user.rb for any given invocation was random, and it wasn't guaranteed that our tests would modify the same instance seen by the browser. This is fixed by finessing the tests so that only a single namespace is created.

Screenshots (if relevant)

Does this MR meet the acceptance criteria?

  • Tests added for this feature/bug
  • Review
    • Has been reviewed by Backend
  • Conform by the merge request performance guides
  • Conform by the style guides
  • Squashed related commits together
  • Internationalization required/considered
  • If paid feature, have we considered GitLab.com plan and how it works for groups and is there a design for promoting it to users who aren't on the correct plan
  • End-to-end tests pass (package-qa manual pipeline job)

What are the relevant issue numbers?

Closes #4858 (closed)

Edited by Nick Thomas

Merge request reports