├── log └── .keep ├── .rspec ├── app ├── mailers │ └── .keep ├── models │ ├── .keep │ ├── concerns │ │ └── .keep │ ├── user.rb │ ├── run.rb │ ├── world.rb │ ├── world │ │ └── single_component.rb │ ├── suite.rb │ ├── flaky_result_report.rb │ ├── test_definition.rb │ ├── result.rb │ ├── aggregate_result_comparison.rb │ ├── aggregate_result_group.rb │ ├── result_history.rb │ ├── aggregate_result_comparison_group.rb │ └── aggregate_result.rb ├── assets │ ├── images │ │ ├── .keep │ │ ├── favicon.ico │ │ ├── favicon-16x16.png │ │ ├── favicon-32x32.png │ │ ├── favicon-96x96.png │ │ ├── apple-touch-icon.png │ │ ├── android-chrome-36x36.png │ │ ├── android-chrome-48x48.png │ │ ├── android-chrome-72x72.png │ │ ├── android-chrome-96x96.png │ │ ├── android-chrome-144x144.png │ │ ├── android-chrome-192x192.png │ │ ├── apple-touch-icon-57x57.png │ │ ├── apple-touch-icon-60x60.png │ │ ├── apple-touch-icon-72x72.png │ │ ├── apple-touch-icon-76x76.png │ │ ├── apple-touch-icon-114x114.png │ │ ├── apple-touch-icon-120x120.png │ │ ├── apple-touch-icon-144x144.png │ │ ├── apple-touch-icon-152x152.png │ │ ├── apple-touch-icon-180x180.png │ │ └── apple-touch-icon-precomposed.png │ ├── stylesheets │ │ ├── tags.scss │ │ ├── result_tables.scss │ │ ├── world_effects.scss │ │ ├── application.scss │ │ ├── result_badges.scss │ │ └── bootstrap-2 │ │ │ └── LICENSE │ └── javascripts │ │ ├── application.js │ │ └── lazy_loading.js ├── controllers │ ├── concerns │ │ └── .keep │ ├── api │ │ ├── v1_controller.rb │ │ └── v1 │ │ │ ├── status_controller.rb │ │ │ └── results_controller.rb │ ├── api_controller.rb │ ├── flaky_test_controller.rb │ ├── runs_controller.rb │ ├── application_controller.rb │ ├── suites_controller.rb │ ├── tests_controller.rb │ ├── reliability_controller.rb │ └── worlds_controller.rb ├── helpers │ ├── worlds_helper.rb │ ├── runs_helper.rb │ └── application_helper.rb ├── views │ ├── worlds │ │ ├── search.html.erb │ │ ├── index.html.erb │ │ ├── compare.html.erb │ │ ├── show.html.erb │ │ ├── aggregate_group_element.html.erb │ │ ├── comparison_element.html.erb │ │ └── comparison_group_element.html.erb │ ├── suites │ │ ├── index.html.erb │ │ └── show.html.erb │ ├── reliability │ │ └── show.html.erb │ ├── layouts │ │ ├── _favicons.html.erb │ │ └── application.html.erb │ ├── flaky_test │ │ └── show.erb │ ├── tests │ │ ├── show.html.erb │ │ └── history.html.erb │ └── runs │ │ └── show.html.erb └── extras │ └── ir_ingestor.rb ├── lib ├── assets │ └── .keep └── tasks │ └── .keep ├── public ├── favicon.ico ├── images │ ├── hive-13.png │ ├── hive-14.png │ ├── hive-16.png │ ├── hive-20.png │ ├── testmine-20.png │ ├── testmine-25.png │ ├── testmine-32.png │ ├── testmine-25z25.png │ ├── testmine-32x32.png │ └── testmine-logo-40.png ├── robots.txt ├── 500.html ├── 422.html └── 404.html ├── TESTING.md ├── config ├── unicorn.rb ├── initializers │ ├── session_store.rb │ ├── filter_parameter_logging.rb │ ├── mime_types.rb │ ├── backtrace_silencers.rb │ ├── wrap_parameters.rb │ ├── inflections.rb │ └── secret_token.rb ├── environment.rb ├── boot.rb ├── locales │ ├── en.bootstrap.yml │ └── en.yml ├── database.yml ├── application.rb ├── environments │ ├── development.rb │ ├── test.rb │ └── production.rb └── routes.rb ├── .testmine.yml ├── bin ├── rake ├── bundle ├── rails └── start ├── spec ├── controllers │ ├── runs_controller_spec.rb │ └── worlds_controller_spec.rb ├── views │ ├── runs │ │ └── show.html.erb_spec.rb │ └── worlds │ │ ├── show.html.erb_spec.rb │ │ └── index.html.erb_spec.rb ├── helpers │ ├── runs_helper_spec.rb │ └── worlds_helper_spec.rb ├── models │ ├── run_spec.rb │ ├── result_spec.rb │ ├── suite_spec.rb │ ├── world_spec.rb │ ├── result_history_spec.rb │ ├── test_definition_spec.rb │ ├── aggregate_result_comparison_group_spec.rb │ └── aggregate_result_group_spec.rb ├── spec_helper.rb └── extras │ └── ingest_cucumber_run_spec.rb ├── config.ru ├── db ├── migrate │ ├── 20160216102230_add_index_to_results.rb │ ├── 20150604091815_add_another_results_index.rb │ ├── 20140904112746_add_indexes_to_results.rb │ ├── 20150204103557_add_missing_taggable_index.acts_as_taggable_on_engine.rb │ ├── 20140217215249_create_suites.rb │ ├── 20140215232536_create_runs.rb │ ├── 20140215232603_create_worlds.rb │ ├── 20150204103556_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb │ ├── 20140302222218_create_results.rb │ ├── 20150204103555_add_missing_unique_indices.acts_as_taggable_on_engine.rb │ ├── 20140218211529_create_test_definitions.rb │ └── 20150204103554_acts_as_taggable_on_migration.acts_as_taggable_on_engine.rb ├── seeds.rb └── schema.rb ├── Rakefile ├── Gemfile ├── docker-compose.yml ├── .gitignore ├── LICENSE ├── Dockerfile ├── README.md ├── Gemfile.lock └── docker └── docker-entrypoint-initdb.d └── 01-testmite_structure.sql /log/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.rspec: -------------------------------------------------------------------------------- 1 | --color 2 | -------------------------------------------------------------------------------- /app/mailers/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/models/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/assets/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/tasks/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/assets/images/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/models/concerns/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/controllers/concerns/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /TESTING.md: -------------------------------------------------------------------------------- 1 | bundle exec rake spec 2 | -------------------------------------------------------------------------------- /config/unicorn.rb: -------------------------------------------------------------------------------- 1 | worker_processes 16 2 | 3 | -------------------------------------------------------------------------------- /app/helpers/worlds_helper.rb: -------------------------------------------------------------------------------- 1 | module WorldsHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/helpers/runs_helper.rb: -------------------------------------------------------------------------------- 1 | module RunsHelper 2 | 3 | 4 | end 5 | -------------------------------------------------------------------------------- /.testmine.yml: -------------------------------------------------------------------------------- 1 | project: hive-ci 2 | component: testmine 3 | suite: rspec 4 | -------------------------------------------------------------------------------- /app/assets/stylesheets/tags.scss: -------------------------------------------------------------------------------- 1 | ul.test-tags a { 2 | color: white; 3 | } 4 | 5 | -------------------------------------------------------------------------------- /app/controllers/api/v1_controller.rb: -------------------------------------------------------------------------------- 1 | class API::V1Controller < APIController 2 | 3 | end 4 | -------------------------------------------------------------------------------- /public/images/hive-13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbc/testmine/HEAD/public/images/hive-13.png -------------------------------------------------------------------------------- /public/images/hive-14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbc/testmine/HEAD/public/images/hive-14.png -------------------------------------------------------------------------------- /public/images/hive-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbc/testmine/HEAD/public/images/hive-16.png -------------------------------------------------------------------------------- /public/images/hive-20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbc/testmine/HEAD/public/images/hive-20.png -------------------------------------------------------------------------------- /app/assets/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbc/testmine/HEAD/app/assets/images/favicon.ico -------------------------------------------------------------------------------- /public/images/testmine-20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbc/testmine/HEAD/public/images/testmine-20.png -------------------------------------------------------------------------------- /public/images/testmine-25.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbc/testmine/HEAD/public/images/testmine-25.png -------------------------------------------------------------------------------- /public/images/testmine-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbc/testmine/HEAD/public/images/testmine-32.png -------------------------------------------------------------------------------- /public/images/testmine-25z25.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbc/testmine/HEAD/public/images/testmine-25z25.png -------------------------------------------------------------------------------- /public/images/testmine-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbc/testmine/HEAD/public/images/testmine-32x32.png -------------------------------------------------------------------------------- /app/assets/images/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbc/testmine/HEAD/app/assets/images/favicon-16x16.png -------------------------------------------------------------------------------- /app/assets/images/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbc/testmine/HEAD/app/assets/images/favicon-32x32.png -------------------------------------------------------------------------------- /app/assets/images/favicon-96x96.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbc/testmine/HEAD/app/assets/images/favicon-96x96.png -------------------------------------------------------------------------------- /bin/rake: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require_relative '../config/boot' 3 | require 'rake' 4 | Rake.application.run 5 | -------------------------------------------------------------------------------- /public/images/testmine-logo-40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbc/testmine/HEAD/public/images/testmine-logo-40.png -------------------------------------------------------------------------------- /spec/controllers/runs_controller_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe RunsController do 4 | 5 | 6 | end 7 | -------------------------------------------------------------------------------- /spec/controllers/worlds_controller_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe WorldsController do 4 | 5 | end 6 | -------------------------------------------------------------------------------- /app/assets/images/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbc/testmine/HEAD/app/assets/images/apple-touch-icon.png -------------------------------------------------------------------------------- /app/assets/images/android-chrome-36x36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbc/testmine/HEAD/app/assets/images/android-chrome-36x36.png -------------------------------------------------------------------------------- /app/assets/images/android-chrome-48x48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbc/testmine/HEAD/app/assets/images/android-chrome-48x48.png -------------------------------------------------------------------------------- /app/assets/images/android-chrome-72x72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbc/testmine/HEAD/app/assets/images/android-chrome-72x72.png -------------------------------------------------------------------------------- /app/assets/images/android-chrome-96x96.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbc/testmine/HEAD/app/assets/images/android-chrome-96x96.png -------------------------------------------------------------------------------- /app/assets/images/android-chrome-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbc/testmine/HEAD/app/assets/images/android-chrome-144x144.png -------------------------------------------------------------------------------- /app/assets/images/android-chrome-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbc/testmine/HEAD/app/assets/images/android-chrome-192x192.png -------------------------------------------------------------------------------- /app/assets/images/apple-touch-icon-57x57.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbc/testmine/HEAD/app/assets/images/apple-touch-icon-57x57.png -------------------------------------------------------------------------------- /app/assets/images/apple-touch-icon-60x60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbc/testmine/HEAD/app/assets/images/apple-touch-icon-60x60.png -------------------------------------------------------------------------------- /app/assets/images/apple-touch-icon-72x72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbc/testmine/HEAD/app/assets/images/apple-touch-icon-72x72.png -------------------------------------------------------------------------------- /app/assets/images/apple-touch-icon-76x76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbc/testmine/HEAD/app/assets/images/apple-touch-icon-76x76.png -------------------------------------------------------------------------------- /app/controllers/api_controller.rb: -------------------------------------------------------------------------------- 1 | class APIController < ApplicationController 2 | protect_from_forgery with: :null_session 3 | end 4 | -------------------------------------------------------------------------------- /app/assets/images/apple-touch-icon-114x114.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbc/testmine/HEAD/app/assets/images/apple-touch-icon-114x114.png -------------------------------------------------------------------------------- /app/assets/images/apple-touch-icon-120x120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbc/testmine/HEAD/app/assets/images/apple-touch-icon-120x120.png -------------------------------------------------------------------------------- /app/assets/images/apple-touch-icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbc/testmine/HEAD/app/assets/images/apple-touch-icon-144x144.png -------------------------------------------------------------------------------- /app/assets/images/apple-touch-icon-152x152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbc/testmine/HEAD/app/assets/images/apple-touch-icon-152x152.png -------------------------------------------------------------------------------- /app/assets/images/apple-touch-icon-180x180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbc/testmine/HEAD/app/assets/images/apple-touch-icon-180x180.png -------------------------------------------------------------------------------- /app/assets/images/apple-touch-icon-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbc/testmine/HEAD/app/assets/images/apple-touch-icon-precomposed.png -------------------------------------------------------------------------------- /bin/bundle: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) 3 | load Gem.bin_path('bundler', 'bundle') 4 | -------------------------------------------------------------------------------- /bin/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | APP_PATH = File.expand_path('../../config/application', __FILE__) 3 | require_relative '../config/boot' 4 | require 'rails/commands' 5 | -------------------------------------------------------------------------------- /spec/views/runs/show.html.erb_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe "runs/show.html.erb" do 4 | pending "add some examples to (or delete) #{__FILE__}" 5 | end 6 | -------------------------------------------------------------------------------- /spec/views/worlds/show.html.erb_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe "worlds/show.html.erb" do 4 | pending "add some examples to (or delete) #{__FILE__}" 5 | end 6 | -------------------------------------------------------------------------------- /app/controllers/api/v1/status_controller.rb: -------------------------------------------------------------------------------- 1 | class API::V1::StatusController < API::V1Controller 2 | def show 3 | render status: 200, json: { status: 'ok' } 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /config.ru: -------------------------------------------------------------------------------- 1 | # This file is used by Rack-based servers to start the application. 2 | 3 | require ::File.expand_path('../config/environment', __FILE__) 4 | run Rails.application 5 | -------------------------------------------------------------------------------- /spec/views/worlds/index.html.erb_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe "worlds/index.html.erb" do 4 | pending "add some examples to (or delete) #{__FILE__}" 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20160216102230_add_index_to_results.rb: -------------------------------------------------------------------------------- 1 | class AddIndexToResults < ActiveRecord::Migration 2 | def change 3 | add_index :results, :test_definition_id 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /config/initializers/session_store.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | Testmine::Application.config.session_store :cookie_store, key: '_testmine_session' 4 | -------------------------------------------------------------------------------- /config/environment.rb: -------------------------------------------------------------------------------- 1 | # Load the Rails application. 2 | require File.expand_path('../application', __FILE__) 3 | 4 | # Initialize the Rails application. 5 | Testmine::Application.initialize! 6 | -------------------------------------------------------------------------------- /db/migrate/20150604091815_add_another_results_index.rb: -------------------------------------------------------------------------------- 1 | class AddAnotherResultsIndex < ActiveRecord::Migration 2 | def change 3 | add_index :results, [:run_id, :test_definition_id] 4 | end 5 | end -------------------------------------------------------------------------------- /db/migrate/20140904112746_add_indexes_to_results.rb: -------------------------------------------------------------------------------- 1 | class AddIndexesToResults < ActiveRecord::Migration 2 | def change 3 | add_index :results, :parent_id 4 | add_index :results, :run_id 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | # See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file 2 | # 3 | # To ban all spiders from the entire site uncomment the next two lines: 4 | # User-agent: * 5 | # Disallow: / 6 | -------------------------------------------------------------------------------- /config/initializers/filter_parameter_logging.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Configure sensitive parameters which will be filtered from the log file. 4 | Rails.application.config.filter_parameters += [:password] 5 | -------------------------------------------------------------------------------- /config/initializers/mime_types.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new mime types for use in respond_to blocks: 4 | # Mime::Type.register "text/richtext", :rtf 5 | # Mime::Type.register_alias "text/html", :iphone 6 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | # Add your own tasks in files placed in lib/tasks ending in .rake, 2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. 3 | 4 | require File.expand_path('../config/application', __FILE__) 5 | 6 | Testmine::Application.load_tasks 7 | -------------------------------------------------------------------------------- /app/models/user.rb: -------------------------------------------------------------------------------- 1 | class User 2 | attr_accessor :name 3 | attr_accessor :email 4 | 5 | def initialize(args) 6 | @name = args[:name] 7 | @email = args[:email] 8 | end 9 | 10 | def self.find_or_create( args ) 11 | User.new( args ) 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /app/models/run.rb: -------------------------------------------------------------------------------- 1 | class Run < ActiveRecord::Base 2 | belongs_to :world 3 | has_many :results 4 | 5 | has_many :top_level_results, -> { where(:parent_id => nil) }, class_name: 'Result' 6 | 7 | def duration 8 | if finished_at && started_at 9 | (finished_at - started_at).to_i 10 | else 11 | 0 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /db/seeds.rb: -------------------------------------------------------------------------------- 1 | # This file should contain all the record creation needed to seed the database with its default values. 2 | # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup). 3 | # 4 | # Examples: 5 | # 6 | # cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }]) 7 | # Mayor.create(name: 'Emanuel', city: cities.first) 8 | -------------------------------------------------------------------------------- /bin/start: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | echo " "; 4 | echo -n "Waiting for DB to start..." 5 | 6 | while ! mysqladmin ping -h"app-db" --silent; do 7 | sleep 1 8 | echo -n "." 9 | done 10 | echo "Starting testmine, visit: http://192.168.99.100:3002/ in your browser." 11 | 12 | bundle install 13 | bundle exec rake db:migrate 14 | bundle exec rails s 15 | 16 | 17 | -------------------------------------------------------------------------------- /app/controllers/api/v1/results_controller.rb: -------------------------------------------------------------------------------- 1 | class API::V1::ResultsController < API::V1Controller 2 | 3 | def ingest_ir 4 | 5 | begin 6 | run = IrIngestor.parse_ir( params['data'] ) 7 | rescue Exception => e 8 | error = e.to_s + " --> " + e.backtrace.to_s 9 | render text: error 10 | end 11 | 12 | if run 13 | render text: run.id 14 | end 15 | 16 | end 17 | 18 | end 19 | -------------------------------------------------------------------------------- /config/boot.rb: -------------------------------------------------------------------------------- 1 | # Set up gems listed in the Gemfile. 2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) 3 | 4 | require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE']) 5 | 6 | # Override rails defaults 7 | require 'rails/commands/server' 8 | module Rails 9 | class Server 10 | def default_options 11 | super.merge(Host: '0.0.0.0', Port: 3002) 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /app/assets/stylesheets/result_tables.scss: -------------------------------------------------------------------------------- 1 | .test-name a { 2 | color: black; 3 | } 4 | 5 | .label-fill { 6 | width: 100px; 7 | display: inline-block; 8 | } 9 | 10 | th.rotate-th { 11 | white-space: nowrap; 12 | } 13 | 14 | th.rotate-th > div { 15 | transform: 16 | translate(10px, 0px) 17 | rotate(315deg); 18 | width: 30px; 19 | } 20 | 21 | .summary-row { 22 | background-color: #eeeeee; 23 | } 24 | -------------------------------------------------------------------------------- /db/migrate/20150204103557_add_missing_taggable_index.acts_as_taggable_on_engine.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from acts_as_taggable_on_engine (originally 4) 2 | class AddMissingTaggableIndex < ActiveRecord::Migration 3 | def self.up 4 | add_index :taggings, [:taggable_id, :taggable_type, :context] 5 | end 6 | 7 | def self.down 8 | remove_index :taggings, [:taggable_id, :taggable_type, :context] 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /app/assets/stylesheets/world_effects.scss: -------------------------------------------------------------------------------- 1 | .vertical-label { 2 | -moz-transform: rotate(270deg); /* FF3.5+ */ 3 | -o-transform: rotate(270deg); /* Opera 10.5 */ 4 | -webkit-transform: rotate(0deg); /* Saf3.1+, Chrome */ 5 | filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3); /* IE6,IE7 */ 6 | -ms-filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3); /* IE8 */ 7 | } -------------------------------------------------------------------------------- /db/migrate/20140217215249_create_suites.rb: -------------------------------------------------------------------------------- 1 | class CreateSuites < ActiveRecord::Migration 2 | def change 3 | create_table :suites do |t| 4 | t.string :project 5 | t.string :name 6 | t.string :runner 7 | t.string :description 8 | t.text :documentation 9 | t.string :url 10 | t.string :repo 11 | 12 | t.timestamps 13 | 14 | t.index [:project, :name] 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /app/views/worlds/search.html.erb: -------------------------------------------------------------------------------- 1 |

