Sha256: 3ef1767a48716ea1f6f6cae8f2fe788ed85189294c639e0bd87bd4573b0e833a
Contents?: true
Size: 1.66 KB
Versions: 15
Compression:
Stored size: 1.66 KB
Contents
require 'rubygems' require 'active_record' require 'date' ActiveRecord::Base.establish_connection( :adapter => 'yourdbtype', :host => 'yourhost', :encoding => 'utf8', :database => 'selenium_trending', :username => 'youruser', :password => 'youtpass' ) class SeleniumTrend < ActiveRecord::Base ActiveRecord::Migration.class_eval do unless SeleniumTrend.table_exists? create_table :selenium_trends do |t| t.integer :hudson_build t.string :hudson_project t.string :hudson_url t.string :spec_line_failure t.string :spec_name t.string :nested_spec_name t.string :trace t.string :full_path t.string :time t.string :status t.date :date end end end end def store_failure_data dir = Dir.pwd data = "#{dir}/tmp/parallel_log/trends.log" File.open("#{data}", 'r') do |f| f.each_line do |line| if values != nil values = line.split("*").to_a spec_line_failure = values[0] spec_name = values[1] date = values[2] status = values[3] time = values[4] nested_spec_name = values[5] trace = values[6] full_path = values[7] hudson_build = values[9] hudson_project = values[10] hudson_url = values[11] SeleniumTrend.create!(:spec_line_failure => spec_line_failure, :spec_name => spec_name, :date => date, :status => status, :time => time, :nested_spec_name => nested_spec_name, :trace => trace, :full_path => full_path, :hudson_build => hudson_build, :hudson_project => hudson_project, :hudson_url => hudson_url) end end end end store_failure_data
Version data entries
15 entries across 15 versions & 1 rubygems