Skip to content

Clear host memoization for metric embeds feature test

Sarah Yasonik requested to merge sy-fix-memoization-leaks into master

What does this MR do?

!24601 (merged) introduced memoization for regex matchers in Gitlab::Metrics::Dashboard::Url.

If you run spec/features/markdown/metrics_spec.rb before or after another test which depends on these regexes, the latter test file will have failures, as metrics_spec.rb configures a host other than localhost.

This MR:

  • Clears the memoization before and after the metrics_spec.rb runs to avoid leaking state to other specs
  • Changes some spacing which was bothering me
  • Updates a spec description to match the corresponding method name which was also changed in !24601 (merged)

Testing

Example of tests which can be run to see the failures & validate the solution: rspec spec/features/markdown/metrics_spec.rb spec/lib/banzai/filter/inline_metrics_redactor_filter_spec.rb

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Edited by Sarah Yasonik

Merge request reports

Loading