No worlds retrieved

2 | 3 | <% if @search_params[:hive_job_id] %> 4 |

Hive job <%= @search_params[:hive_job_id] -%> was not reported to Testmine.

5 | <% elsif @search_params[:world_version] %> 6 |

World version <%= @search_params[:version] -%> was not reported to Testmine.

7 | <% end %> 8 |

Perhaps the suite isn't configured correctly for this Testmine instance?

-------------------------------------------------------------------------------- /config/initializers/backtrace_silencers.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. 4 | # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } 5 | 6 | # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. 7 | # Rails.backtrace_cleaner.remove_silencers! 8 | -------------------------------------------------------------------------------- /db/migrate/20140215232536_create_runs.rb: -------------------------------------------------------------------------------- 1 | class CreateRuns < ActiveRecord::Migration 2 | def change 3 | create_table :runs do |t| 4 | t.references :world, index: true 5 | t.string :owner 6 | t.integer :hive_job_id, index: true 7 | t.string :target, index: true 8 | t.string :status 9 | t.timestamp :started_at 10 | t.timestamp :finished_at 11 | 12 | t.timestamps 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /db/migrate/20140215232603_create_worlds.rb: -------------------------------------------------------------------------------- 1 | class CreateWorlds < ActiveRecord::Migration 2 | def change 3 | create_table :worlds do |t| 4 | t.string :type 5 | t.string :name 6 | t.text :description 7 | t.string :project, index: true 8 | t.string :component 9 | t.string :version 10 | 11 | t.timestamps 12 | 13 | t.index [:project, :component] 14 | t.index [:project, :component, :version] 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /spec/helpers/runs_helper_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | # Specs in this file have access to a helper object that includes 4 | # the RunsHelper. For example: 5 | # 6 | # describe RunsHelper do 7 | # describe "string concat" do 8 | # it "concats two strings with spaces" do 9 | # expect(helper.concat_strings("this","that")).to eq("this that") 10 | # end 11 | # end 12 | # end 13 | describe RunsHelper do 14 | pending "add some examples to (or delete) #{__FILE__}" 15 | end 16 | -------------------------------------------------------------------------------- /spec/helpers/worlds_helper_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | # Specs in this file have access to a helper object that includes 4 | # the WorldsHelper. For example: 5 | # 6 | # describe WorldsHelper do 7 | # describe "string concat" do 8 | # it "concats two strings with spaces" do 9 | # expect(helper.concat_strings("this","that")).to eq("this that") 10 | # end 11 | # end 12 | # end 13 | describe WorldsHelper do 14 | pending "add some examples to (or delete) #{__FILE__}" 15 | end 16 | -------------------------------------------------------------------------------- /app/controllers/flaky_test_controller.rb: -------------------------------------------------------------------------------- 1 | class FlakyTestController < ApplicationController 2 | def show 3 | @world = World.includes(:runs).find(params[:world_id].to_i) 4 | @target = Run.where( :world_id => @world.id ).pluck('DISTINCT target')[0] 5 | @tags = [] 6 | 7 | @results = FlakyResultReport.populate( :world_id => @world.id, 8 | :target => @target, 9 | :tags => @tags ) 10 | 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | gem 'rails', '= 5.0.7.1' 4 | 5 | gem 'sass-rails', '= 5.0.7' 6 | gem 'bootstrap-sass', '= 3.3.7' 7 | gem 'font-awesome-sass', '= 5.5.0.1' 8 | 9 | gem 'thin', '= 1.7.2' 10 | 11 | gem 'nokogiri', '= 1.8.5' 12 | 13 | gem 'token_phrase', '= 1.0.6' 14 | 15 | gem 'mysql2', '= 0.5.2' 16 | 17 | # Use Uglifier as compressor for JavaScript assets 18 | gem 'uglifier', '= 4.1.20' 19 | gem 'jquery-rails', '= 4.3.3' 20 | gem 'jbuilder', '= 2.8.0' 21 | gem 'acts-as-taggable-on', '= 6.0.0' 22 | -------------------------------------------------------------------------------- /app/controllers/runs_controller.rb: -------------------------------------------------------------------------------- 1 | class RunsController < ApplicationController 2 | def show 3 | @run = Run.includes(:top_level_results => [ 4 | :test_definition, 5 | :children => [ 6 | :test_definition, 7 | :children => [ 8 | :test_definition, 9 | :children => [ 10 | :children 11 | ]]]]).find(params[:id]) 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /app/views/suites/index.html.erb: -------------------------------------------------------------------------------- 1 |

Test Suites

2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | <% @suites.each do |s| %> 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | <% end %> 23 | 24 |
ProjectSuiteRunnerCreated
<%= s.project -%><%= link_to ( s.name ? s.name : "unnamed"), "/suites/#{s.id}"-%><%= s.runner -%><%= simple_time s.created_at -%>
-------------------------------------------------------------------------------- /app/controllers/application_controller.rb: -------------------------------------------------------------------------------- 1 | class ApplicationController < ActionController::Base 2 | # Prevent CSRF attacks by raising an exception. 3 | # For APIs, you may want to use :null_session instead. 4 | protect_from_forgery with: :exception 5 | 6 | helper_method :current_user 7 | 8 | private 9 | 10 | def current_user 11 | if request.headers['bbc.email_address'] 12 | @current_user ||= User.find_or_create( 13 | :name => request.headers['bbc.name'], 14 | :email => request.headers['bbc.email_address'] ) 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /app/models/world.rb: -------------------------------------------------------------------------------- 1 | class World < ActiveRecord::Base 2 | before_create :generate_name 3 | 4 | has_many :runs 5 | 6 | scope :similar, ->(w) { where( project: w.project).where( component: w.component).where('id != ?', w.id ).order('id DESC').limit(100) } 7 | 8 | # Return the ids of recent similar worlds 9 | def similar 10 | World.similar(self) 11 | end 12 | 13 | def last_run 14 | runs.last 15 | end 16 | 17 | private 18 | def generate_name 19 | self.name = TokenPhrase.generate(:numbers => false).split('-').drop(2).join('-') 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /db/migrate/20150204103556_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from acts_as_taggable_on_engine (originally 3) 2 | class AddTaggingsCounterCacheToTags < ActiveRecord::Migration 3 | def self.up 4 | add_column :tags, :taggings_count, :integer, default: 0 5 | 6 | ActsAsTaggableOn::Tag.reset_column_information 7 | ActsAsTaggableOn::Tag.find_each do |tag| 8 | ActsAsTaggableOn::Tag.reset_counters(tag.id, :taggings) 9 | end 10 | end 11 | 12 | def self.down 13 | remove_column :tags, :taggings_count 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /config/locales/en.bootstrap.yml: -------------------------------------------------------------------------------- 1 | # Sample localization file for English. Add more files in this directory for other locales. 2 | # See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. 3 | 4 | en: 5 | helpers: 6 | actions: "Actions" 7 | links: 8 | back: "Back" 9 | cancel: "Cancel" 10 | confirm: "Are you sure?" 11 | destroy: "Delete" 12 | new: "New" 13 | edit: "Edit" 14 | titles: 15 | edit: "Edit %{model}" 16 | save: "Save %{model}" 17 | new: "New %{model}" 18 | delete: "Delete %{model}" 19 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | services: 3 | app-db: 4 | image: mysql:5.7 5 | restart: always 6 | volumes: 7 | - db_data:/var/lib/mysql 8 | - ./docker/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d 9 | ports: 10 | - "3306:3306" 11 | environment: 12 | MYSQL_ROOT_PASSWORD: testmine 13 | MYSQL_DATABASE: testmite 14 | testmine: 15 | build: . 16 | working_dir: /app 17 | volumes: 18 | - .:/app 19 | command: 'bin/start' 20 | ports: 21 | - "3002:3002" 22 | links: 23 | - app-db 24 | volumes: 25 | db_data: -------------------------------------------------------------------------------- /config/initializers/wrap_parameters.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # This file contains settings for ActionController::ParamsWrapper which 4 | # is enabled by default. 5 | 6 | # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. 7 | ActiveSupport.on_load(:action_controller) do 8 | wrap_parameters format: [:json] if respond_to?(:wrap_parameters) 9 | end 10 | 11 | # To enable root element in JSON for ActiveRecord objects. 12 | # ActiveSupport.on_load(:active_record) do 13 | # self.include_root_in_json = true 14 | # end 15 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files for more about ignoring files. 2 | # 3 | # If you find yourself ignoring temporary files generated by your text editor 4 | # or operating system, you probably want to add a global ignore instead: 5 | # git config --global core.excludesfile '~/.gitignore_global' 6 | 7 | # Ignore bundler config. 8 | /.bundle 9 | 10 | # Ignore the default SQLite database. 11 | /db/*.sqlite3 12 | /db/*.sqlite3-journal 13 | 14 | # Ignore all logfiles and tempfiles. 15 | /log/*.log 16 | /tmp 17 | 18 | # Ignore rspec res files 19 | rspec.res 20 | 21 | .idea 22 | 23 | .DS_Store 24 | -------------------------------------------------------------------------------- /app/controllers/suites_controller.rb: -------------------------------------------------------------------------------- 1 | class SuitesController < ApplicationController 2 | def index 3 | @suites = Suite.last(200).reverse 4 | end 5 | 6 | def show 7 | @suite = Suite.find( params[:id] ) 8 | 9 | @worlds = World.includes(:runs).joins( :runs => 10 | {:results => [:test_definition]} 11 | ).where( :test_definitions => 12 | {:suite_id => @suite.id} 13 | ).distinct.order(:id => :desc).limit(200) 14 | 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /spec/models/run_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe Run do 4 | 5 | before(:all) do 6 | @world = World::SingleComponent.find_or_create( 7 | :component => "TestMite", 8 | :project => "Titan", 9 | :version => "1.2.3" ) 10 | end 11 | 12 | describe "create" do 13 | it "creates and retrieves a run" do 14 | run = Run.create( world: @world, target: 'x86_64' ) 15 | 16 | run.should be_a Run 17 | run.id.should be_a Fixnum 18 | run.target.should == 'x86_64' 19 | run.world.should be_a World::SingleComponent 20 | end 21 | end 22 | 23 | end 24 | -------------------------------------------------------------------------------- /app/models/world/single_component.rb: -------------------------------------------------------------------------------- 1 | class World::SingleComponent < World 2 | 3 | def self.find_or_create( args ) 4 | component = args[:component] || raise( ArgumentError, "Need to provide component name (e.g. 'tal')") 5 | 6 | version = args[:version] || raise( ArgumentError, "Need to provide a version string (e.g. '1.2.3')") 7 | 8 | project = args[:project] || raise( ArgumentError, "Need to provide a project string (e.g. 'iplayer')" ) 9 | 10 | World::SingleComponent.where( :component => component, 11 | :project => project, 12 | :version => version ).first_or_create 13 | end 14 | 15 | end 16 | -------------------------------------------------------------------------------- /app/controllers/tests_controller.rb: -------------------------------------------------------------------------------- 1 | class TestsController < ApplicationController 2 | def show 3 | @test = TestDefinition.find(params[:id]) 4 | 5 | results = Result.order(:created_at => :desc).includes( :children, :run => [ :world ]).where(:test_definition_id => params[:id]).limit(200) 6 | 7 | @results_hash = results.group_by { |r| r.run.target } 8 | 9 | end 10 | 11 | def history 12 | @test_definition_id = params[:id].to_i 13 | @target = params[:target] 14 | @histories = ResultHistory.find_for_all_targets(:test_definition_id => @test_definition_id ) 15 | 16 | @grouped_results = ResultHistory.group_by_commit(@histories) 17 | 18 | @test = @histories[@target].test_definition 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /config/locales/en.yml: -------------------------------------------------------------------------------- 1 | # Files in the config/locales directory are used for internationalization 2 | # and are automatically loaded by Rails. If you want to use locales other 3 | # than English, add the necessary files in this directory. 4 | # 5 | # To use the locales, use `I18n.t`: 6 | # 7 | # I18n.t 'hello' 8 | # 9 | # In views, this is aliased to just `t`: 10 | # 11 | # <%= t('hello') %> 12 | # 13 | # To use a different locale, set it with `I18n.locale`: 14 | # 15 | # I18n.locale = :es 16 | # 17 | # This would use the information in config/locales/es.yml. 18 | # 19 | # To learn more, please read the Rails Internationalization guide 20 | # available at http://guides.rubyonrails.org/i18n.html. 21 | 22 | en: 23 | hello: "Hello world" 24 | -------------------------------------------------------------------------------- /app/views/worlds/index.html.erb: -------------------------------------------------------------------------------- 1 |

Latest worlds under test

2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | <% @worlds.each do |w| %> 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | <% end %> 29 | 30 |
IDWorldProjectComponentVersionRunsLast run
<%= w.id -%><%= link_to w.name, "worlds/#{w.id}" -%><%= w.project -%><%= w.component -%><%= w.version -%><%= w.runs.count -%><%= simple_time w.last_run.started_at -%>
31 | -------------------------------------------------------------------------------- /config/initializers/inflections.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new inflection rules using the following format. Inflections 4 | # are locale specific, and you may define rules for as many different 5 | # locales as you wish. All of these examples are active by default: 6 | ActiveSupport::Inflector.inflections(:en) do |inflect| 7 | inflect.acronym 'API' 8 | # inflect.plural /^(ox)$/i, '\1en' 9 | # inflect.singular /^(ox)en/i, '\1' 10 | # inflect.irregular 'person', 'people' 11 | # inflect.uncountable %w( fish sheep ) 12 | end 13 | 14 | # These inflection rules are supported but not enabled by default: 15 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 16 | # inflect.acronym 'RESTful' 17 | # end 18 | -------------------------------------------------------------------------------- /db/migrate/20140302222218_create_results.rb: -------------------------------------------------------------------------------- 1 | class CreateResults < ActiveRecord::Migration 2 | def change 3 | create_table :results do |t| 4 | 5 | # The objects these results are associated with 6 | t.integer :test_definition_id 7 | 8 | # Run grouping (Which captures target and world information) 9 | t.integer :run_id 10 | 11 | # Result parent -- this would typically cache child summary results 12 | t.integer :parent_id 13 | 14 | # Simple integer value associated with a result 15 | t.integer :value 16 | 17 | t.string :status 18 | t.text :output 19 | t.timestamp :started_at 20 | t.timestamp :finished_at 21 | 22 | t.timestamps 23 | end 24 | end 25 | end 26 | -------------------------------------------------------------------------------- /app/assets/javascripts/application.js: -------------------------------------------------------------------------------- 1 | // This is a manifest file that'll be compiled into application.js, which will include all the files 2 | // listed below. 3 | // 4 | // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, 5 | // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path. 6 | // 7 | // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the 8 | // compiled file. 9 | // 10 | // Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details 11 | // about supported directives. 12 | // 13 | //= require jquery 14 | //= require jquery_ujs 15 | //= require_tree . 16 | //= require bootstrap-sprockets 17 | -------------------------------------------------------------------------------- /config/initializers/secret_token.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Your secret key is used for verifying the integrity of signed cookies. 4 | # If you change this key, all old signed cookies will become invalid! 5 | 6 | # Make sure the secret is at least 30 characters and all random, 7 | # no regular words or you'll be exposed to dictionary attacks. 8 | # You can use `rake secret` to generate a secure secret key. 9 | 10 | # Make sure your secret_key_base is kept private 11 | # if you're sharing your code publicly. 12 | Testmine::Application.config.secret_key_base = ENV['RAILS_SECRET_KEY_BASE'] || 'b28ee70e95c8790954be8eb5d2bb743cccd95a2e1e759c18b493652312f8378fe0280f51313782683d036176147321bbe2310483863372c398b19991c0c256be' 13 | -------------------------------------------------------------------------------- /config/database.yml: -------------------------------------------------------------------------------- 1 | # SQLite version 3.x 2 | # gem install sqlite3 3 | # 4 | # Ensure the SQLite 3 gem is defined in your Gemfile 5 | # gem 'sqlite3' 6 | development: 7 | adapter: mysql2 8 | host: app-db 9 | database: testmite 10 | username: root 11 | password: testmine 12 | port: 3306 13 | variables: 14 | sql_mode: TRADITIONAL 15 | 16 | # Warning: The database defined as "test" will be erased and 17 | # re-generated from your development database when you run "rake". 18 | # Do not set this db to the same as development or production. 19 | test: 20 | adapter: sqlite3 21 | database: db/test.sqlite3 22 | pool: 5 23 | timeout: 5000 24 | 25 | production: 26 | adapter: sqlite3 27 | database: db/production.sqlite3 28 | pool: 5 29 | timeout: 5000 30 | -------------------------------------------------------------------------------- /app/models/suite.rb: -------------------------------------------------------------------------------- 1 | class Suite < ActiveRecord::Base 2 | 3 | has_many :test_definitions 4 | 5 | def self.find_or_create(args) 6 | Suite.where( 7 | project: args[:project], 8 | name: args[:name] 9 | ).first_or_create do |suite| 10 | suite.project = args[:project] 11 | suite.name = args[:name] 12 | suite.runner = args[:runner] 13 | suite.description = args[:description] 14 | suite.documentation = args[:documentation] 15 | suite.url = args[:url] 16 | suite.repo = args[:repo] 17 | end 18 | end 19 | 20 | def tests 21 | TestDefinition.where( :suite_id => self.id, :parent_id => nil ) 22 | end 23 | 24 | def add_test_definition(args) 25 | args[:suite_id] = self.id 26 | TestDefinition.find_or_create(args) 27 | end 28 | 29 | end 30 | -------------------------------------------------------------------------------- /db/migrate/20150204103555_add_missing_unique_indices.acts_as_taggable_on_engine.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from acts_as_taggable_on_engine (originally 2) 2 | class AddMissingUniqueIndices < ActiveRecord::Migration 3 | def self.up 4 | add_index :tags, :name, unique: true 5 | 6 | remove_index :taggings, :tag_id 7 | remove_index :taggings, [:taggable_id, :taggable_type, :context] 8 | add_index :taggings, 9 | [:tag_id, :taggable_id, :taggable_type, :context, :tagger_id, :tagger_type], 10 | unique: true, name: 'taggings_idx' 11 | end 12 | 13 | def self.down 14 | remove_index :tags, :name 15 | 16 | remove_index :taggings, name: 'taggings_idx' 17 | add_index :taggings, :tag_id 18 | add_index :taggings, [:taggable_id, :taggable_type, :context] 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /app/views/reliability/show.html.erb: -------------------------------------------------------------------------------- 1 |

<%=@suite_name -%> Reliability

