Skip to content

Speed up search_results_spec

Dmitry Gruzd requested to merge speedup-search-results-spec into master

What does this MR do and why?

This is related to my work on #346914 (closed) and would greatly speed up testing new mappings

This MR reorganizes and speeds up a shared example in ee/spec/lib/gitlab/elastic/search_results_spec.rb.

It's a 6x improvement. It goes from

Finished in 1 minute 49.49 seconds (files took 0.99528 seconds to load)

to

Finished in 17.19 seconds (files took 1.34 seconds to load)

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

Numbered steps to set up and validate the change are strongly suggested.

  1. Without switching the branch, execute
    bin/rspec ee/spec/lib/gitlab/elastic/search_results_spec.rb:891
  2. Checkout this branch (speedup-search-results-spec) and execute the command above again
  3. Compare the total execution time

MR acceptance checklist

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

Edited by Dmitry Gruzd

Merge request reports

Loading