Improve feature spec coverage of the Pipelines tab of the new merge request page

What does this MR do and why?

The feature specs for the Pipelines tab on the new merge request page create pipelines on the head commit of the source branch only. A list that shows only the head commit, or every pipeline on that commit, passes them. !266261 (closed) is such a list, and it changed the spec to expect one row.

This MR makes the specs fail for that kind of list:

  • Each of the two commits of the compare has a branch pipeline, and both must be listed.
  • A tag pipeline on the head commit must stay out of the list.
  • The badge must still read 2 after the list loads.

The three examples were in two files, with different setup. They now share one context in user_selects_branches_for_new_mr_spec.rb:

  • limits the count on the Pipelines tab, from user_creates_mr_spec.rb.
  • lists the branch pipelines of every commit in the compare. It also takes the tab state checks from user_creates_mr_spec.rb.

The user_creates_mr_spec.rb examples used the "merge request create context", which creates users, a milestone and labels that these examples did not use. They also added a commit to fix, which already has two commits.

This MR also removes code that nothing calls:

  • The shared example a creatable merge request. Its last caller was removed in 3ea64011ad45, 2023-09-21. It still targets the old label dropdown.
  • The select_source_branch helper in the EE user_selects_branches_for_new_mr_spec.rb. No example calls it, and its .js-source-branch-dropdown selector no longer exists in the app.
image
How this was verified

All runs are local, on master at 07c3500c2bf2:

Code under test Result of the new examples
This MR, REST list Both pass
!266261 (closed), head commit only lists the branch pipelines… fails: the older commit's pipeline is missing, and the tag pipeline is listed
!266580, GraphQL list The list is correct. The browser console check fails on a TypeError in the badge listener, which that MR must fix
  • The other examples in user_selects_branches_for_new_mr_spec.rb, user_creates_mr_spec.rb and the EE twin pass.
  • One exception: generates a diff for an orphaned branch fails with a "Transition was aborted because of invalid state" console error. It fails the same way on unchanged master, so it is not caused by this MR.
  • A first draft clicked click_link 'Pipelines'. That matched the Pipelines item in the sidebar and left the page. The example now clicks the tab through a[data-action="pipelines"], as the old examples did.

References

  • Test gap found while working on #637319
  • Head-commit-only list that passed the old specs: !266261 (closed)
  • Backend field for the GraphQL list: !266573 (merged)
  • GraphQL list on the new merge request page, which these specs guard: !266580
  • Flag rollout and removal: #419726

Screenshots or screen recordings

Not applicable. This MR changes specs only.

How to set up and validate locally

Not applicable. This MR changes specs only.

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 Miguel Rincon

Merge request reports

Loading
Loading