2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 |
MeasureNumber of Failures and Errors in Test SuiteNumber of Passes in Test SuiteReliability Ratio as a Percentage
Last 2 days<%=@fail_last_day -%><%=@pass_last_day -%><%=@reliability_last_day-%>
Last 7 days<%=@fail_last_week -%><%=@pass_last_week -%><%=@reliability_last_week-%>
Last 30 days<%=@fail_last_month -%><%=@pass_last_month -%><%=@reliability_last_month-%>
29 | 30 | 31 | -------------------------------------------------------------------------------- /spec/models/result_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe Result do 4 | describe "adding a result" do 5 | 6 | before(:each) do 7 | 8 | @test = TestDefinition.find_or_create( 9 | name: 'Scanning item', 10 | node_type: 'Cucumber::Feature', 11 | ) 12 | 13 | @world = World::SingleComponent.find_or_create( 14 | :component => "TestMite", 15 | :project => "Titan", 16 | :version => "1.2.3" ) 17 | 18 | @run = Run.create( world: @world, target: 'x86_64' ) 19 | end 20 | 21 | it "creates a result" do 22 | 23 | Result.create( 24 | :test_definition_id => @test.id, 25 | :status => "pass", 26 | :run_id => @run.id 27 | ) 28 | 29 | @run.results.count == 1 30 | @run.results.first.status == "passed" 31 | end 32 | 33 | end 34 | 35 | 36 | 37 | end 38 | -------------------------------------------------------------------------------- /spec/models/suite_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe Suite do 4 | describe "find_or_create" do 5 | 6 | it "creates a suite" do 7 | 8 | suite = Suite.find_or_create( 9 | project: 'Titan', 10 | name: 'Cucumber features', 11 | runner: 'Ruby Cucumber', 12 | description: 'Feature files for the Titan project', 13 | documentation: "Long description of what's going on", 14 | url: 'https://www.github.com/bbc-test', 15 | repo: 'https://www.github.com/bbc-test/titan' 16 | ) 17 | 18 | suite.project.should == 'Titan' 19 | suite.name.should == "Cucumber features" 20 | suite.runner.should == 'Ruby Cucumber' 21 | suite.description.should be_a String 22 | suite.url.should be_a String 23 | suite.repo.should be_a String 24 | 25 | end 26 | 27 | end 28 | end 29 | -------------------------------------------------------------------------------- /db/migrate/20140218211529_create_test_definitions.rb: -------------------------------------------------------------------------------- 1 | # Table for capturing hierarchical test definitions 2 | class CreateTestDefinitions < ActiveRecord::Migration 3 | def change 4 | create_table :test_definitions do |t| 5 | t.string :name # "Scanning item" 6 | t.string :node_type # Cucumber::Feature 7 | t.text :description # "\nAs a cashier\nI want to scan an item\nSo I can demand cash" 8 | t.string :file # "features\/scan_items.feature" 9 | t.integer :line # 1 -- line number from the file where the definition starts 10 | 11 | # Foreign keys 12 | t.integer :parent_id, index: true # What owns this test? 13 | t.integer :suite_id, index: true # What suite does it belong to? 14 | 15 | t.index [:name, :suite_id, :file, :parent_id], name: 'lookup' 16 | 17 | t.timestamps 18 | end 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /db/migrate/20150204103554_acts_as_taggable_on_migration.acts_as_taggable_on_engine.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from acts_as_taggable_on_engine (originally 1) 2 | class ActsAsTaggableOnMigration < ActiveRecord::Migration 3 | def self.up 4 | create_table :tags do |t| 5 | t.string :name 6 | end 7 | 8 | create_table :taggings do |t| 9 | t.references :tag 10 | 11 | # You should make sure that the column created is 12 | # long enough to store the required class names. 13 | t.references :taggable, polymorphic: true 14 | t.references :tagger, polymorphic: true 15 | 16 | # Limit is created to prevent MySQL error on index 17 | # length for MyISAM table type: http://bit.ly/vgW2Ql 18 | t.string :context, limit: 128 19 | 20 | t.datetime :created_at 21 | end 22 | 23 | add_index :taggings, :tag_id 24 | add_index :taggings, [:taggable_id, :taggable_type, :context] 25 | end 26 | 27 | def self.down 28 | drop_table :taggings 29 | drop_table :tags 30 | end 31 | end 32 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 BBC 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /config/application.rb: -------------------------------------------------------------------------------- 1 | require File.expand_path('../boot', __FILE__) 2 | 3 | require 'rails/all' 4 | 5 | # Require the gems listed in Gemfile, including any gems 6 | # you've limited to :test, :development, or :production. 7 | Bundler.require(:default, Rails.env) 8 | 9 | module Testmine 10 | class Application < Rails::Application 11 | # Settings in config/environments/* take precedence over those specified here. 12 | # Application configuration should go into files in config/initializers 13 | # -- all .rb files in that directory are automatically loaded. 14 | 15 | # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. 16 | # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. 17 | # config.time_zone = 'Central Time (US & Canada)' 18 | 19 | # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. 20 | # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] 21 | # config.i18n.default_locale = :de 22 | 23 | begin 24 | config.middleware.use Rack::BBCAuth 25 | rescue NameError => e 26 | end 27 | end 28 | end 29 | -------------------------------------------------------------------------------- /app/views/worlds/compare.html.erb: -------------------------------------------------------------------------------- 1 | 2 |
3 |

<%= @primary_world.project + ": " + @primary_world.component -%>

4 |

<%= link_to @primary_world.version, "/worlds/#{@primary_world.id}" -%> vs <%= link_to @reference_world.version, "/worlds/#{@reference_world.id}" -%>

5 |
6 |
7 | 8 |
9 |
10 | 11 | 12 | 13 |
14 | 15 | <% @targets.each do |t| %> 16 | 17 |
18 |
19 |

20 | <%=t-%> 21 | (loading...) 22 |

23 |
24 |
25 |
26 | <% end %> 27 | 28 |
29 | 30 | -------------------------------------------------------------------------------- /config/environments/development.rb: -------------------------------------------------------------------------------- 1 | Testmine::Application.configure do 2 | # Settings specified here will take precedence over those in config/application.rb. 3 | 4 | # In the development environment your application's code is reloaded on 5 | # every request. This slows down response time but is perfect for development 6 | # since you don't have to restart the web server when you make code changes. 7 | config.cache_classes = false 8 | 9 | # Do not eager load code on boot. 10 | config.eager_load = false 11 | 12 | # Show full error reports and disable caching. 13 | config.consider_all_requests_local = true 14 | config.action_controller.perform_caching = false 15 | 16 | # Don't care if the mailer can't send. 17 | config.action_mailer.raise_delivery_errors = false 18 | 19 | # Print deprecation notices to the Rails logger. 20 | config.active_support.deprecation = :log 21 | 22 | # Raise an error on page load if there are pending migrations 23 | config.active_record.migration_error = :page_load 24 | 25 | # Debug mode disables concatenation and preprocessing of assets. 26 | # This option may cause significant delays in view rendering with a large 27 | # number of complex assets. 28 | config.assets.debug = true 29 | 30 | config.assets.paths << "#{Rails.root}/app/assets/fonts" 31 | end 32 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM centos:7 2 | 3 | RUN yum -y update 4 | RUN yum -y groupinstall 'Development Tools' 5 | RUN yum -y install wget libxslt-devel libyaml-devel libxml2-devel gdbm-devel libffi-devel zlib-devel openssl-devel libyaml-devel readline-devel curl-devel openssl-devel pcre-devel git memcached-devel valgrind-devel mysql-devel ImageMagick-devel ImageMagick 6 | RUN yum -y install mariadb-server 7 | 8 | RUN curl -sL https://rpm.nodesource.com/setup_8.x | bash - 9 | RUN yum install -y nodejs 10 | 11 | RUN cd /tmp 12 | RUN wget http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm 13 | RUN rpm -Uvh epel-release-latest-7.noarch.rpm 14 | 15 | # ruby 2.5.1 16 | RUN cd /usr/local/src 17 | RUN wget "https://cache.ruby-lang.org/pub/ruby/2.5/ruby-2.5.1.tar.gz" 18 | RUN tar -zxvf "ruby-2.5.1.tar.gz" 19 | RUN cd ruby-2.5.1 \ 20 | && ./configure \ 21 | && make \ 22 | && make install 23 | 24 | # ruby-gems 25 | RUN cd .. 26 | RUN wget "https://rubygems.org/rubygems/rubygems-2.7.7.tgz" 27 | RUN tar -zxvf "rubygems-2.7.7.tgz" 28 | RUN cd rubygems-2.7.7 \ 29 | && /usr/local/bin/ruby setup.rb 30 | 31 | ENV app /app 32 | 33 | RUN mkdir $app 34 | WORKDIR $app 35 | ADD . $app 36 | 37 | RUN cd $app 38 | RUN bundle update 39 | RUN bundle install 40 | 41 | RUN rake acts_as_taggable_on_engine:install:migrations 42 | 43 | EXPOSE 3002 -------------------------------------------------------------------------------- /app/assets/stylesheets/application.scss: -------------------------------------------------------------------------------- 1 | /* 2 | * This is a manifest file that'll be compiled into application.css, which will include all the files 3 | * listed below. 4 | * 5 | * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, 6 | * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path. 7 | * 8 | * You're free to add application-wide styles to this file and they'll appear at the top of the 9 | * compiled file, but it's generally better to create a new file per style scope. 10 | * 11 | */ 12 | 13 | // "bootstrap-sprockets" must be imported before "bootstrap" and "bootstrap/variables" 14 | @import "bootstrap-sprockets"; 15 | @import "bootstrap"; 16 | @import "font-awesome-sprockets"; 17 | @import "font-awesome"; 18 | @import "result_badges"; 19 | @import "tags"; 20 | @import "world_effects"; 21 | @import "result_tables"; 22 | 23 | .navbar-image { 24 | float: left; 25 | padding: 5px 20px 5px 5px; 26 | } 27 | 28 | .reliability table { 29 | border-collapse: collapse; 30 | width: 100%; 31 | } 32 | 33 | .reliability th, .reliability td { 34 | text-align: left; 35 | padding: 8px; 36 | } 37 | 38 | .reliability tr:nth-child(even){ 39 | background-color: #f2f2f2 40 | } 41 | 42 | .reliability th { 43 | background-color: #4CAF50; 44 | color: white; 45 | } 46 | -------------------------------------------------------------------------------- /app/models/flaky_result_report.rb: -------------------------------------------------------------------------------- 1 | class FlakyResultReport 2 | 3 | def self.populate( args ) 4 | 5 | primary_world_id = args[:world_id] or raise "Need to provide a primary world id" 6 | primary_world = World.find(primary_world_id) 7 | target = args[:target] 8 | 9 | tags = args[:tags] 10 | 11 | primary_results_by_test = Result.unscoped 12 | .includes(:test_definition => :tags, 13 | :children => [ 14 | :children => [:test_definition => :tags], 15 | :test_definition => :tags ]) 16 | .joins(:run) 17 | .where(:parent_id => nil, :runs => {:target => target, :world_id => primary_world_id}) 18 | .last(500) 19 | .group_by { |r| r.test_definition } 20 | 21 | tests = primary_results_by_test.keys 22 | 23 | aggregates = tests.map do |test| 24 | primary_results = primary_results_by_test[test] || [] 25 | AggregateResult.new( test, primary_world, primary_results, target, tags ) 26 | end 27 | 28 | AggregateResultGroup.new( :results => aggregates, :world => primary_world, :target => target ) 29 | end 30 | 31 | end 32 | -------------------------------------------------------------------------------- /app/assets/javascripts/lazy_loading.js: -------------------------------------------------------------------------------- 1 | function loadComparisonGroups(tag) { 2 | 3 | var elements = $('.comparison-loader') 4 | for ( var i=0; i < elements.length; i++ ) { 5 | loadComparisonGroup(elements[i].id, tag) 6 | } 7 | } 8 | 9 | function loadComparisonGroup(id, tag) 10 | { 11 | var elems = id.split("-"); 12 | elems.shift(); 13 | var primary_id = elems.shift(); 14 | var reference_id = elems.shift(); 15 | var target = elems.join('-'); 16 | 17 | $.ajax({ url: '/comparison/'+primary_id+'/'+reference_id+'?target='+target+'&tag='+tag, 18 | type: 'GET', 19 | success: function( data ) { 20 | $('[id="' + id + '"]').replaceWith(data); 21 | } 22 | }) 23 | } 24 | 25 | function loadAggregateGroups(tag) { 26 | 27 | var elements = $('.aggregate-group-loader') 28 | for ( var i=0; i < elements.length; i++ ) { 29 | loadAggregateGroup(elements[i].id, tag) 30 | } 31 | } 32 | 33 | function loadAggregateGroup(id, tag) 34 | { 35 | var elems = id.split("-"); 36 | elems.shift(); 37 | var world_id = elems.shift(); 38 | var target = elems.join('-'); 39 | 40 | $.ajax({ url: '/aggregate/'+world_id+'?target='+target+'&tag='+tag, 41 | type: 'GET', 42 | success: function( data ) { 43 | $('[id="' + id + '"]').replaceWith(data); 44 | } 45 | }) 46 | } -------------------------------------------------------------------------------- /app/views/suites/show.html.erb: -------------------------------------------------------------------------------- 1 |
2 |

<%= ( @suite.name ? @suite.name : "Unnamed suite (##{@suite.id})" )-%>

3 |

<%= @suite.description -%>

4 |

<%= link_to @suite.url, @suite.url if @suite.url -%>

5 |

<%= link_to @suite.repo, @suite.repo if @suite.url-%>

6 |
7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
ID<%= @suite.id -%>
Project<%= @suite.project -%>
Runner<%= @suite.runner -%>
Created<%= simple_time(@suite.created_at) -%>
16 | 17 |
18 | 19 |
20 | <%= @suite.documentation -%> 21 |
22 | 23 |
24 |

Latest test worlds

25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | <% @worlds.each do |w| %> 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | <% end %> 46 |
IDWorldFlaky Test ReportVersionRuns
<%= w.id -%><%= link_to w.name, "/worlds/#{w.id}" -%><%= link_to "View", "/flaky-test-report/#{w.id}?" if w.runs.count > 1 -%><%= w.version -%><%= w.runs.count -%>
47 | 48 |
49 | -------------------------------------------------------------------------------- /public/500.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | We're sorry, but something went wrong (500) 5 | 48 | 49 | 50 | 51 | 52 |
53 |

We're sorry, but something went wrong.

54 |
55 |

If you are the application owner check the logs for more information.

56 | 57 | 58 | -------------------------------------------------------------------------------- /public/422.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | The change you wanted was rejected (422) 5 | 48 | 49 | 50 | 51 | 52 |
53 |

The change you wanted was rejected.

54 |

Maybe you tried to change something you didn't have access to.

55 |
56 |

If you are the application owner check the logs for more information.

57 | 58 | 59 | -------------------------------------------------------------------------------- /public/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | The page you were looking for doesn't exist (404) 5 | 48 | 49 | 50 | 51 | 52 |
53 |

The page you were looking for doesn't exist.

54 |

You may have mistyped the address or the page may have moved.

55 |
56 |

If you are the application owner check the logs for more information.

57 | 58 | 59 | -------------------------------------------------------------------------------- /spec/models/world_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe World do 4 | 5 | describe World::SingleComponent do 6 | 7 | describe "#find_or_create" do 8 | 9 | it "creates a new world with a world id" do 10 | world = World::SingleComponent.find_or_create( 11 | :component => "TestMite", 12 | :project => "Hive", 13 | :version => "1.2.3" ) 14 | 15 | world.should be_a World::SingleComponent 16 | world.id.should be_a Fixnum 17 | world.component.should be_a String 18 | world.project.should be_a String 19 | world.version.should be_a String 20 | world.name.should be_a String 21 | end 22 | 23 | it "creates and retrieves a world just created" do 24 | args = { 25 | :project => "Hive", 26 | :component => "TestMite", 27 | :version => "1.2.3" } 28 | 29 | world1 = World::SingleComponent.find_or_create( args ) 30 | world2 = World::SingleComponent.find_or_create( args ) 31 | 32 | world1.id.should == world2.id 33 | end 34 | 35 | it "retrieves two runs for a world" do 36 | world = World::SingleComponent.find_or_create( 37 | :component => "TestMite", 38 | :project => "Hive", 39 | :version => "1.2.3" ) 40 | 41 | r1 = Run.create( world: world, target: 'x86_64' ) 42 | r2 = Run.create( world: world, target: 'x86_64' ) 43 | 44 | world.runs.count.should == 2 45 | 46 | end 47 | 48 | end 49 | 50 | end 51 | 52 | end 53 | -------------------------------------------------------------------------------- /app/views/layouts/_favicons.html.erb: -------------------------------------------------------------------------------- 1 | <%= favicon_link_tag( 'apple-touch-icon-57x57.png', rel: "apple-touch-icon", :type => 'image/png', :sizes => '57x57' ) -%> 2 | <%= favicon_link_tag( 'apple-touch-icon-60x60.png', rel: "apple-touch-icon", :type => 'image/png', :sizes => '60x60' ) -%> 3 | <%= favicon_link_tag( 'apple-touch-icon-72x72.png', rel: "apple-touch-icon", :type => 'image/png', :sizes => '72x72' ) -%> 4 | <%= favicon_link_tag( 'apple-touch-icon-76x76.png', rel: "apple-touch-icon", :type => 'image/png', :sizes => '76x76' ) -%> 5 | <%= favicon_link_tag( 'apple-touch-icon-114x114.png', rel: "apple-touch-icon", :type => 'image/png', :sizes => '114x114' ) -%> 6 | <%= favicon_link_tag( 'apple-touch-icon-120x120.png', rel: "apple-touch-icon", :type => 'image/png', :sizes => '120x120' ) -%> 7 | <%= favicon_link_tag( 'apple-touch-icon-144x144.png', rel: "apple-touch-icon", :type => 'image/png', :sizes => '144x144' ) -%> 8 | <%= favicon_link_tag( 'apple-touch-icon-152x152.png', rel: "apple-touch-icon", :type => 'image/png', :sizes => '152x152' ) -%> 9 | <%= favicon_link_tag( 'apple-touch-icon-180x180.png', rel: "apple-touch-icon", :type => 'image/png', :sizes => '180x180' ) -%> 10 | 11 | <%= favicon_link_tag( 'favicon-32x32.png', rel: "icon", :type => 'image/png', :sizes => '32x32' ) -%> 12 | <%= favicon_link_tag( 'favicon-194x194.png', rel: "icon", :type => 'image/png', :sizes => '194x194' ) -%> 13 | <%= favicon_link_tag( 'favicon-96x96.png', rel: "icon", :type => 'image/png', :sizes => '96x96' ) -%> 14 | <%= favicon_link_tag( 'favicon-192x192.png', rel: "icon", :type => 'image/png', :sizes => '192x192' ) -%> 15 | <%= favicon_link_tag( 'favicon-16x16.png', rel: "icon", :type => 'image/png', :sizes => '16x16' ) -%> -------------------------------------------------------------------------------- /config/environments/test.rb: -------------------------------------------------------------------------------- 1 | Testmine::Application.configure do 2 | # Settings specified here will take precedence over those in config/application.rb. 3 | 4 | # The test environment is used exclusively to run your application's 5 | # test suite. You never need to work with it otherwise. Remember that 6 | # your test database is "scratch space" for the test suite and is wiped 7 | # and recreated between test runs. Don't rely on the data there! 8 | config.cache_classes = true 9 | 10 | # Do not eager load code on boot. This avoids loading your whole application 11 | # just for the purpose of running a single test. If you are using a tool that 12 | # preloads Rails for running tests, you may have to set it to true. 13 | config.eager_load = false 14 | 15 | # Configure static asset server for tests with Cache-Control for performance. 16 | config.serve_static_assets = true 17 | config.static_cache_control = "public, max-age=3600" 18 | 19 | # Show full error reports and disable caching. 20 | config.consider_all_requests_local = true 21 | config.action_controller.perform_caching = false 22 | 23 | # Raise exceptions instead of rendering exception templates. 24 | config.action_dispatch.show_exceptions = false 25 | 26 | # Disable request forgery protection in test environment. 27 | config.action_controller.allow_forgery_protection = false 28 | 29 | # Tell Action Mailer not to deliver emails to the real world. 30 | # The :test delivery method accumulates sent emails in the 31 | # ActionMailer::Base.deliveries array. 32 | config.action_mailer.delivery_method = :test 33 | 34 | # Print deprecation notices to the stderr. 35 | config.active_support.deprecation = :stderr 36 | 37 | config.assets.paths << "#{Rails.root}/app/assets/fonts" 38 | end 39 | -------------------------------------------------------------------------------- /spec/spec_helper.rb: -------------------------------------------------------------------------------- 1 | # This file is copied to spec/ when you run 'rails generate rspec:install' 2 | ENV["RAILS_ENV"] ||= 'test' 3 | require File.expand_path("../../config/environment", __FILE__) 4 | require 'rspec/rails' 5 | require 'rspec/autorun' 6 | 7 | # Requires supporting ruby files with custom matchers and macros, etc, 8 | # in spec/support/ and its subdirectories. 9 | Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f } 10 | 11 | # Checks for pending migrations before tests are run. 12 | # If you are not using ActiveRecord, you can remove this line. 13 | ActiveRecord::Migration.check_pending! if defined?(ActiveRecord::Migration) 14 | 15 | RSpec.configure do |config| 16 | # ## Mock Framework 17 | # 18 | # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line: 19 | # 20 | # config.mock_with :mocha 21 | # config.mock_with :flexmock 22 | # config.mock_with :rr 23 | 24 | # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures 25 | config.fixture_path = "#{::Rails.root}/spec/fixtures" 26 | 27 | # If you're not using ActiveRecord, or you'd prefer not to run each of your 28 | # examples within a transaction, remove the following line or assign false 29 | # instead of true. 30 | config.use_transactional_fixtures = true 31 | 32 | # If true, the base class of anonymous controllers will be inferred 33 | # automatically. This will be the default behavior in future versions of 34 | # rspec-rails. 35 | config.infer_base_class_for_anonymous_controllers = false 36 | 37 | # Run specs in random order to surface order dependencies. If you find an 38 | # order dependency and want to debug it, you can fix the order by providing 39 | # the seed, which is printed after each run. 40 | # --seed 1234 41 | config.order = "random" 42 | end 43 | -------------------------------------------------------------------------------- /app/models/test_definition.rb: -------------------------------------------------------------------------------- 1 | class TestDefinition < ActiveRecord::Base 2 | 3 | belongs_to :suite 4 | belongs_to :parent, :foreign_key => "parent_id", :class_name => 'TestDefinition' 5 | has_many :children, :foreign_key => "parent_id", :class_name => 'TestDefinition', :dependent => :destroy 6 | has_many :results 7 | acts_as_taggable 8 | default_scope { includes( :tags) } 9 | 10 | 11 | def self.find_or_create(args) 12 | TestDefinition.where( 13 | name: args[:name], 14 | suite_id: args[:suite_id], 15 | file: args[:file], 16 | parent_id: args[:parent_id] 17 | ).first_or_create do |test| 18 | test.name = args[:name] 19 | test.node_type = args[:node_type] 20 | test.description = args[:description] 21 | test.file = args[:file] 22 | test.line = args[:line] 23 | test.parent_id = args[:parent_id] 24 | test.tag_list = args[:tags] 25 | end 26 | end 27 | 28 | def specific_tags 29 | if ! @specific_tags 30 | @specific_tags = self.tags.collect { |t| t.name } 31 | end 32 | @specific_tags 33 | end 34 | 35 | def inherited_tags 36 | if ! @inherited_tags 37 | all = self.tags.collect { |t| t.name } 38 | if self.parent 39 | all += self.parent.inherited_tags 40 | end 41 | all.uniq 42 | @inherited_tags = all.uniq 43 | end 44 | @inherited_tags 45 | end 46 | 47 | def add_test_definition(args) 48 | args[:suite_id] = self.suite_id 49 | args[:parent_id] = self.id 50 | args[:file] = self.file if !args[:file] 51 | TestDefinition.find_or_create(args) 52 | end 53 | 54 | def file_name( modifier = :short ) 55 | file_name = file 56 | if modifier == :short 57 | file =~ /.*features\/(.*.feature)/ 58 | file_name = $1 if $1 59 | end 60 | file_name 61 | end 62 | 63 | def confidence 64 | end 65 | end 66 | -------------------------------------------------------------------------------- /app/views/flaky_test/show.erb: -------------------------------------------------------------------------------- 1 | <% @has_flaky = false %> 2 |

