diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-06 21:10:06 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-06 21:10:06 +0300 |
commit | 52dbfea964ea55b3393dc4146e541bc651f7e9e3 (patch) | |
tree | e28de820d59431bf4ead2a12cebb13092030a811 /spec/benchmarks/banzai_benchmark.rb | |
parent | 0a5ea888dca19dec6ce473a88c35a4ef95f61a9c (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/benchmarks/banzai_benchmark.rb')
-rw-r--r-- | spec/benchmarks/banzai_benchmark.rb | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/spec/benchmarks/banzai_benchmark.rb b/spec/benchmarks/banzai_benchmark.rb index 05c41eed889..86f7ee7e90b 100644 --- a/spec/benchmarks/banzai_benchmark.rb +++ b/spec/benchmarks/banzai_benchmark.rb @@ -88,12 +88,18 @@ RSpec.describe 'GitLab Markdown Benchmark', :aggregate_failures do def build_filter_text(pipeline, initial_text) filter_source = {} input_text = initial_text + result = nil pipeline.filters.each do |filter_klass| - filter_source[filter_klass] = input_text + # store inputs for current filter_klass + filter_source[filter_klass] = { input_text: input_text, input_result: result } - output = filter_klass.call(input_text, context) + filter = filter_klass.new(input_text, context, result) + output = filter.call + + # save these for the next filter_klass input_text = output + result = filter.result end filter_source @@ -111,7 +117,12 @@ RSpec.describe 'GitLab Markdown Benchmark', :aggregate_failures do pipeline.filters.each do |filter_klass| label = filter_klass.name.demodulize.delete_suffix('Filter').truncate(20) - x.report(label) { filter_klass.call(filter_source[filter_klass], context) } + x.report(label) do + filter = filter_klass.new(filter_source[filter_klass][:input_text], + context, + filter_source[filter_klass][:input_result]) + filter.call + end end x.compare! |