Add missing example descriptions in prevent_set_operator_mismatch_spec

What does this MR do and why?

spec/lib/gitlab/database/query_analyzers/prevent_set_operator_mismatch_spec.rb had 1 multi-line example with no description, so RSpec generated one from the matcher and RSpec/ExampleWithoutDescription flagged it. This MR gives it a description.

The change is one string argument per it. The example bodies are untouched, and no test behaviour changes.

  • spec/lib/gitlab/database/query_analyzers/prevent_set_operator_mismatch_spec.rb:17, under shared_examples 'parses SQL' (included by the when SQL includes a UNION, INTERSECT and EXCEPT contexts): parses SQL into a SelectStmt

RuboCop can check that a description exists, but not that it is true, and neither can the pipeline. Please read each one against the body it sits above.

.rubocop_todo/rspec/example_without_description.yml still lists this file. The entry is redundant now, and the scheduled Keeps::GenerateRubocopTodos run regenerates the todo files from a full rescan and drops entries whose offense is gone.

How to set up and validate locally

The file is still listed in the RuboCop todo, so a plain rubocop run reports no offenses whether or not this change is correct. REVEAL_RUBOCOP_TODO=1 is what makes the cop see it, which is why the pipeline cannot show this and a local run can.

  1. Confirm the cop is satisfied on this branch, which should report no offenses
REVEAL_RUBOCOP_TODO=1 bundle exec rubocop --only RSpec/ExampleWithoutDescription spec/lib/gitlab/database/query_analyzers/prevent_set_operator_mismatch_spec.rb
  1. Confirm the file still offends on master, so the check above is meaningful. This should report the offense this MR removes
git show master:spec/lib/gitlab/database/query_analyzers/prevent_set_operator_mismatch_spec.rb | REVEAL_RUBOCOP_TODO=1 bundle exec rubocop --only RSpec/ExampleWithoutDescription --stdin spec/lib/gitlab/database/query_analyzers/prevent_set_operator_mismatch_spec.rb

References

Merge request reports

Loading
Loading