Flaky Test Report

3 |
4 |
5 | 6 | <% if !@tags.empty? %> 7 | <% @tags.each do |t| %> 8 | 14 | <% end %> 15 | <% end %> 16 | 17 |
18 |

19 | <%=@target-%> 20 |

21 |
22 | 23 |
24 | 25 | <% if !@results.results.empty? %> 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | <% @results.results.each do |r| %> 37 | <% r.children.each do |s| %> 38 | <% if s.flaky? 39 | @has_flaky = true 40 | %> 41 | 42 | 43 | 44 | 46 | 47 | 48 | 49 | 50 | <% end %> 51 | <% end %> 52 | <% end %> 53 | 54 |
Suite Test Name Pass Fail Flaky (%)
<%= r.test_definition.name %> 45 | <%= link_to( pretty_truncate(h(s.test_definition.name), 80, 'em'), "/tests/#{s.test_definition.id}?target=#{@target}&detail=true") -%><%= s.statuses.count("pass") %><%= s.statuses.count("fail") %><%= s.flakyPercentage %>
55 | 56 | <% end %> 57 | 58 | 59 |
60 |
61 | <% if !@has_flaky %> 62 |

There are no flaky tests in this world.

63 | <% end %> 64 | -------------------------------------------------------------------------------- /spec/extras/ingest_cucumber_run_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | require 'json' 3 | 4 | describe IrIngestor do 5 | describe "ingesting a simple result" do 6 | 7 | before(:all) do 8 | @ir = { 9 | type: "ruby cucumber", 10 | started: Time.now-20, 11 | finished: Time.now.to_s, 12 | target: 'x86_32', 13 | project: 'hive', 14 | world: { 15 | component: 'web_app', 16 | version: '0.2.2' 17 | }, 18 | project: "hive", 19 | suite: "cucumber", 20 | results: [ 21 | { 22 | "file" => "features/simple_feature.feature", 23 | "line" => 2, 24 | "type" =>"Cucumber::Feature", 25 | "name" =>"Background steps", 26 | "description" => "As a user\nI want results!", 27 | "children" => [ 28 | { 29 | "file" => "features/simple_feature.feature", 30 | "line" => 14, 31 | "type" => "Cucumber::Scenario", 32 | "name" => "Deleted scenario", 33 | "children" =>[ 34 | { 35 | "type" => "Cucumber::Step", 36 | "name" => "Given something", 37 | "status" => "pass" 38 | }, 39 | { 40 | "type" => "Cucumber::Step", 41 | "name" => "When something happens", 42 | "status" => "pass" 43 | }, 44 | { 45 | "type" => "Cucumber::Step", 46 | "name" => "Then something else happens", 47 | "status" => "fail" 48 | } 49 | ] 50 | }] 51 | } 52 | ] 53 | }.to_json 54 | 55 | end 56 | 57 | it "imports under a single result object" do 58 | 59 | run = IrIngestor.parse_ir(@ir) 60 | 61 | run.results.count.should == 5 62 | run.top_level_results.count.should == 1 63 | 64 | run.top_level_results.first.status.should be_nil 65 | run.top_level_results.first.children.first.status.should be_nil 66 | 67 | run.top_level_results.first.children.first.children.first.status.should == "pass" 68 | end 69 | end 70 | 71 | end -------------------------------------------------------------------------------- /app/controllers/reliability_controller.rb: -------------------------------------------------------------------------------- 1 | class ReliabilityController < ApplicationController 2 | 3 | def show 4 | suite_id = params[:suite] 5 | @suite_name = get_suite_name(suite_id) 6 | @fail_last_day = fail_last_day(suite_id) 7 | @fail_last_week = fail_last_week(suite_id) 8 | @fail_last_month = fail_last_month(suite_id) 9 | @pass_last_day = pass_last_day(suite_id) 10 | @pass_last_week = pass_last_week(suite_id) 11 | @pass_last_month = pass_last_month(suite_id) 12 | @reliability_last_day = get_reliability(@fail_last_day,@pass_last_day) 13 | @reliability_last_week = get_reliability(@fail_last_week,@pass_last_week) 14 | @reliability_last_month = get_reliability(@fail_last_month,@pass_last_month) 15 | end 16 | 17 | def get_suite_name(suite_id) 18 | suite_name = Suite.find_by_sql("SELECT suites.name from suites where suites.id = " + suite_id.to_s) 19 | suite_name[0].name || "" 20 | end 21 | 22 | def get_reliability(fails,passes) 23 | fails = fails.to_f 24 | passes = passes.to_f 25 | 26 | 100.0 - (fails/passes * 100/1) 27 | end 28 | 29 | def fail_last_day(suite_id) 30 | fail_count(suite_id,2) 31 | end 32 | 33 | def fail_last_week(suite_id) 34 | fail_count(suite_id,7) 35 | end 36 | 37 | def fail_last_month(suite_id) 38 | fail_count(suite_id,30) 39 | end 40 | 41 | def pass_last_day(suite_id) 42 | pass_count(suite_id,2) 43 | end 44 | 45 | def pass_last_week(suite_id) 46 | pass_count(suite_id,7) 47 | end 48 | 49 | def pass_last_month(suite_id) 50 | pass_count(suite_id,30) 51 | end 52 | 53 | def fail_count(suite_id, numberofdays) 54 | TestDefinition.find_by_sql("SELECT test_definitions.id,test_definitions.name,results.status,runs.id,runs.finished_at from results, test_definitions, runs where results.test_definition_id = test_definitions.id and results.run_id = runs.id and test_definitions.suite_id = " + suite_id.to_s + " and results.status = 'fail' AND runs.finished_at >= NOW() - INTERVAL "+numberofdays.to_s+" DAY").count 55 | end 56 | 57 | def pass_count(suite_id, numberofdays) 58 | TestDefinition.find_by_sql("SELECT test_definitions.id,test_definitions.name,results.status,runs.id,runs.finished_at from results, test_definitions, runs where results.test_definition_id = test_definitions.id and results.run_id = runs.id and test_definitions.suite_id = " + suite_id.to_s + " and results.status = 'pass' AND runs.finished_at >= NOW() - INTERVAL " + numberofdays.to_s + " DAY").count 59 | end 60 | 61 | end 62 | -------------------------------------------------------------------------------- /app/models/result.rb: -------------------------------------------------------------------------------- 1 | class Result < ActiveRecord::Base 2 | belongs_to :test_definition 3 | belongs_to :run 4 | belongs_to :parent, :foreign_key => "parent_id", :class_name => 'Result' 5 | has_many :children, :foreign_key => "parent_id", :class_name => 'Result', :dependent => :destroy 6 | alias_attribute :test, :test_definition 7 | acts_as_taggable 8 | 9 | after_initialize :init 10 | 11 | def init 12 | @count = {} 13 | end 14 | 15 | STATUS_SCORES = 16 | { "pass" => 5, 17 | "fail" => 4, 18 | "error" => 3, 19 | "timeout" => 2, 20 | "notrun" => 1 } 21 | 22 | #default_scope { includes(:children, :test_definition) } 23 | 24 | before_save do |result| 25 | result.status = Result.normalize_result(result.status) 26 | end 27 | 28 | def self.normalize_result(status) 29 | { "passed" => "pass", 30 | "failed" => "fail", 31 | "errored" => "error", 32 | "undefined" => "notrun", 33 | "skipped" => "notrun" }[status] || status 34 | end 35 | 36 | # Count the status results of children 37 | # result.count(:pass) 38 | def count (status) 39 | # Note the use of collect and count here, rather than just a simple 40 | # count. This is because children is some kind of ActiveRecord array 41 | # and count doesn't work quite as expected on it 42 | if !@count[status] 43 | @count[status] = self.children.collect { |c| c.calculated_status == status.to_s }.count(true) 44 | end 45 | @count[status] 46 | end 47 | 48 | # returns an integer that represents the test result status 49 | # Useful for sorting results based on status 50 | def status_score 51 | STATUS_SCORES[calculated_status] || 0 52 | end 53 | 54 | def calculated_status 55 | if !@calculated_status 56 | @calculated_status = 57 | if status 58 | status 59 | else 60 | Result.summary_status(children.collect { |c| c.calculated_status }) 61 | end 62 | end 63 | @calculated_status 64 | end 65 | 66 | # Given a collection of result objects, return a summary of the 67 | # the result 68 | # i.e. pass, pass, fail => fail 69 | # pass, error, notrun => notrun 70 | def self.summary_status(statuses) 71 | 72 | resulting_status = "error" 73 | resulting_status = "pass" if statuses.count("pass") > 0 74 | resulting_status = "notrun" if statuses.count("notrun") > 0 75 | resulting_status = "fail" if statuses.count("fail") > 0 76 | 77 | resulting_status 78 | end 79 | 80 | def world 81 | run.world 82 | end 83 | end 84 | -------------------------------------------------------------------------------- /app/views/layouts/application.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Testmine 8 | 9 | <%= stylesheet_link_tag "application", media: "all" %> 10 | <%= javascript_include_tag "application" %> 11 | <%= csrf_meta_tags %> 12 | 13 | <%= render partial: 'layouts/favicons' %> 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 57 | 58 | 59 |
60 | 61 | <%= yield %> 62 | 63 |
64 | 65 | 66 | -------------------------------------------------------------------------------- /spec/models/result_history_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe ResultHistory do 4 | describe "Complex result sets" do 5 | 6 | before(:all) do 7 | @world = World::SingleComponent.find_or_create( 8 | :component => "TestMite", 9 | :project => "Titan", 10 | :version => "1.2.3" ) 11 | 12 | @historic_runs = [ 13 | Run.create( world: @world, target: 'x86_64' ), 14 | Run.create( world: @world, target: 'x86_64' ), 15 | Run.create( world: @world, target: 'x86_64' ) 16 | ] 17 | 18 | @historic_parent = TestDefinition.find_or_create( name: 'Top' ) 19 | @historic_test_definitions = [ 20 | TestDefinition.find_or_create( name: 'Child1', parent_id: @historic_parent.id ), 21 | TestDefinition.find_or_create( name: 'Child2', parent_id: @historic_parent.id ), 22 | TestDefinition.find_or_create( name: 'Child3', parent_id: @historic_parent.id ) 23 | ] 24 | 25 | @historic_runs.each do |r| 26 | 27 | parent = Result.create( test_definition_id: @historic_parent.id, status: "pass", run_id: r.id ) 28 | @historic_test_definitions.each do |t| 29 | Result.create( test_definition_id: t.id, status: "pass", run_id: r.id, parent_id: parent.id ) 30 | end 31 | end 32 | 33 | @result_history = ResultHistory.find( :test_definition_id => @historic_parent.id, :target => 'x86_64' ) 34 | 35 | end 36 | 37 | it "has a test_defintion" do 38 | expect(@result_history.test_definition).to eq @historic_parent 39 | end 40 | 41 | it "has a primary result" do 42 | expect( @result_history.primary_result ).to be_a Result 43 | end 44 | 45 | it "has a primary result that is the latest result" do 46 | expect( @result_history.primary_result ).to eq Result.where(:parent_id => nil).last 47 | end 48 | 49 | it "has reference results" do 50 | expect( @result_history.reference_results.count ).to be >= 2 51 | expect( @result_history.reference_results.first ).to be_a Result 52 | end 53 | 54 | it "has child test definitions that correspond to the primary result" do 55 | expect( @result_history.child_test_definitions ).to be_a Array 56 | expect( @result_history.child_test_definitions.first ).to be_a TestDefinition 57 | end 58 | 59 | it "has a child result for the first test defintion" do 60 | test_definition = @result_history.child_test_definitions[0] 61 | expect( @result_history.primary_child(test_definition)).to eq @result_history.primary_children[0] 62 | end 63 | 64 | end 65 | 66 | 67 | 68 | end 69 | -------------------------------------------------------------------------------- /app/models/aggregate_result_comparison.rb: -------------------------------------------------------------------------------- 1 | class AggregateResultComparison 2 | attr_accessor :primary, :reference, :test_definition, :target, :tags 3 | 4 | def initialize( primary_world, reference_world, test_def, target, primary_aggregate_result, reference_aggregate_result, tags ) 5 | @primary = primary_aggregate_result 6 | @reference = reference_aggregate_result 7 | @test_definition = test_def 8 | @target = target 9 | @primary_world = primary_world 10 | @reference_world = reference_world 11 | @tags = tags 12 | 13 | if !@primary 14 | @primary = AggregateResult.new( @test_definition, primary_world, [], target, tags ) 15 | end 16 | 17 | if !@reference 18 | @reference = AggregateResult.new( @test_definition, reference_world, [], target, tags ) 19 | end 20 | end 21 | 22 | # Return the comparison status for the primary world 23 | def status 24 | if !@status 25 | status = @primary.status 26 | if @primary.status == "pass" and @reference.status != "pass" 27 | status = "newpass" 28 | elsif @reference.status == "pass" and @primary.status == "fail" 29 | status = "regres" 30 | end 31 | 32 | if status.match("pass") && @primary.children.count < @reference.children.count 33 | status = "notrun" 34 | end 35 | 36 | if status == "pass" && @primary.children.count > @reference.children.count 37 | status = "newpass" 38 | end 39 | 40 | @status = status 41 | end 42 | @status 43 | end 44 | 45 | # Do primary and reference results differ 46 | def diff 47 | @primary.status != @reference.status || @primary.children.count != @reference.children.count 48 | end 49 | 50 | 51 | def children 52 | if !@children 53 | 54 | primary_child_results_by_test = primary.children.group_by { |r| r.test_definition } 55 | reference_child_results_by_test = reference.children.group_by { |r| r.test_definition } 56 | 57 | tests = primary_child_results_by_test.keys.concat( reference_child_results_by_test.keys ).uniq 58 | 59 | if !primary_child_results_by_test && ! reference_child_results_by_test 60 | @children = [] 61 | else 62 | @children = tests.collect do |test| 63 | primary_aggregate = primary_child_results_by_test[test].pop if primary_child_results_by_test[test] 64 | reference_aggregate = reference_child_results_by_test[test].pop if reference_child_results_by_test[test] 65 | 66 | AggregateResultComparison.new( primary, reference, test, target, primary_aggregate, reference_aggregate, tags ) 67 | end 68 | end 69 | 70 | end 71 | @children 72 | end 73 | 74 | 75 | end -------------------------------------------------------------------------------- /spec/models/test_definition_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe TestDefinition do 4 | describe "find_or_create" do 5 | 6 | it "creates a test definition" do 7 | 8 | test_definition = TestDefinition.find_or_create( 9 | name: 'Scanning item', 10 | node_type: 'Cucumber::Feature', 11 | description: 'Scanning an item', 12 | file: 'items.feature', 13 | line: 1 14 | ) 15 | 16 | test_definition.name.should be_a String 17 | test_definition.node_type.should be_a String 18 | test_definition.description.should be_a String 19 | test_definition.file.should be_a String 20 | test_definition.line.should be_a Fixnum 21 | end 22 | 23 | it "creates 2 definitions for a suite" do 24 | 25 | suite = Suite.find_or_create( 26 | project: 'Titan', 27 | name: 'Cucumber features', 28 | runner: 'Ruby Cucumber', 29 | description: 'Feature files for the Titan project', 30 | documentation: "Long description of what's going on", 31 | url: 'https://www.github.com/bbc-test', 32 | repo: 'https://www.github.com/bbc-test/titan' 33 | ) 34 | 35 | suite.add_test_definition( 36 | name: 'Scanning item', 37 | node_type: 'Cucumber::Feature', 38 | description: 'Scanning an item', 39 | file: 'items.feature', 40 | line: 1 41 | ) 42 | 43 | suite.add_test_definition( 44 | name: 'Showing total', 45 | node_type: 'Cucumber::Feature', 46 | description: 'Showing cart total', 47 | file: 'items.feature', 48 | line: 7 49 | ) 50 | 51 | suite.tests.count.should == 2 52 | 53 | end 54 | 55 | it "creates definition and sub-definition for a suite" do 56 | 57 | suite = Suite.find_or_create( 58 | project: 'Titan', 59 | name: 'Cucumber features', 60 | runner: 'Ruby Cucumber', 61 | ) 62 | 63 | test = suite.add_test_definition( 64 | name: 'Scanning things', 65 | node_type: 'Cucumber::Scenario', 66 | ) 67 | 68 | test.suite.name.should == "Cucumber features" 69 | 70 | subtest = test.add_test_definition( 71 | name: 'Given something', 72 | node_type: 'Cucumber::Step', 73 | ) 74 | 75 | subtest = test.add_test_definition( 76 | name: 'Then something', 77 | node_type: 'Cucumber::Step', 78 | ) 79 | 80 | subtest.parent.name.should == "Scanning things" 81 | 82 | suite.tests.count.should == 1 83 | suite.tests.first.children.count.should == 2 84 | end 85 | 86 | 87 | 88 | end 89 | 90 | end 91 | -------------------------------------------------------------------------------- /app/models/aggregate_result_group.rb: -------------------------------------------------------------------------------- 1 | # world_id, parent_result_id, test_definition_id, target 2 | # best_result_id, status, pass_count, fail_count, error_count, notrun_count 3 | 4 | class AggregateResultGroup 5 | attr_accessor :results, :target, :world 6 | 7 | # 8 | # Create an AggregateResultGroup 9 | # Requires: world_id 10 | # target 11 | # Construncts a result-like object that contains a whole bunch of results 12 | # 13 | def self.populate( args ) 14 | world_id = args[:world_id] or raise "Need to provide a world_id" 15 | 16 | world = World.find(world_id) 17 | target = args[:target] or raise "Need to provide a target" 18 | 19 | tags = args[:tags] 20 | 21 | results_by_test_id = Result.unscoped.includes(:test_definition => :tags, 22 | :children => [ 23 | :children => [:test_definition => :tags], 24 | :test_definition => :tags ]).joins(:run) 25 | .where(:parent_id => nil, 26 | :runs => {:target => target, :world_id => world_id}) 27 | .last(500) 28 | .group_by { |r| r.test_definition_id } 29 | 30 | aggregates = results_by_test_id.values.collect do |results| 31 | AggregateResult.new( results[0].test_definition, world, results, target, tags ) 32 | end 33 | 34 | if tags && !tags.empty? 35 | aggregates = aggregates.select { |ar| ar.tags.any? { |t| tags.include?(t) } } 36 | end 37 | 38 | AggregateResultGroup.new( :results => aggregates, :world => world, :target => target ) 39 | end 40 | 41 | # 42 | # Construct the object 43 | # 44 | def initialize( args ) 45 | @world = args[:world] 46 | @results = args[:results] 47 | @target = args[:target] 48 | @count = {} 49 | end 50 | 51 | # Get a list of tags that all the test_definitions in this aggregate are tagged with 52 | def tags 53 | if !@tags 54 | @tags = results.collect { |r| r.tags }.flatten.uniq 55 | end 56 | @tags 57 | end 58 | 59 | # 60 | # Return the overall status of the target 61 | # 62 | def status 63 | if !@status 64 | @status = 65 | if results.empty? 66 | 'notrun' 67 | else 68 | Result.summary_status(results.collect { |r| r.status } ) 69 | end 70 | end 71 | @status 72 | end 73 | 74 | def confidence 75 | end 76 | 77 | # 78 | # Counts the statuses of all the child elements 79 | # 80 | def count (status) 81 | if !@count[status] 82 | @count[status] = self.results.collect { |c| c.status == status.to_s }.count(true) 83 | end 84 | @count[status] 85 | end 86 | 87 | end 88 | -------------------------------------------------------------------------------- /spec/models/aggregate_result_comparison_group_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe AggregateResultComparisonGroup do 4 | describe "adding a result" do 5 | 6 | before(:each) do 7 | 8 | @test = TestDefinition.find_or_create( 9 | name: 'Scanning item', 10 | node_type: 'Cucumber::Feature' 11 | ) 12 | 13 | @world1 = World::SingleComponent.find_or_create( 14 | :component => "TestMite", 15 | :project => "Titan", 16 | :version => "1.2.3" ) 17 | 18 | @world2 = World::SingleComponent.find_or_create( 19 | :component => "TestMite", 20 | :project => "Titan", 21 | :version => "1.2.4" ) 22 | 23 | @run1 = Run.create( world: @world1, target: 'ubuntu' ) 24 | @run2 = Run.create( world: @world1, target: 'osx' ) 25 | @run3 = Run.create( world: @world2, target: 'ubuntu' ) 26 | @run4 = Run.create( world: @world2, target: 'osx' ) 27 | @run5 = Run.create( world: @world2, target: 'osx' ) 28 | 29 | @result1 = Result.create( 30 | :test_definition_id => @test.id, 31 | :status => "pass", 32 | :run_id => @run1.id 33 | ) 34 | 35 | @result2 = Result.create( 36 | :test_definition_id => @test.id, 37 | :status => "fail", 38 | :run_id => @run2.id 39 | ) 40 | @result3 = Result.create( 41 | :test_definition_id => @test.id, 42 | :status => "fail", 43 | :run_id => @run3.id 44 | ) 45 | @result4 = Result.create( 46 | :test_definition_id => @test.id, 47 | :status => "fail", 48 | :run_id => @run4.id 49 | ) 50 | @result5 = Result.create( 51 | :test_definition_id => @test.id, 52 | :status => "pass", 53 | :run_id => @run5.id 54 | ) 55 | end 56 | 57 | it "produces 1 comparison set from results from 2 worlds" do 58 | comparison = AggregateResultComparisonGroup.populate( :reference_world_id => @world1.id, :primary_world_id => @world2.id, :target => 'osx' ) 59 | expect( comparison.results.count ).to eq 1 60 | expect( comparison.results.first ).to be_a AggregateResultComparison 61 | expect( comparison.status ).to eq "newpass" 62 | end 63 | 64 | it "contains aggregates from two different worlds" do 65 | comparison = AggregateResultComparisonGroup.populate( :reference_world_id => @world1.id, :primary_world_id => @world2.id, :target => 'osx' ) 66 | 67 | expect(comparison.results.first.status).to eq "newpass" 68 | expect(comparison.results.first.reference.world.id).not_to eq comparison.results.first.primary.world.id 69 | 70 | expect(comparison.results.first.reference.status).not_to eq comparison.results.first.primary.status 71 | end 72 | 73 | end 74 | 75 | end 76 | -------------------------------------------------------------------------------- /config/routes.rb: -------------------------------------------------------------------------------- 1 | Testmine::Application.routes.draw do 2 | 3 | root 'suites#index' 4 | get "suites" => 'suites#index' 5 | get "suites/:id" => 'suites#show' 6 | 7 | get "runs/show" 8 | get "worlds/show" 9 | get "worlds/index" 10 | get "worlds/search" => 'worlds#search' 11 | # The priority is based upon order of creation: first created -> highest priority. 12 | # See how all your routes lay out with "rake routes". 13 | 14 | get 'worlds' => 'worlds#index' 15 | get 'worlds/:id' => 'worlds#show' 16 | get 'worlds/:primary/:reference' => 'worlds#compare' 17 | 18 | get 'flaky-test-report/:world_id' => 'flaky_test#show' 19 | 20 | get 'aggregate/:world_id' => 'worlds#aggregate_group_element' 21 | get 'comparison/:primary/:reference' => 'worlds#comparison_group_element' 22 | 23 | get 'runs/:id' => 'runs#show' 24 | get 'reliability/:suite' => 'reliability#show' 25 | 26 | get 'oldtests/:id' => 'tests#show' 27 | get 'tests/:id' => 'tests#history' 28 | 29 | 30 | get '/status' => 'api/v1/status#show' 31 | 32 | namespace :api, defaults: { format: :json } do 33 | namespace :v1 do 34 | post 'submit' => 'results#ingest_ir' 35 | end 36 | end 37 | 38 | # You can have the root of your site routed with "root" 39 | # root 'welcome#index' 40 | 41 | # Example of regular route: 42 | # get 'products/:id' => 'catalog#view' 43 | 44 | # Example of named route that can be invoked with purchase_url(id: product.id) 45 | # get 'products/:id/purchase' => 'catalog#purchase', as: :purchase 46 | 47 | # Example resource route (maps HTTP verbs to controller actions automatically): 48 | # resources :products 49 | 50 | # Example resource route with options: 51 | # resources :products do 52 | # member do 53 | # get 'short' 54 | # post 'toggle' 55 | # end 56 | # 57 | # collection do 58 | # get 'sold' 59 | # end 60 | # end 61 | 62 | # Example resource route with sub-resources: 63 | # resources :products do 64 | # resources :comments, :sales 65 | # resource :seller 66 | # end 67 | 68 | # Example resource route with more complex sub-resources: 69 | # resources :products do 70 | # resources :comments 71 | # resources :sales do 72 | # get 'recent', on: :collection 73 | # end 74 | # end 75 | 76 | # Example resource route with concerns: 77 | # concern :toggleable do 78 | # post 'toggle' 79 | # end 80 | # resources :posts, concerns: :toggleable 81 | # resources :photos, concerns: :toggleable 82 | 83 | # Example resource route within a namespace: 84 | # namespace :admin do 85 | # # Directs /admin/products/* to Admin::ProductsController 86 | # # (app/controllers/admin/products_controller.rb) 87 | # resources :products 88 | # end 89 | end 90 | -------------------------------------------------------------------------------- /app/assets/stylesheets/result_badges.scss: -------------------------------------------------------------------------------- 1 | 2 | // Derived from Bootstrap 2 badges 3 | 4 | // Bootstrap 2 is licensed under apache 2. Take a look at 5 | // the licence information in this directory. 6 | 7 | 8 | .version-label { 9 | color: #000000; 10 | } 11 | 12 | .badge-result { 13 | display: inline-block; 14 | padding: 2px 4px; 15 | font-size: 11.844px; 16 | font-weight: bold; 17 | line-height: 14px; 18 | color: #ffffff; 19 | text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); 20 | white-space: nowrap; 21 | vertical-align: baseline; 22 | background-color: #999999; 23 | width: 30px; 24 | display: inline-block; 25 | text-align: center; 26 | padding-right: 9px; 27 | padding-left: 9px; 28 | -webkit-border-radius: 9px; 29 | -moz-border-radius: 9px; 30 | border-radius: 9px; 31 | } 32 | 33 | .badge-count-0 { 34 | opacity: 0.2; 35 | } 36 | 37 | .panel-heading .badge.badge-fail, 38 | .badge-fail { 39 | background-color: #b94a48; 40 | } 41 | 42 | .badge-fail[href] { 43 | background-color: #953b39; 44 | } 45 | 46 | .panel-heading .badge.badge-notrun, 47 | .badge-notrun { 48 | background-color: #f89406; 49 | } 50 | 51 | .badge-notrun[href] { 52 | background-color: #c67605; 53 | } 54 | 55 | .panel-heading .badge.badge-pass, 56 | .badge-pass { 57 | background-color: #468847; 58 | } 59 | 60 | .badge-pass[href] { 61 | background-color: #356635; 62 | } 63 | 64 | .badge-info { 65 | background-color: #3a87ad; 66 | } 67 | 68 | .badge-info[href] { 69 | background-color: #2d6987; 70 | } 71 | 72 | .panel-heading .badge.badge-error, 73 | .badge-error { 74 | background-color: #333333; 75 | } 76 | 77 | .badge-parent { 78 | } 79 | 80 | 81 | .result { 82 | width: 60px; 83 | display: inline-block; 84 | text-align: center; 85 | font-size: 10.998px; 86 | font-weight: bold; 87 | line-height: 14px; 88 | font-family: monospace; 89 | color: #ffffff; 90 | text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); 91 | white-space: nowrap; 92 | vertical-align: baseline; 93 | background-color: #999999; 94 | padding: 1px 4px 2px; 95 | -webkit-border-radius: 3px; 96 | -moz-border-radius: 3px; 97 | border-radius: 3px; 98 | } 99 | 100 | .result-fail, .result-regression, .result-regres { 101 | background-color: #b94a48; 102 | } 103 | 104 | .result-notrun { 105 | background-color: #f89406; 106 | } 107 | 108 | .result-pass, .result-newpass { 109 | background-color: #468847; 110 | } 111 | 112 | .result-error { 113 | background-color: #333333; 114 | } 115 | 116 | .result-nodiff { 117 | opacity: 0.2; 118 | } 119 | 120 | .table th.world-right-aligned { 121 | text-align: right; 122 | } 123 | 124 | .table-element-center { 125 | text-align: center; 126 | } 127 | 128 | .table-element-left { 129 | text-align: left; 130 | } 131 | 132 | .table-element-right { 133 | text-align: right; 134 | } 135 | -------------------------------------------------------------------------------- /app/views/tests/show.html.erb: -------------------------------------------------------------------------------- 1 |
2 | 3 |

<%= @test.node_type -%>

4 |

<%= @test.name -%>

5 |

<%= @test.description -%>

6 | 7 | 8 | 16 | 17 | 18 |
19 | 20 | <% counter = 0 %> 21 | <% @results_hash.each do |t, a| %> 22 | 23 | <% tab_class='active' if params[:target] == t %> 24 |
25 | <% counter += 1 %> 26 | 27 | 28 | 29 | 30 | 31 | 32 | <% (0..14).each do |i| %> 33 | <% r =a[i] %> 34 | <% if r %> 35 | 36 | 37 | <% else %> 38 | 39 | <% end %> 40 | 41 | <% end %> 42 | 43 | 44 | 45 | 46 | 47 | 48 | <% (0..14).each do |i| %> 49 | <% r = a[i] %> 50 | <% if r %> 51 | 52 | <% else %> 53 | 54 | <% end %> 55 | <% end %> 56 | 57 | 58 | 59 | 60 | 61 | <% if @test.children && !@test.children.empty? -%> 62 | 63 | <% @test.children.each_with_index do |t, j| %> 64 | 65 | 66 | 67 | <% (0..14).each do |i| %> 68 | <% r = a[i] %> 69 | <% if r %> 70 | <% status = ( r.children[j] ? r.children[j].status : 'notrun' ) %> 71 | 72 | <% else %> 73 | 74 | <% end %> 75 | <% end %> 76 | 77 | 78 | <% end %> 79 | 80 | <% end %> 81 |
" class="label label-primary" data-toggle="tooltip" data-placement="top" title="<%= r.world.component -%>: <%= r.world.version -%>"><%= r.world.version -%>
<%= r.status.capitalize[0] -%>
<%= link_to(t.name, "/tests/#{t.id}?target=#{a[0].run.target}") -%><%= status.capitalize[0] -%>
82 | 83 |
84 | <% end %> 85 |
86 | 87 |
88 | 89 | -------------------------------------------------------------------------------- /spec/models/aggregate_result_group_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe AggregateResultGroup do 4 | describe "adding a result" do 5 | 6 | before(:each) do 7 | 8 | @test = TestDefinition.find_or_create( 9 | name: 'Scanning item', 10 | node_type: 'Cucumber::Feature' 11 | ) 12 | 13 | @test2 = TestDefinition.find_or_create( 14 | name: 'Some other thing', 15 | node_type: 'Cucumber::Feature' 16 | ) 17 | 18 | @world = World::SingleComponent.find_or_create( 19 | :component => "TestMite", 20 | :project => "Titan", 21 | :version => "1.2.3" ) 22 | 23 | @run1 = Run.create( world: @world, target: 'osx' ) 24 | @run2 = Run.create( world: @world, target: 'osx' ) 25 | @run3 = Run.create( world: @world, target: 'ubuntu' ) 26 | 27 | @result1 = Result.create( 28 | :test_definition_id => @test.id, 29 | :status => "fail", 30 | :run_id => @run1.id 31 | ) 32 | @result2 = Result.create( 33 | :test_definition_id => @test.id, 34 | :status => "pass", 35 | :run_id => @run2.id 36 | ) 37 | @result3 = Result.create( 38 | :test_definition_id => @test.id, 39 | :status => "pass", 40 | :run_id => @run3.id 41 | ) 42 | @result4 = Result.create( 43 | :test_definition_id => @test2.id, 44 | :status => "fail", 45 | :run_id => @run3.id 46 | ) 47 | 48 | 49 | end 50 | 51 | it "aggregates results for a world and target" do 52 | aggregate_group_1 = AggregateResultGroup.populate( :world_id => @world.id, :target => 'osx' ) 53 | expect(aggregate_group_1.results.count).to eq 1 54 | 55 | aggregate_group_2 = AggregateResultGroup.populate( :world_id => @world.id, :target => 'ubuntu' ) 56 | expect(aggregate_group_2.results.count).to eq 2 57 | end 58 | 59 | it "produces summary counts of child results" do 60 | aggregate_results_1 = AggregateResultGroup.populate( :world_id => @world.id, :target => 'osx' ) 61 | aggregate_results_2 = AggregateResultGroup.populate( :world_id => @world.id, :target => 'ubuntu' ) 62 | 63 | expect(aggregate_results_1.count('pass')).to eq 1 64 | expect(aggregate_results_1.count('fail')).to eq 0 65 | expect(aggregate_results_1.count('error')).to eq 0 66 | 67 | expect(aggregate_results_2.count('pass')).to eq 1 68 | expect(aggregate_results_2.count('fail')).to eq 1 69 | expect(aggregate_results_2.count('error')).to eq 0 70 | 71 | end 72 | 73 | it "produces a summery status for child results" do 74 | aggregate_results_1 = AggregateResultGroup.populate( :world_id => @world.id, :target => 'osx' ) 75 | aggregate_results_2 = AggregateResultGroup.populate( :world_id => @world.id, :target => 'ubuntu' ) 76 | 77 | expect(aggregate_results_1.status).to eq 'pass' 78 | expect(aggregate_results_2.status).to eq 'fail' 79 | 80 | end 81 | 82 | 83 | end 84 | 85 | end 86 | -------------------------------------------------------------------------------- /app/controllers/worlds_controller.rb: -------------------------------------------------------------------------------- 1 | class WorldsController < ApplicationController 2 | def index 3 | @worlds = World.last(100).reverse 4 | end 5 | 6 | 7 | # worlds/search?hive_job_id=3000 8 | def search 9 | 10 | @search_params = {} 11 | 12 | if params[:hive_job_id] 13 | @search_params[:hive_job_id] = params[:hive_job_id] 14 | runs = Run.where( @search_params ) 15 | 16 | if runs && !runs.empty? 17 | world = runs.first.world 18 | redirect_to "/worlds/#{world.id}" 19 | end 20 | 21 | elsif params[:version] 22 | 23 | @search_params[:project] = params[:project] if params[:project] 24 | @search_params[:component] = params[:component] if params[:component] 25 | @search_params[:version] = params[:version] 26 | 27 | world = World.where( @search_params ).last 28 | 29 | if world 30 | redirect_to "/worlds/#{world.id}" 31 | end 32 | 33 | 34 | end 35 | end 36 | 37 | def show 38 | @world = World.includes(:runs).find(params[:id].to_i) 39 | 40 | @runs = @world.runs.reverse 41 | 42 | @tag = params[:tag] if (params[:tag] && params[:tag].length > 0) 43 | 44 | @targets = Run.where( :world_id => @world.id ).pluck('DISTINCT target') 45 | 46 | @comparison_worlds = World.similar(@world).includes(:runs) 47 | end 48 | 49 | def aggregate_group_element 50 | 51 | @target = params[:target] 52 | @world_id = params[:world_id].to_i 53 | @tag = params[:tag] if (params[:tag] && params[:tag].length > 0) 54 | tags = [] 55 | tags.push @tag if @tag 56 | 57 | @results = AggregateResultGroup.populate( :world_id => @world_id, 58 | :target => @target, 59 | :tags => tags ) 60 | 61 | @tags = @results.tags 62 | 63 | render layout: false 64 | end 65 | 66 | 67 | def compare 68 | reference_world_id = params[:reference].to_i 69 | primary_world_id = params[:primary].to_i 70 | @reference_world = World.find(reference_world_id) 71 | @primary_world = World.find(primary_world_id) 72 | 73 | @targets = Run.where( :world_id => [reference_world_id, primary_world_id] ).pluck('DISTINCT target') 74 | end 75 | 76 | def comparison_group_element 77 | @target = params[:target] 78 | @primary_world_id = params[:primary].to_i 79 | @reference_world_id = params[:reference].to_i 80 | @reference_world = World.find(params[:reference].to_i) 81 | @primary_world = World.find(params[:primary].to_i) 82 | @tag = params[:tag] if (params[:tag] && params[:tag].length > 0) 83 | tags = [] 84 | tags.push @tag if @tag 85 | 86 | @results = AggregateResultComparisonGroup.populate( :primary_world_id => @primary_world_id, 87 | :reference_world_id => @reference_world_id, 88 | :target => @target, 89 | :tags => tags ) 90 | render layout: false 91 | end 92 | 93 | 94 | end 95 | -------------------------------------------------------------------------------- /app/helpers/application_helper.rb: -------------------------------------------------------------------------------- 1 | module ApplicationHelper 2 | 3 | def job_count_badge( status, count ) 4 | badge = status_bootstrap_mappings(status) 5 | "#{count}".html_safe 6 | end 7 | 8 | def status_badge( status ) 9 | "#{status.to_s}".html_safe 10 | end 11 | 12 | def filter_status_badge(status, type, batch_id=nil) 13 | link_path = ( type == :batches ) ? filter_batches_path(status) : batch_filter_path(batch_id, status) 14 | link_to "#{status.to_s}".html_safe, link_path 15 | end 16 | 17 | def status_bootstrap_mappings(status) 18 | { 19 | "pass" => 'success', 20 | "fail" => 'important', 21 | "error" => 'inverse', 22 | "notrun" => 'default' 23 | }[status] 24 | end 25 | 26 | # Outputs a time from, realtive to the current time 27 | def pretty_time(time) 28 | if time 29 | time.strftime("%Y-%m-%d %H:%M:%S") 30 | else 31 | "~" 32 | end 33 | end 34 | 35 | # Outputs different time formats relative to the current time 36 | def simple_time(time) 37 | 38 | if !time 39 | "~" 40 | else 41 | 42 | now = Time.now 43 | 44 | format = "%Y-%m-%d %H:%M:%S" 45 | 46 | if time.year == now.year 47 | if time.yday == now.yday 48 | format = "%H:%M:%S" 49 | else 50 | format = "%d-%m %H:%M:%S" 51 | end 52 | end 53 | 54 | time.strftime(format) 55 | end 56 | end 57 | 58 | def pretty_truncate(string, length, emphasis, additional = nil) 59 | 60 | visible_text = string 61 | popup_text = '' 62 | 63 | if string.length > length 64 | popup_text = string 65 | end 66 | 67 | if additional 68 | popup_text = %{#{popup_text} #{additional}} 69 | end 70 | 71 | if popup_text.length > 0 72 | html = %{<#{emphasis}>#{string.truncate(length)}} 73 | html += %{} 74 | else 75 | html = "<#{emphasis}>#{string}" 76 | end 77 | 78 | html.html_safe 79 | end 80 | 81 | def pretty_node( result ) 82 | short_result = result.test_definition.node_type.split('::').last 83 | "#{short_result}".html_safe 84 | end 85 | 86 | def hive_url(args = {}) 87 | if ENV['HIVE_URL'] 88 | base = ENV['HIVE_URL'] 89 | if args[:job] 90 | "#{base}/jobs/#{args[:job].to_s}" 91 | else 92 | base 93 | end 94 | else 95 | nil 96 | end 97 | end 98 | 99 | def hive_job_link( run ) 100 | if hive_url && run.hive_job_id 101 | "".html_safe 102 | else 103 | "" 104 | end 105 | end 106 | 107 | end 108 | -------------------------------------------------------------------------------- /app/models/result_history.rb: -------------------------------------------------------------------------------- 1 | class ResultHistory 2 | 3 | attr_accessor :test_definition 4 | attr_accessor :primary_result 5 | attr_accessor :reference_results #array of reference 6 | 7 | def self.find(args) 8 | 9 | # First identify the test_definition 10 | test_definition_id = args[:test_definition_id] or raise "Need to provide a test definition id" 11 | target = args[:target] or raise "Need to provide a target" 12 | 13 | test_definition = TestDefinition.find( test_definition_id ) 14 | 15 | results = Result.joins(:run).where( :test_definition_id => test_definition_id, :runs => { :target => target } ).reverse 16 | ResultHistory.new( test_definition, results.shift, results ) 17 | end 18 | 19 | def self.find_for_all_targets(args) 20 | 21 | # First identify the test_definition 22 | test_definition_id = args[:test_definition_id] or raise "Need to provide a test definition id" 23 | target = args[:target] 24 | 25 | # Next derive recent targets... 26 | targets = Run.joins(:results => :test_definition).where( :results => {:test_definition_id => test_definition_id} ).order('runs.id DESC').pluck('DISTINCT runs.target' ) 27 | targets.push(target).uniq! if target 28 | 29 | # Finally find the results 30 | targets.reduce({}) { |h, t| h[t] = ResultHistory.find( args.merge({:target=>t}) ); h } 31 | end 32 | 33 | def self.find_for_recent_targets(args) 34 | 35 | # First identify the test_definition 36 | test_definition_id = args[:test_definition_id] or raise "Need to provide a test definition id" 37 | target = args[:target] 38 | 39 | # Next derive recent targets... 40 | targets = Run.joins(:results => :test_definition).where( :results => {:test_definition_id => test_definition_id} ).limit(200).order('runs.id DESC').pluck('DISTINCT runs.target' ) 41 | targets.push(target).uniq! if target 42 | 43 | # Finally find the results 44 | targets.reduce({}) { |h, t| h[t] = ResultHistory.find( args.merge({:target=>t}) ); h } 45 | end 46 | 47 | def self.group_by_commit (histories) 48 | grouped_results = Hash.new 49 | 50 | histories.each do |target, results| 51 | results.reference_results.each do |r| 52 | 53 | commit = r.world.version 54 | status = r.calculated_status 55 | date = r.updated_at 56 | 57 | if !grouped_results.has_key? commit 58 | grouped_results[commit] = Hash.new 59 | end 60 | 61 | grouped_results[commit][:date] = date 62 | 63 | if !grouped_results[commit].has_key? status 64 | grouped_results[commit][status] = 1 65 | else 66 | grouped_results[commit][status] = grouped_results[commit][status] + 1 67 | end 68 | end 69 | end 70 | 71 | return grouped_results 72 | end 73 | 74 | def initialize(test_definition, primary, reference) 75 | @test_definition = test_definition 76 | @primary_result = primary 77 | @reference_results = reference 78 | end 79 | 80 | def primary_children 81 | @primary_result.children 82 | end 83 | 84 | def child_test_definitions 85 | self.primary_children.collect { |c| c.test_definition } 86 | end 87 | 88 | def primary_child(test_definition) 89 | self.primary_children.detect { |c| c.test_definition.id == test_definition.id } 90 | end 91 | 92 | def reference_child(test_definition, i) 93 | if reference_results[i] 94 | reference_results[i].children.detect { |r| r.test_definition.id == test_definition.id } 95 | end 96 | end 97 | 98 | end -------------------------------------------------------------------------------- /config/environments/production.rb: -------------------------------------------------------------------------------- 1 | Testmine::Application.configure do 2 | # Settings specified here will take precedence over those in config/application.rb. 3 | 4 | # Code is not reloaded between requests. 5 | config.cache_classes = true 6 | 7 | # Eager load code on boot. This eager loads most of Rails and 8 | # your application in memory, allowing both thread web servers 9 | # and those relying on copy on write to perform better. 10 | # Rake tasks automatically ignore this option for performance. 11 | config.eager_load = true 12 | 13 | # Full error reports are disabled and caching is turned on. 14 | config.consider_all_requests_local = false 15 | config.action_controller.perform_caching = true 16 | 17 | # Enable Rack::Cache to put a simple HTTP cache in front of your application 18 | # Add `rack-cache` to your Gemfile before enabling this. 19 | # For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid. 20 | # config.action_dispatch.rack_cache = true 21 | 22 | # Disable Rails's static asset server (Apache or nginx will already do this). 23 | config.serve_static_assets = true 24 | 25 | # Compress JavaScripts and CSS. 26 | config.assets.js_compressor = :uglifier 27 | # config.assets.css_compressor = :sass 28 | 29 | # Do not fallback to assets pipeline if a precompiled asset is missed. 30 | config.assets.compile = true 31 | 32 | # Generate digests for assets URLs. 33 | config.assets.digest = true 34 | 35 | # Version of your assets, change this if you want to expire all your assets. 36 | config.assets.version = '1.0' 37 | 38 | # Specifies the header that your server uses for sending files. 39 | # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache 40 | # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx 41 | 42 | # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. 43 | config.force_ssl = true 44 | 45 | # Set to :debug to see everything in the log. 46 | config.log_level = :info 47 | 48 | # Prepend all log lines with the following tags. 49 | # config.log_tags = [ :subdomain, :uuid ] 50 | 51 | # Use a different logger for distributed setups. 52 | # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new) 53 | 54 | # Use a different cache store in production. 55 | # config.cache_store = :mem_cache_store 56 | 57 | # Enable serving of images, stylesheets, and JavaScripts from an asset server. 58 | # config.action_controller.asset_host = "http://assets.example.com" 59 | 60 | # Precompile additional assets. 61 | # application.js, application.css, and all non-JS/CSS in app/assets folder are already added. 62 | # config.assets.precompile += %w( search.js ) 63 | 64 | # Ignore bad email addresses and do not raise email delivery errors. 65 | # Set this to true and configure the email server for immediate delivery to raise delivery errors. 66 | # config.action_mailer.raise_delivery_errors = false 67 | 68 | # Enable locale fallbacks for I18n (makes lookups for any locale fall back to 69 | # the I18n.default_locale when a translation can not be found). 70 | config.i18n.fallbacks = true 71 | 72 | # Send deprecation notices to registered listeners. 73 | config.active_support.deprecation = :notify 74 | 75 | # Disable automatic flushing of the log to improve performance. 76 | # config.autoflush_log = false 77 | 78 | # Use default logging formatter so that PID and timestamp are not suppressed. 79 | config.log_formatter = ::Logger::Formatter.new 80 | 81 | config.assets.paths << "#{Rails.root}/app/assets/fonts" 82 | config.assets.precompile += %w(.svg .eot .woff .ttf) 83 | 84 | end 85 | -------------------------------------------------------------------------------- /app/views/tests/history.html.erb: -------------------------------------------------------------------------------- 1 |
2 | 3 |

