Commit 6c7a2a6d authored by Brett Walker's avatar Brett Walker

Correctly pass results in markdown benchmark

parent 20e92797
......@@ -88,12 +88,15 @@ 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
filter = filter_klass.new(input_text, context, result)
output = filter.call
output = filter_klass.call(input_text, context)
filter_source[filter_klass] = { input_text: input_text, input_result: result }
input_text = output
result = filter.result
end
filter_source
......@@ -111,7 +114,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!
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment