Module: RutemaWeb::UI::Timeline

Included in:
SinatraApp
Defined in:
lib/rutema_web/sinatra.rb

Instance Method Summary collapse

Instance Method Details

#timeline_data(runs) ⇒ Object

Collects the timeline information from a set of runs. Essentially this lists the status for all scenarios in each run filling in not_executed status for any missing entries



135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# File 'lib/rutema_web/sinatra.rb', line 135

def timeline_data runs
  # {:scenario=>{"run_id"=>status}}
  data=Hash.new
  runs.each do |run|
    run.scenarios.each do |scenario|
      unless scenario.name=~/_setup$/ || scenario.name=~/_teardown$/
        data[scenario.name]||={}
        data[scenario.name][run.id]=[scenario.status,scenario.id]
      end
    end
  end
  #fill in the blanks
  data.each do |k,v|
    runs.each do |run|
      data[k][run.id]=["not_executed",nil] unless data[k][run.id]
    end
  end
  return data
end