<%= @test.node_type-%>

4 |

<%= @test.name -%>

5 |

<%= @test.description -%>

6 | 7 | 8 | 16 | 17 | 18 |
19 | 20 | <% counter = 0 %> 21 | 22 | 23 | 24 | <% if params[:detail] %> 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | <% @grouped_results.each do |commit, values| %> 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | <% end %> 46 |
Updated AtCommitsPassesFailsStatusFlaky (%)
<%= values[:date] %><%= commit %><%= values["pass"] %><%= values["fail"] %><%= "Flaky" if values["pass"] && values["fail"] %><%= (values["fail"].to_f / (values["pass"].to_f + values["fail"].to_f) * 100).round(2) if values["pass"] && values["fail"] %>
47 | 48 | ← Back 49 | <% else %> 50 | <% @histories.each do |target, results| %> 51 | 52 | <% tab_class='active' if params[:target] == target %> 53 |
54 | <% counter += 1 %> 55 | 56 | 57 | 58 | 59 | 60 | <% (-14..0).each do |i| %> 61 | <% r = results.reference_results[i.abs] %> 62 | <% if r %> 63 | 64 | <% else %> 65 | 66 | <% end %> 67 | <% end %> 68 | 69 | 70 | 71 | 72 | <% if results.child_test_definitions && !results.child_test_definitions.empty? -%> 73 | 74 | <% results.child_test_definitions.each_with_index do |t, j| %> 75 | 76 | 77 | <% (-14..0).each do |i| %> 78 | <% r = results.reference_child(t,i.abs) %> 79 | <% if r %> 80 | <% status = ( r ? r.calculated_status : 'notrun' ) %> 81 | 82 | <% else %> 83 | 84 | <% end %> 85 | <% end %> 86 | 87 | 88 | 89 | <% end %> 90 | 91 | <% end %> 92 |
<%= r.calculated_status.capitalize[0] -%><%= results.primary_result.calculated_status.capitalize[0] -%>
<%= link_to(t.name, "/tests/#{t.id}?target=#{target}&test_suite=#{@test_definition_id}&detail=true") -%><%= status.capitalize[0] if status -%><%= results.primary_child(t).calculated_status.capitalize[0] -%>
93 | 94 |
95 | <% end %> 96 | <% end %> 97 |
98 | 99 |
100 | -------------------------------------------------------------------------------- /app/extras/ir_ingestor.rb: -------------------------------------------------------------------------------- 1 | require 'json' 2 | class IrIngestor 3 | 4 | 5 | def self.parse_ir( json ) 6 | 7 | ir = JSON.parse(json) 8 | 9 | type = ir["type"] || "ruby cucumber" 10 | started = ir["started"] 11 | finished = ir["finished"] 12 | target = ir["target"] 13 | project = ir["project"] || ir["world"]["project"] 14 | component= ir["component"] || ir["world"]["component"] 15 | version = ir["version"] || ir["world"]["version"] 16 | results = ir["results"] || ir["tests"] 17 | suite = ir["suite"] 18 | hive_job_id = ir["hive_job_id"] || ir["hive_job"] 19 | 20 | # 21 | # 1) Process the world under test 22 | # 23 | 24 | world = process_world( project, component, version) or raise "Couldn't derive a world" 25 | 26 | 27 | # 28 | # 2) Process the run information 29 | # (Need the world to create a run) 30 | # 31 | 32 | run = Run.create( :started_at => started, 33 | :finished_at => finished, 34 | :target => target, 35 | :hive_job_id => hive_job_id, 36 | :world_id => world.id ) or raise "Couldn't create a new run" 37 | # 38 | # 3) Process the suite 39 | # 40 | suite = Suite.find_or_create( 41 | project: project, 42 | name: suite, 43 | runner: type, 44 | ) 45 | 46 | # 47 | # 4) Process the test results 48 | # (Need the run to associate with results) 49 | # 50 | 51 | results = process_results( run, suite, results, suite ) or raise "Couldn't process results" 52 | 53 | run.status = Result.summary_status( results.collect { |r| r.status } ) 54 | run.save 55 | run 56 | end 57 | 58 | 59 | def self.process_world( project, component, version ) 60 | World::SingleComponent.find_or_create( 61 | :component => component, 62 | :project => project, 63 | :version => version ) 64 | end 65 | 66 | # Recursively process results structure 67 | def self.process_results(run, suite, results_array, parent_definiton, parent_result = nil) 68 | 69 | results = [] 70 | if results_array.respond_to?(:each) 71 | results_array.each do |r| 72 | file = r["file"] 73 | line = r["line"] 74 | type = r["type"] 75 | name = r["name"] 76 | description = r["description"] 77 | children = r["children"] 78 | status = r["status"] 79 | started = r["started"] 80 | finished = r["finished"] 81 | tags = r["tags"] 82 | 83 | 84 | test_definition = parent_definiton.add_test_definition( 85 | name: name, 86 | node_type: type, 87 | file: file, 88 | line: line, 89 | description: description, 90 | tag_list: tags 91 | ) 92 | 93 | # Replace tags with the latest 94 | test_definition.tag_list = tags 95 | test_definition.save 96 | 97 | parent_id = parent_result.id if parent_result 98 | result = Result.create( 99 | :test_definition_id => test_definition.id, 100 | :status => status, 101 | :parent_id => parent_id, 102 | :run_id => run.id, 103 | :started_at => started, 104 | :finished_at => finished, 105 | :tag_list => tags 106 | ) 107 | 108 | if children 109 | child_results = process_results(run, suite, children, test_definition, result) 110 | 111 | if !status 112 | result.status = Result.summary_status( child_results.collect {|c| c.status} ) 113 | # Note: don't save the result 114 | end 115 | end 116 | results.push result 117 | end 118 | else 119 | puts results_array.inspect 120 | end 121 | 122 | results 123 | end 124 | 125 | end 126 | -------------------------------------------------------------------------------- /app/models/aggregate_result_comparison_group.rb: -------------------------------------------------------------------------------- 1 | class AggregateResultComparisonGroup 2 | attr_accessor :primary_world, :reference_world, :results, :target, :tags 3 | 4 | 5 | 6 | def self.populate( args ) 7 | 8 | primary_world_id = args[:primary_world_id] or raise "Need to provide a primary world id" 9 | reference_world_id = args[:reference_world_id] or raise "Need to provide a reference world id" 10 | primary_world = World.find(primary_world_id) 11 | reference_world = World.find(reference_world_id) 12 | target = args[:target] 13 | 14 | tags = args[:tags] 15 | 16 | primary_results_by_test = Result.unscoped 17 | .includes(:test_definition => :tags, 18 | :children => [ 19 | :children => [:test_definition => :tags], 20 | :test_definition => :tags ]) 21 | .joins(:run) 22 | .where(:parent_id => nil, :runs => {:target => target, :world_id => primary_world_id}) 23 | .last(500) 24 | .group_by { |r| r.test_definition } 25 | 26 | reference_results_by_test = Result.unscoped 27 | .includes(:test_definition => :tags, 28 | :children => [ 29 | :children => [:test_definition => :tags], 30 | :test_definition => :tags ]) 31 | .joins(:run) 32 | .where(:parent_id => nil, :runs => {:target => target, :world_id => reference_world_id}) 33 | .last(500) 34 | .group_by { |r| r.test_definition } 35 | 36 | tests = primary_results_by_test.keys.concat(reference_results_by_test.keys).uniq 37 | 38 | aggregates = [] 39 | tests.each do |test| 40 | primary_results = primary_results_by_test[test] || [] 41 | reference_results = reference_results_by_test[test] || [] 42 | 43 | primary_aggregate = AggregateResult.new( test, primary_world, primary_results, target, tags ) 44 | reference_aggregate = AggregateResult.new( test, reference_world, reference_results, target, tags ) 45 | 46 | aggregates.push(AggregateResultComparison.new( primary_world, reference_world, test, target, 47 | primary_aggregate, reference_aggregate, tags) ) 48 | end 49 | 50 | AggregateResultComparisonGroup.new( :primary_world => primary_world, 51 | :reference_world => reference_world, 52 | :target => target, 53 | :results => aggregates, 54 | :tags => tags ) 55 | end 56 | 57 | def initialize( args ) 58 | @primary_world = args[:primary_world] 59 | @reference_world = args[:reference_world] 60 | @results = args[:results] 61 | @target = args[:target] 62 | @tags = args[:tags] 63 | @count = {} 64 | end 65 | 66 | # 67 | # Return the overall status of the target 68 | # 69 | def status 70 | AggregateResultComparisonGroup.summary_status(results.collect {|r| r.status} ) 71 | end 72 | 73 | def diff 74 | results.collect { |r| r.diff }.any? { |v| v == true } 75 | end 76 | 77 | 78 | def self.summary_status(statuses) 79 | 80 | resulting_status = "error" 81 | resulting_status = "pass" if statuses.count("pass") > 0 82 | resulting_status = "newpass" if statuses.count("newpass") > 0 83 | resulting_status = "notrun" if statuses.count("notrun") > 0 84 | resulting_status = "fail" if statuses.count("fail") > 0 85 | resulting_status = "regres" if statuses.count("regres") > 0 86 | 87 | resulting_status 88 | end 89 | 90 | end 91 | -------------------------------------------------------------------------------- /app/models/aggregate_result.rb: -------------------------------------------------------------------------------- 1 | # world_id, parent_result_id, test_definition_id, target 2 | # best_result_id, status, pass_count, fail_count, error_count, notrun_count 3 | 4 | class AggregateResult 5 | attr_accessor :results, :target, :world, :test_definition, :filter_tags 6 | 7 | # Returns an array of AggregateResult children 8 | def children 9 | if !@children 10 | child_result_set = @results.map { |r| r.children } 11 | @children = AggregateResult.process_children(child_result_set.flatten, world, target, self.inherited_tags, filter_tags) 12 | end 13 | @children 14 | end 15 | 16 | def self.process_children( results, world, target, tags, filter_tags ) 17 | results_by_test = results.group_by { |r| r.test_definition } 18 | 19 | filter_tags = [] if !tags.empty? && tags.any? { |t| filter_tags.include?(t) } 20 | 21 | aggregates = results_by_test.collect { |test, result| AggregateResult.new( test, world, result, target, filter_tags ) } 22 | 23 | if filter_tags && !filter_tags.empty? 24 | aggregates = aggregates.select { |ar| ar.tags.any? { |t| filter_tags.include?(t) } } 25 | end 26 | aggregates 27 | end 28 | 29 | def best 30 | if !@best 31 | if !results || results.empty? 32 | @best = Result.new(:status => "notrun") 33 | else 34 | if results.last.status =='pass' 35 | @best = results.last 36 | else 37 | sorted_results = results.sort { |a, b| a.status_score <=> b.status_score } 38 | @best = sorted_results.last 39 | end 40 | end 41 | end 42 | @best 43 | end 44 | 45 | def stability 46 | (results.collect { |r| r.status_score }.sum / best.status_score ) * ( 100 / results.count ) 47 | end 48 | 49 | def confidence 50 | test_definition.confidence 51 | end 52 | 53 | # 54 | # Given a Result, or an array of Results, creates an AggregateResult 55 | # object. 56 | # 57 | def initialize( _test_definition, _world, _result, _target, _filter_tags ) 58 | @test_definition = _test_definition 59 | @world = _world 60 | @results = _result 61 | @filter_tags = _filter_tags 62 | if @results && @results.count > 0 && @results.first.class != Result 63 | raise "Not an array of Results #{caller}" 64 | end 65 | 66 | @target = _target 67 | @count = {} 68 | end 69 | 70 | # 71 | # Methods to make this look more like a Result object 72 | # 73 | def statuses 74 | statuses = results.collect {|r| r.status} 75 | end 76 | 77 | def flaky? 78 | self.statuses.uniq.count > 1 79 | end 80 | 81 | def flakyPercentage 82 | ((self.statuses.count("fail").to_f / self.statuses.count.to_f) * 100).round(2) 83 | end 84 | 85 | def status 86 | if !@status 87 | if self.best.status 88 | @status = self.best.status 89 | # If a status hasn't been set, need to work it out 90 | else 91 | @status = Result.summary_status(children.collect {|r| r.status}) 92 | end 93 | end 94 | @status 95 | end 96 | 97 | # Counts the statuses of all the child elements 98 | def count(status) 99 | if !@count[status.to_sym] 100 | self.children.each { |c| @count[c.status.to_sym] = @count[c.status.to_sym].to_i + 1 } 101 | @count.default = 0 102 | end 103 | @count[status.to_sym] 104 | end 105 | 106 | def inherited_tags 107 | if !@inherited_tags 108 | @inherited_tags = self.test_definition.specific_tags 109 | end 110 | @inherited_tags 111 | end 112 | 113 | def tags 114 | if !@tags 115 | all = self.test_definition.specific_tags 116 | if !self.is_a_test? 117 | all += self.children.collect { |c| c.tags } 118 | end 119 | @tags = all.flatten.uniq 120 | end 121 | @tags 122 | end 123 | 124 | # Is this an actual test node -- i.e. does it have a status 125 | # TODO Create new step class to make optimisations easier 126 | def is_a_test? 127 | self.best.status 128 | end 129 | 130 | end 131 | -------------------------------------------------------------------------------- /app/views/worlds/show.html.erb: -------------------------------------------------------------------------------- 1 |
2 |

3 | <% if @world.project.eql? @world.component %> 4 | <%= @world.project -%> 5 | <% else %> 6 | <%= @world.project + ": " + @world.component -%> 7 | <% end %> 8 |

9 |

<%= @world.name -%>

10 |
11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
ID<%= @world.id -%>
Component<%= @world.component -%>
Version<%= @world.version -%>
Runs<%= @world.runs.count -%>
20 |
21 | 22 | 23 |
24 |

25 |

30 |

31 |
32 | 33 | 34 |
35 | 36 | 37 | 43 | 44 | 45 | 46 |
47 | 48 |
49 | 50 |
51 | 52 |
53 | 54 | <% @targets.each do |t| %> 55 | 56 |
57 |
58 |

59 | <%=t-%> 60 | 61 | ???? 62 | ? 63 | ? 64 | ? 65 | ? 66 | 67 |

68 |
69 |
70 |
71 |
72 | <% end %> 73 |
74 | 75 |
76 | 77 | 78 | 79 |
80 | 81 |
82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | <% @runs.each do |r| %> 97 | 98 | 99 | 100 | 101 | 104 | 105 | 106 | 107 | 108 | <% end %> 109 | 110 |
Run IDTargetStatusStartedDuration
<%= link_to r.id, "/runs/#{r.id}" -%><%= r.target -%><%= status_badge(r.status) -%> 102 | <%= hive_job_link(r) -%> 103 | <%= r.started_at ? r.started_at.to_s(:short) : '-' -%><%= r.duration -%>
111 | 112 |
113 | 114 | 115 |
116 | 117 |
118 | 119 |

Compare results against...

120 |
    121 | 122 | <% if @comparison_worlds.empty? %> 123 | 124 |

    Couldn't find any comparison worlds

    125 | 126 | <% end %> 127 | 128 |
    129 | 130 | 131 | <% @comparison_worlds.each do |w| %> 132 | 133 | 134 | 135 | 136 | 137 | <% end %> 138 |
    <%= link_to w.version, "/worlds/#{@world.id}/#{w.id}" -%><%= w.runs.count -%><%= time_ago_in_words w.created_at -%> ago
    139 | 140 |
    141 | 142 |
143 | 144 |
145 | 146 | 147 | 154 | -------------------------------------------------------------------------------- /app/views/runs/show.html.erb: -------------------------------------------------------------------------------- 1 |
2 |

Run <%= @run.id -%>

3 |

Target: <%= @run.target -%>

4 |

World: <%= link_to "#{@run.world.component}: #{@run.world.version}", "/worlds/#{@run.world.id}" -%>

5 |

<%= @run.status -%> 6 |

7 |
8 | 9 |
10 |
11 | 12 | 13 | 14 | 15 | 21 | 22 | 23 | 24 | <% @run.top_level_results.each do |r| %> 25 | 26 | 27 | 28 | 29 | 30 | 33 | 39 | 40 | 41 | <% r.children.each do |s| %> 42 | 43 | 44 | 45 | 46 | 47 | 50 | 51 | 57 | 58 | 59 | <% s.children.each do |s| %> 60 | 61 | 62 | 63 | 64 | 65 | 68 | 69 | 77 | 78 | 79 | <% end %> 80 | 81 | 82 | <% end %> 83 | 84 | 85 | 86 | <% end %> 87 | 88 |
16 | P 17 | F 18 | N 19 | E 20 |
<%= pretty_node(r) -%><%= link_to( pretty_truncate("#{h r.test_definition.name}", 80, 'strong', r.test_definition.file_name(:short) ), "/tests/#{r.test_definition.id}?target=#{@run.target}") -%> 31 | <%= r.calculated_status -%> 32 | 34 | <%= r.count(:pass) %> 35 | <%= r.count(:fail) or 0 %> 36 | <%= r.count(:notrun) %> 37 | <%= r.count(:error) -%> 38 | <%= simple_time(r.finished_at) %>
<%= pretty_node(s) -%><%= link_to( pretty_truncate(h(s.test.name), 80, 'em'), "/tests/#{s.test.id}?target=#{@run.target}&test_suite=#{@test_definition_id}&detail=true") -%> 48 | <%= s.calculated_status -%> 49 | 52 | <%= s.count(:pass) %> 53 | <%= s.count(:fail) or 0 %> 54 | <%= s.count(:notrun) %> 55 | <%= s.count(:error) -%> 56 | <%= simple_time(r.finished_at) %>
<%= pretty_node(s) -%><%= pretty_truncate(h(s.test.name), 80, 'em') -%> 66 | <%= s.calculated_status -%> 67 | 70 | <% if s.children.count > 0 %> 71 | <%= s.count(:pass) %> 72 | <%= s.count(:fail) or 0 %> 73 | <%= s.count(:notrun) %> 74 | <%= s.count(:error) -%> 75 | <% end %> 76 | <%= simple_time(r.finished_at) %>
89 |
90 |
91 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Testmine 2 | 3 | Testmine is test results tool for storing and analysing result data. Testmine takes result output for a test run, and stores it in a result bucket for historic analysis. 4 | 5 | ## Concepts 6 | 7 | ### Worlds 8 | 9 | Testmine stores test results in buckets called worlds. A world is identified by the project, component, and version strings submitted along with the test results. So, for example, if you're testing a mobile application like iPlayer, you might submit against: 10 | 11 | project: 'iPlayer', 12 | component: 'android' 13 | version: 14 | 15 | This would mean every build has its results captured in a different bucket. Testmine uses the project and component names to allow you to compare worlds under test. So you could compare a new feature branch build, '1.1-new-feature' against the results for your last know release candidate: '1.0-rc' 16 | 17 | ### Runs 18 | 19 | Runs are the individual executions of your test suites. A run may comprise multiple test results for a particular world and target. A target represents the platform you are testing against. So for our Android app, it might be a particular device or OS build. You can view individual run results in testmine by clicking on a run id. While it can be useful to look at specific run results, the aggregated world views give an overview of your testing for a particular world. 20 | 21 | ### Aggregate Results 22 | 23 | Testmine aggregates all the runs for a world into a single-page aggregated view of the results. Results are organised by target. It's important to note that the aggregated view takes the best results from across your test runs. So if you have two different runs, and a test passed in first run, but failed in the second run, the second result is discarded. This behaviour means that testmine filters out failed results where test behaviour is inconsistent. 24 | 25 | ### Comparison Results 26 | 27 | Testmine can present a side-by-side view of aggregate results for two worlds. Testmine compares the results to provide a comparason status. They have the following meanings: 28 | * **PASS** Results passed consistently in line with the reference world 29 | * **NEWPASS** Tests that previously failed are now passing 30 | * **REGRESS** Tests that previously passed are now failing 31 | * **FAIL** Tests that failed previously are still failing 32 | * **ERROR** Tests failed to execute correctly 33 | * **NOTRUN** The tests have not been run 34 | 35 | In addition, the comparison result will be faded if the results between the two worlds exactly match. 36 | 37 | ## Running testmine 38 | 39 | Testmine is a straightforward Rails application. You can deploy a local copy easily by checking it out and running: 40 | 41 | 42 | ### Method # 1: Run directly on Host Machine 43 | 44 | bundle install --local --without development test 45 | bundle exec rake db:migrate 46 | bundle exec rails s 47 | 48 | You should get a testmine instance on port 3002 with an sqlite database. 49 | 50 | ### Method # 2: Run it on Docker 51 | 52 | #### Prerequiste for Docker 53 | 1. Download and install docker https://docs.docker.com/docker-for-mac/install/ 54 | 2. Install virtualbox on your machine. 55 | ``` 56 | $ brew cask install virtualbox 57 | ``` 58 | 3. Create a default docker machine 59 | ``` 60 | $ docker-machine create default 61 | ``` 62 | 4. Ensure your docker machine is running 63 | ``` 64 | $ docker-machine status 65 | ``` 66 | It should say "Running". 67 | 68 | 5. Get the ip address of your docker machine 69 | ``` 70 | $ docker-machine env default 71 | ... 72 | export DOCKER_HOST="tcp://192.168.99.100:2376" 73 | ... 74 | ``` 75 | The ip address is 192.168.99.100 in this case. 76 | 6. Run the following command to configure your shell 77 | ``` 78 | eval $(docker-machine env default) 79 | ``` 80 | 81 | #### Run testmine on Docker 82 | 83 | Run the following to startup a docker machine for testmine. 84 | 85 | ``` 86 | docker-compose build 87 | docker-compose up 88 | ``` 89 | 90 | Visit the browser http://192.168.99.100:3002 to see the output. 91 | 92 | 93 | 94 | ## Submitting results 95 | 96 | In order to submit your results to testmine, you will need to format your test results as Res IR 97 | (see our [res](https://github.com/bbc/res) repo for more information). Res provides a number of formatters for sumbitting from popular test runner such as cucumber and rspec. 98 | 99 | Alternatively you can hand-craft your own res output, and submit it against the endpoint: /api/v1/submit 100 | 101 | ## License 102 | 103 | Testmine is available to everyone under the terms of the MIT open source licence. 104 | Take a look at the LICENSE file in the code. 105 | 106 | Copyright (c) 2016 BBC 107 | -------------------------------------------------------------------------------- /app/views/worlds/aggregate_group_element.html.erb: -------------------------------------------------------------------------------- 1 |
2 | <% if !@tags.empty? %> 3 | <% @tags.each do |t| %> 4 | 10 | <% end %> 11 | <% end %> 12 | 13 | 27 | 28 |
29 | 30 | <% if !@results.results.empty? %> 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 45 | 46 | 47 | <% @results.results.each do |r| %> 48 | 49 | 50 | 51 | 54 | 55 | 59 | 60 | 61 | 64 | 65 | 71 | 72 | 73 | <% r.children.each do |s| %> 74 | 75 | 76 | 77 | 78 | 79 | 83 | 84 | 85 | 89 | 90 | 96 | 97 | 98 | 99 | <% end %> 100 | <% end %> 101 | 102 |
SnResult 40 | P 41 | F 42 | N 43 | E 44 |
<%= pretty_node(r) -%> 52 | <%= link_to( pretty_truncate(h(r.test_definition.name), 80, 'strong', h(r.test_definition.file_name(:short))), "/tests/#{r.test_definition.id}?target=#{@target}") -%> 53 | 56 | <%= r.stability -%> 57 | <%= r.confidence -%> 58 | <%= r.results.count %> 62 | <%= r.status -%> 63 | 66 | <%= r.count(:pass) %> 67 | <%= r.count(:fail) or 0 %> 68 | <%= r.count(:notrun) %> 69 | <%= r.count(:error) -%> 70 |
<%= pretty_node(s) -%><%= link_to( pretty_truncate(h(s.test_definition.name), 80, 'em'), "/tests/#{s.test_definition.id}?target=#{@target}&detail=true") -%> 80 | <%= s.stability -%> 81 | <%= s.confidence -%> 82 | <%= s.results.count %> 86 | <%= s.status -%> 87 | <%= hive_job_link(s.best.run) if s.best -%> 88 | 91 | <%= s.best.count(:pass) %> 92 | <%= s.best.count(:fail) or 0 %> 93 | <%= s.best.count(:notrun) %> 94 | <%= s.best.count(:error) -%> 95 |
103 | 104 | <% end %> 105 | 106 |
107 |
108 | -------------------------------------------------------------------------------- /db/schema.rb: -------------------------------------------------------------------------------- 1 | # This file is auto-generated from the current state of the database. Instead 2 | # of editing this file, please use the migrations feature of Active Record to 3 | # incrementally modify your database, and then regenerate this schema definition. 4 | # 5 | # Note that this schema.rb definition is the authoritative source for your 6 | # database schema. If you need to create the application database on another 7 | # system, you should be using db:schema:load, not running all the migrations 8 | # from scratch. The latter is a flawed and unsustainable approach (the more migrations 9 | # you'll amass, the slower it'll run and the greater likelihood for issues). 10 | # 11 | # It's strongly recommended that you check this file into your version control system. 12 | 13 | ActiveRecord::Schema.define(version: 20160216102230) do 14 | 15 | create_table "results", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci" do |t| 16 | t.integer "test_definition_id" 17 | t.integer "run_id" 18 | t.integer "parent_id" 19 | t.integer "value" 20 | t.string "status" 21 | t.text "output", limit: 65535 22 | t.datetime "started_at" 23 | t.datetime "finished_at" 24 | t.datetime "created_at" 25 | t.datetime "updated_at" 26 | t.index ["parent_id"], name: "index_results_on_parent_id", using: :btree 27 | t.index ["run_id", "test_definition_id"], name: "index_results_on_run_id_and_test_definition_id", using: :btree 28 | t.index ["run_id"], name: "index_results_on_run_id", using: :btree 29 | t.index ["test_definition_id"], name: "index_results_on_test_definition_id", using: :btree 30 | end 31 | 32 | create_table "runs", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci" do |t| 33 | t.integer "world_id" 34 | t.string "owner" 35 | t.integer "hive_job_id" 36 | t.string "target" 37 | t.string "status" 38 | t.datetime "started_at" 39 | t.datetime "finished_at" 40 | t.datetime "created_at" 41 | t.datetime "updated_at" 42 | t.index ["world_id"], name: "index_runs_on_world_id", using: :btree 43 | end 44 | 45 | create_table "suites", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci" do |t| 46 | t.string "project" 47 | t.string "name" 48 | t.string "runner" 49 | t.string "description" 50 | t.text "documentation", limit: 65535 51 | t.string "url" 52 | t.string "repo" 53 | t.datetime "created_at" 54 | t.datetime "updated_at" 55 | t.index ["project", "name"], name: "index_suites_on_project_and_name", using: :btree 56 | end 57 | 58 | create_table "taggings", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci" do |t| 59 | t.integer "tag_id" 60 | t.integer "taggable_id" 61 | t.string "taggable_type" 62 | t.integer "tagger_id" 63 | t.string "tagger_type" 64 | t.string "context", limit: 128 65 | t.datetime "created_at" 66 | t.index ["tag_id", "taggable_id", "taggable_type", "context", "tagger_id", "tagger_type"], name: "taggings_idx", unique: true, using: :btree 67 | t.index ["taggable_id", "taggable_type", "context"], name: "index_taggings_on_taggable_id_and_taggable_type_and_context", using: :btree 68 | end 69 | 70 | create_table "tags", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci" do |t| 71 | t.string "name" 72 | t.integer "taggings_count", default: 0 73 | t.index ["name"], name: "index_tags_on_name", unique: true, using: :btree 74 | end 75 | 76 | create_table "test_definitions", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci" do |t| 77 | t.string "name" 78 | t.string "node_type" 79 | t.text "description", limit: 65535 80 | t.string "file" 81 | t.integer "line" 82 | t.integer "parent_id" 83 | t.integer "suite_id" 84 | t.datetime "created_at" 85 | t.datetime "updated_at" 86 | t.index ["name", "suite_id", "file", "parent_id"], name: "lookup", using: :btree 87 | t.index ["suite_id"], name: "index_test_definitions_on_suite_id", using: :btree 88 | end 89 | 90 | create_table "worlds", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci" do |t| 91 | t.string "type" 92 | t.string "name" 93 | t.text "description", limit: 65535 94 | t.string "project" 95 | t.string "component" 96 | t.string "version" 97 | t.datetime "created_at" 98 | t.datetime "updated_at" 99 | t.index ["project", "component", "version"], name: "index_worlds_on_project_and_component_and_version", using: :btree 100 | t.index ["project", "component"], name: "index_worlds_on_project_and_component", using: :btree 101 | end 102 | 103 | end 104 | -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | GEM 2 | remote: https://rubygems.org/ 3 | specs: 4 | actioncable (5.0.7.1) 5 | actionpack (= 5.0.7.1) 6 | nio4r (>= 1.2, < 3.0) 7 | websocket-driver (~> 0.6.1) 8 | actionmailer (5.0.7.1) 9 | actionpack (= 5.0.7.1) 10 | actionview (= 5.0.7.1) 11 | activejob (= 5.0.7.1) 12 | mail (~> 2.5, >= 2.5.4) 13 | rails-dom-testing (~> 2.0) 14 | actionpack (5.0.7.1) 15 | actionview (= 5.0.7.1) 16 | activesupport (= 5.0.7.1) 17 | rack (~> 2.0) 18 | rack-test (~> 0.6.3) 19 | rails-dom-testing (~> 2.0) 20 | rails-html-sanitizer (~> 1.0, >= 1.0.2) 21 | actionview (5.0.7.1) 22 | activesupport (= 5.0.7.1) 23 | builder (~> 3.1) 24 | erubis (~> 2.7.0) 25 | rails-dom-testing (~> 2.0) 26 | rails-html-sanitizer (~> 1.0, >= 1.0.3) 27 | activejob (5.0.7.1) 28 | activesupport (= 5.0.7.1) 29 | globalid (>= 0.3.6) 30 | activemodel (5.0.7.1) 31 | activesupport (= 5.0.7.1) 32 | activerecord (5.0.7.1) 33 | activemodel (= 5.0.7.1) 34 | activesupport (= 5.0.7.1) 35 | arel (~> 7.0) 36 | activesupport (5.0.7.1) 37 | concurrent-ruby (~> 1.0, >= 1.0.2) 38 | i18n (>= 0.7, < 2) 39 | minitest (~> 5.1) 40 | tzinfo (~> 1.1) 41 | acts-as-taggable-on (6.0.0) 42 | activerecord (~> 5.0) 43 | arel (7.1.4) 44 | autoprefixer-rails (9.4.2) 45 | execjs 46 | backports (3.11.4) 47 | bootstrap-sass (3.3.7) 48 | autoprefixer-rails (>= 5.2.1) 49 | sass (>= 3.3.4) 50 | builder (3.2.3) 51 | concurrent-ruby (1.1.3) 52 | crass (1.0.4) 53 | daemons (1.2.6) 54 | erubis (2.7.0) 55 | eventmachine (1.2.7) 56 | execjs (2.7.0) 57 | ffi (1.9.25) 58 | font-awesome-sass (5.5.0.1) 59 | sassc (>= 1.11) 60 | globalid (0.4.1) 61 | activesupport (>= 4.2.0) 62 | i18n (1.1.1) 63 | concurrent-ruby (~> 1.0) 64 | jbuilder (2.8.0) 65 | activesupport (>= 4.2.0) 66 | multi_json (>= 1.2) 67 | jquery-rails (4.3.3) 68 | rails-dom-testing (>= 1, < 3) 69 | railties (>= 4.2.0) 70 | thor (>= 0.14, < 2.0) 71 | loofah (2.2.3) 72 | crass (~> 1.0.2) 73 | nokogiri (>= 1.5.9) 74 | mail (2.7.1) 75 | mini_mime (>= 0.1.1) 76 | method_source (0.9.2) 77 | mini_mime (1.0.1) 78 | mini_portile2 (2.3.0) 79 | minitest (5.11.3) 80 | multi_json (1.13.1) 81 | mysql2 (0.5.2) 82 | nio4r (2.3.1) 83 | nokogiri (1.8.5) 84 | mini_portile2 (~> 2.3.0) 85 | rack (2.0.6) 86 | rack-test (0.6.3) 87 | rack (>= 1.0) 88 | rails (5.0.7.1) 89 | actioncable (= 5.0.7.1) 90 | actionmailer (= 5.0.7.1) 91 | actionpack (= 5.0.7.1) 92 | actionview (= 5.0.7.1) 93 | activejob (= 5.0.7.1) 94 | activemodel (= 5.0.7.1) 95 | activerecord (= 5.0.7.1) 96 | activesupport (= 5.0.7.1) 97 | bundler (>= 1.3.0) 98 | railties (= 5.0.7.1) 99 | sprockets-rails (>= 2.0.0) 100 | rails-dom-testing (2.0.3) 101 | activesupport (>= 4.2.0) 102 | nokogiri (>= 1.6) 103 | rails-html-sanitizer (1.0.4) 104 | loofah (~> 2.2, >= 2.2.2) 105 | railties (5.0.7.1) 106 | actionpack (= 5.0.7.1) 107 | activesupport (= 5.0.7.1) 108 | method_source 109 | rake (>= 0.8.7) 110 | thor (>= 0.18.1, < 2.0) 111 | rake (12.3.2) 112 | rb-fsevent (0.10.3) 113 | rb-inotify (0.9.10) 114 | ffi (>= 0.5.0, < 2) 115 | sass (3.7.2) 116 | sass-listen (~> 4.0.0) 117 | sass-listen (4.0.0) 118 | rb-fsevent (~> 0.9, >= 0.9.4) 119 | rb-inotify (~> 0.9, >= 0.9.7) 120 | sass-rails (5.0.7) 121 | railties (>= 4.0.0, < 6) 122 | sass (~> 3.1) 123 | sprockets (>= 2.8, < 4.0) 124 | sprockets-rails (>= 2.0, < 4.0) 125 | tilt (>= 1.1, < 3) 126 | sassc (2.0.0) 127 | ffi (~> 1.9.6) 128 | rake 129 | sprockets (3.7.2) 130 | concurrent-ruby (~> 1.0) 131 | rack (> 1, < 3) 132 | sprockets-rails (3.2.1) 133 | actionpack (>= 4.0) 134 | activesupport (>= 4.0) 135 | sprockets (>= 3.0.0) 136 | thin (1.7.2) 137 | daemons (~> 1.0, >= 1.0.9) 138 | eventmachine (~> 1.0, >= 1.0.4) 139 | rack (>= 1, < 3) 140 | thor (0.20.3) 141 | thread_safe (0.3.6) 142 | tilt (2.0.9) 143 | token_phrase (1.0.6) 144 | backports 145 | tzinfo (1.2.5) 146 | thread_safe (~> 0.1) 147 | uglifier (4.1.20) 148 | execjs (>= 0.3.0, < 3) 149 | websocket-driver (0.6.5) 150 | websocket-extensions (>= 0.1.0) 151 | websocket-extensions (0.1.3) 152 | 153 | PLATFORMS 154 | ruby 155 | 156 | DEPENDENCIES 157 | acts-as-taggable-on (= 6.0.0) 158 | bootstrap-sass (= 3.3.7) 159 | font-awesome-sass (= 5.5.0.1) 160 | jbuilder (= 2.8.0) 161 | jquery-rails (= 4.3.3) 162 | mysql2 (= 0.5.2) 163 | nokogiri (= 1.8.5) 164 | rails (= 5.0.7.1) 165 | sass-rails (= 5.0.7) 166 | thin (= 1.7.2) 167 | token_phrase (= 1.0.6) 168 | uglifier (= 4.1.20) 169 | 170 | BUNDLED WITH 171 | 1.16.1 172 | -------------------------------------------------------------------------------- /app/views/worlds/comparison_element.html.erb: -------------------------------------------------------------------------------- 1 | <% c = @comparison %> 2 | 3 | <%= pretty_node(c) -%> 4 | 5 | <%= link_to( pretty_truncate(h(c.test_definition.name), 80, 'strong', h(c.test_definition.file_name(:short))), "/tests/#{c.test_definition.id}?target=#{@target}") -%> 6 | 7 | <%= c.reference.results.count -%> 8 | 9 | "><%= c.reference.count("pass") %> 10 | "><%= c.reference.count("fail") or 0 %> 11 | "><%= c.reference.count("notrun") %> 12 | "><%= c.reference.count("error") -%> 13 | 14 | 15 | 16 | <%= c.reference.status -%> 17 | 18 | 19 | <%= c.primary.status -%> 20 | 21 | 22 | 23 | "><%= c.primary.count("pass") %> 24 | "><%= c.primary.count("fail") or 0 %> 25 | "><%= c.primary.count("notrun") %> 26 | "><%= c.primary.count("error") -%> 27 | 28 | <%= c.primary.results.count %> 29 | 30 | 31 | <%= c.status -%> 32 | 33 | 34 | 35 | 36 | <% c.children.each do |s| %> 37 | 38 | <%= pretty_node(s) -%> 39 | <%= link_to( pretty_truncate(h(s.test_definition.name), 80, 'em'), "/tests/#{s.test_definition.id}?target=#{@target}") -%> 40 | 41 | <%= s.reference.results.count -%> 42 | 43 | "><%= s.reference.count("pass") %> 44 | "><%= s.reference.count("fail") or 0 %> 45 | "><%= s.reference.count("notrun") %> 46 | "><%= s.reference.count("error") -%> 47 | 48 | 49 | <%= hive_job_link(s.reference.best.run) if s.reference.best && s.reference.best.run -%> 50 | 51 | 52 | <%= s.reference.status -%> 53 | 54 | 55 | <%= s.primary.status -%> 56 | 57 | 58 | <%= hive_job_link(s.primary.best.run) if s.primary.best && s.primary.best.run -%> 59 | 60 | 61 | "><%= s.primary.count("pass") %> 62 | "><%= s.primary.count("fail") or 0 %> 63 | "><%= s.primary.count("notrun") %> 64 | "><%= s.primary.count("error") -%> 65 | 66 | <%= s.primary.results.count -%> 67 | 68 | 69 | <%= s.status -%> 70 | 71 | 72 | 73 | 74 | <% end %> 75 | 76 | 77 | -------------------------------------------------------------------------------- /app/views/worlds/comparison_group_element.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 |

4 | <%=@target-%> 5 | 6 | <%= @results.status -%> 7 | 8 |

9 |
10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 32 | 33 | 34 | 35 | 36 | 42 | 43 | 44 | 45 | 46 | 47 | <% @results.results.each do |c| %> 48 | 49 | 50 | 51 | 53 | 54 | 60 | 61 | 64 | 67 | 68 | 74 | 75 | 76 | 79 | 80 | 81 | 82 | <% c.children.each do |s| %> 83 | 84 | 85 | 86 | 87 | 88 | 94 | 97 | 100 | 103 | 106 | 112 | 113 | 114 | 117 | 118 | 119 | 120 | <% end %> 121 | 122 | <% end %> 123 | 124 | 125 | -------------------------------------------------------------------------------- /docker/docker-entrypoint-initdb.d/01-testmite_structure.sql: -------------------------------------------------------------------------------- 1 | -- MySQL dump 10.14 Distrib 5.5.60-MariaDB, for Linux (x86_64) 2 | -- 3 | -- Host: app-db Database: testmite 4 | -- ------------------------------------------------------ 5 | -- Server version 5.7.24 6 | 7 | /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; 8 | /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; 9 | /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; 10 | /*!40101 SET NAMES utf8 */; 11 | /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; 12 | /*!40103 SET TIME_ZONE='+00:00' */; 13 | /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; 14 | /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; 15 | /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; 16 | /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; 17 | 18 | -- 19 | -- Create the database `testmite` 20 | -- 21 | 22 | CREATE DATABASE testmite; 23 | USE testmite; 24 | 25 | -- 26 | -- Table structure for table `results` 27 | -- 28 | 29 | DROP TABLE IF EXISTS `results`; 30 | /*!40101 SET @saved_cs_client = @@character_set_client */; 31 | /*!40101 SET character_set_client = utf8 */; 32 | CREATE TABLE `results` ( 33 | `id` int(11) NOT NULL AUTO_INCREMENT, 34 | `test_definition_id` int(11) DEFAULT NULL, 35 | `run_id` int(11) DEFAULT NULL, 36 | `parent_id` int(11) DEFAULT NULL, 37 | `value` int(11) DEFAULT NULL, 38 | `status` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, 39 | `output` text COLLATE utf8_unicode_ci, 40 | `started_at` datetime DEFAULT NULL, 41 | `finished_at` datetime DEFAULT NULL, 42 | `created_at` datetime DEFAULT NULL, 43 | `updated_at` datetime DEFAULT NULL, 44 | PRIMARY KEY (`id`), 45 | KEY `index_results_on_parent_id` (`parent_id`), 46 | KEY `index_results_on_run_id` (`run_id`), 47 | KEY `index_results_on_run_id_and_test_definition_id` (`run_id`,`test_definition_id`), 48 | KEY `index_results_on_test_definition_id` (`test_definition_id`) 49 | ) ENGINE=InnoDB AUTO_INCREMENT=18595903 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 50 | /*!40101 SET character_set_client = @saved_cs_client */; 51 | 52 | -- 53 | -- Table structure for table `runs` 54 | -- 55 | 56 | DROP TABLE IF EXISTS `runs`; 57 | /*!40101 SET @saved_cs_client = @@character_set_client */; 58 | /*!40101 SET character_set_client = utf8 */; 59 | CREATE TABLE `runs` ( 60 | `id` int(11) NOT NULL AUTO_INCREMENT, 61 | `world_id` int(11) DEFAULT NULL, 62 | `owner` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, 63 | `hive_job_id` int(11) DEFAULT NULL, 64 | `target` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, 65 | `status` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, 66 | `started_at` datetime DEFAULT NULL, 67 | `finished_at` datetime DEFAULT NULL, 68 | `created_at` datetime DEFAULT NULL, 69 | `updated_at` datetime DEFAULT NULL, 70 | PRIMARY KEY (`id`), 71 | KEY `index_runs_on_world_id` (`world_id`) 72 | ) ENGINE=InnoDB AUTO_INCREMENT=411184 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 73 | /*!40101 SET character_set_client = @saved_cs_client */; 74 | 75 | -- 76 | -- Table structure for table `schema_migrations` 77 | -- 78 | 79 | DROP TABLE IF EXISTS `schema_migrations`; 80 | /*!40101 SET @saved_cs_client = @@character_set_client */; 81 | /*!40101 SET character_set_client = utf8 */; 82 | CREATE TABLE `schema_migrations` ( 83 | `version` varchar(255) COLLATE utf8_unicode_ci NOT NULL, 84 | UNIQUE KEY `unique_schema_migrations` (`version`) 85 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 86 | /*!40101 SET character_set_client = @saved_cs_client */; 87 | 88 | -- 89 | -- Table structure for table `suites` 90 | -- 91 | 92 | DROP TABLE IF EXISTS `suites`; 93 | /*!40101 SET @saved_cs_client = @@character_set_client */; 94 | /*!40101 SET character_set_client = utf8 */; 95 | CREATE TABLE `suites` ( 96 | `id` int(11) NOT NULL AUTO_INCREMENT, 97 | `project` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, 98 | `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, 99 | `runner` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, 100 | `description` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, 101 | `documentation` text COLLATE utf8_unicode_ci, 102 | `url` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, 103 | `repo` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, 104 | `created_at` datetime DEFAULT NULL, 105 | `updated_at` datetime DEFAULT NULL, 106 | PRIMARY KEY (`id`), 107 | KEY `index_suites_on_project_and_name` (`project`,`name`) 108 | ) ENGINE=InnoDB AUTO_INCREMENT=50 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 109 | /*!40101 SET character_set_client = @saved_cs_client */; 110 | 111 | -- 112 | -- Table structure for table `taggings` 113 | -- 114 | 115 | DROP TABLE IF EXISTS `taggings`; 116 | /*!40101 SET @saved_cs_client = @@character_set_client */; 117 | /*!40101 SET character_set_client = utf8 */; 118 | CREATE TABLE `taggings` ( 119 | `id` int(11) NOT NULL AUTO_INCREMENT, 120 | `tag_id` int(11) DEFAULT NULL, 121 | `taggable_id` int(11) DEFAULT NULL, 122 | `taggable_type` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, 123 | `tagger_id` int(11) DEFAULT NULL, 124 | `tagger_type` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, 125 | `context` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL, 126 | `created_at` datetime DEFAULT NULL, 127 | PRIMARY KEY (`id`), 128 | UNIQUE KEY `taggings_idx` (`tag_id`,`taggable_id`,`taggable_type`,`context`,`tagger_id`,`tagger_type`), 129 | KEY `index_taggings_on_taggable_id_and_taggable_type_and_context` (`taggable_id`,`taggable_type`,`context`) 130 | ) ENGINE=InnoDB AUTO_INCREMENT=2018927 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 131 | /*!40101 SET character_set_client = @saved_cs_client */; 132 | 133 | -- 134 | -- Table structure for table `tags` 135 | -- 136 | 137 | DROP TABLE IF EXISTS `tags`; 138 | /*!40101 SET @saved_cs_client = @@character_set_client */; 139 | /*!40101 SET character_set_client = utf8 */; 140 | CREATE TABLE `tags` ( 141 | `id` int(11) NOT NULL AUTO_INCREMENT, 142 | `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, 143 | `taggings_count` int(11) DEFAULT '0', 144 | PRIMARY KEY (`id`), 145 | UNIQUE KEY `index_tags_on_name` (`name`) 146 | ) ENGINE=InnoDB AUTO_INCREMENT=196 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 147 | /*!40101 SET character_set_client = @saved_cs_client */; 148 | 149 | -- 150 | -- Table structure for table `test_definitions` 151 | -- 152 | 153 | DROP TABLE IF EXISTS `test_definitions`; 154 | /*!40101 SET @saved_cs_client = @@character_set_client */; 155 | /*!40101 SET character_set_client = utf8 */; 156 | CREATE TABLE `test_definitions` ( 157 | `id` int(11) NOT NULL AUTO_INCREMENT, 158 | `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, 159 | `node_type` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, 160 | `description` text COLLATE utf8_unicode_ci, 161 | `file` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, 162 | `line` int(11) DEFAULT NULL, 163 | `parent_id` int(11) DEFAULT NULL, 164 | `suite_id` int(11) DEFAULT NULL, 165 | `created_at` datetime DEFAULT NULL, 166 | `updated_at` datetime DEFAULT NULL, 167 | PRIMARY KEY (`id`), 168 | KEY `lookup` (`name`,`suite_id`,`file`,`parent_id`), 169 | KEY `index_test_definitions_on_suite_id` (`suite_id`) 170 | ) ENGINE=InnoDB AUTO_INCREMENT=28045 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 171 | /*!40101 SET character_set_client = @saved_cs_client */; 172 | 173 | -- 174 | -- Table structure for table `worlds` 175 | -- 176 | 177 | DROP TABLE IF EXISTS `worlds`; 178 | /*!40101 SET @saved_cs_client = @@character_set_client */; 179 | /*!40101 SET character_set_client = utf8 */; 180 | CREATE TABLE `worlds` ( 181 | `id` int(11) NOT NULL AUTO_INCREMENT, 182 | `type` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, 183 | `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, 184 | `description` text COLLATE utf8_unicode_ci, 185 | `project` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, 186 | `component` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, 187 | `version` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, 188 | `created_at` datetime DEFAULT NULL, 189 | `updated_at` datetime DEFAULT NULL, 190 | PRIMARY KEY (`id`), 191 | KEY `index_worlds_on_project_and_component` (`project`,`component`), 192 | KEY `index_worlds_on_project_and_component_and_version` (`project`,`component`,`version`) 193 | ) ENGINE=InnoDB AUTO_INCREMENT=19839 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 194 | /*!40101 SET character_set_client = @saved_cs_client */; 195 | /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; 196 | 197 | /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; 198 | /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; 199 | /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; 200 | /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; 201 | /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; 202 | /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; 203 | /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; 204 | 205 | -- Dump completed on 2018-11-29 11:21:43 206 | -------------------------------------------------------------------------------- /app/assets/stylesheets/bootstrap-2/LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | --------------------------------------------------------------------------------

<%= @reference_world.version -%>

<%= @primary_world.version -%>

27 | P 28 | F 29 | N 30 | E 31 | 37 | P 38 | F 39 | N 40 | E 41 | Diff
<%= pretty_node(c) -%> 52 | <%= link_to( pretty_truncate(h(c.test_definition.name), 80, 'strong', h(c.test_definition.file_name(:short))), "/tests/#{c.test_definition.id}?target=#{@target}") -%><%= c.reference.results.count -%> 55 | "><%= c.reference.count("pass") %> 56 | "><%= c.reference.count("fail") or 0 %> 57 | "><%= c.reference.count("notrun") %> 58 | "><%= c.reference.count("error") -%> 59 | 62 | <%= c.reference.status -%> 63 | 65 | <%= c.primary.status -%> 66 | 69 | "><%= c.primary.count("pass") %> 70 | "><%= c.primary.count("fail") or 0 %> 71 | "><%= c.primary.count("notrun") %> 72 | "><%= c.primary.count("error") -%> 73 | <%= c.primary.results.count %> 77 | <%= c.status -%> 78 |
<%= pretty_node(s) -%><%= link_to( pretty_truncate(h(s.test_definition.name), 80, 'em'), "/tests/#{s.test_definition.id}?target=#{@target}") -%><%= s.reference.results.count -%> 89 | "><%= s.reference.count("pass") %> 90 | "><%= s.reference.count("fail") or 0 %> 91 | "><%= s.reference.count("notrun") %> 92 | "><%= s.reference.count("error") -%> 93 | 95 | <%= hive_job_link(s.reference.best.run) if s.reference.best && s.reference.best.run -%> 96 | 98 | <%= s.reference.status -%> 99 | 101 | <%= s.primary.status -%> 102 | 104 | <%= hive_job_link(s.primary.best.run) if s.primary.best && s.primary.best.run -%> 105 | 107 | "><%= s.primary.count("pass") %> 108 | "><%= s.primary.count("fail") or 0 %> 109 | "><%= s.primary.count("notrun") %> 110 | "><%= s.primary.count("error") -%> 111 | <%= s.primary.results.count -%> 115 | <%= s.status -%> 116 |