Skip to content
This repository
Browse code

add annotator

  • Loading branch information...
commit bef9de4662836f9b5fae3beb24e733bdcb9888e0 1 parent ea217b9
Kacper Cieśla comboy authored
3  Gemfile
@@ -2,6 +2,9 @@ source 'http://rubygems.org'
2 2
3 3 gem 'rails', '3.0.11'
4 4
  5 +# models annotations
  6 +gem 'annotator'
  7 +
5 8 # live web notifications in rails
6 9 gem 'juggernaut'
7 10
3  Gemfile.lock
@@ -29,6 +29,8 @@ GEM
29 29 activemodel (= 3.0.11)
30 30 activesupport (= 3.0.11)
31 31 activesupport (3.0.11)
  32 + annotator (0.0.2)
  33 + rails (~> 3.0)
32 34 arel (2.0.10)
33 35 builder (2.1.2)
34 36 crack (0.1.8)
@@ -93,6 +95,7 @@ PLATFORMS
93 95
94 96 DEPENDENCIES
95 97 ZenTest
  98 + annotator
96 99 factory_girl_rails
97 100 git
98 101 gravtastic
6 app/models/author.rb
... ... @@ -1,3 +1,9 @@
  1 +# Attributes:
  2 +# * id [integer, primary, not null] - primary key
  3 +# * created_at [datetime] - creation time
  4 +# * email [string]:w
  5 +# * name [string]
  6 +# * updated_at [datetime] - last update time
1 7 class Author < ActiveRecord::Base
2 8
3 9 has_many :commits
13 app/models/commit.rb
... ... @@ -1,3 +1,16 @@
  1 +# Attributes:
  2 +# * id [integer, primary, not null] - primary key
  3 +# * author_id [integer] - belongs_to Author
  4 +# * committed_at [datetime] - when commit was created in repo
  5 +# * created_at [datetime] - creation time (in our database)
  6 +# * description [text] - description provided inside commit
  7 +# * dev_structure [text] - keeps database structure FIXME: reorganize, make it some data_yaml or whatever
  8 +# * number [string] - commit number as in VCS (e.g. sha hash in git)
  9 +# * parent_id [integer] - belongs_to parent Commit
  10 +# * preparation_log [text] - FIXME: remove me, it's present in ProjectInstanceCommit
  11 +# * project_id [integer] - belongs_to Project
  12 +# * skipped [boolean] - commit can be marked as skipped if we don't want moci to run it
  13 +# * updated_at [datetime] - last update time
1 14 class Commit < ActiveRecord::Base
2 15 #TODO? maybe: commiter? multiple parents?
3 16 #
7 app/models/notification.rb
... ... @@ -1,3 +1,10 @@
  1 +# Attributes:
  2 +# * id [integer, primary, not null] - primary key
  3 +# * created_at [datetime] - creation time
  4 +# * name [string]
  5 +# * notification_options [text] - serialized options specific to given handler
  6 +# * notification_type [string] - class name of the handler (Moci::Notificator::..)
  7 +# * updated_at [datetime] - last update time
1 8 class Notification < ActiveRecord::Base
2 9 has_and_belongs_to_many :projects
3 10
7 app/models/project.rb
... ... @@ -1,3 +1,10 @@
  1 +# Attributes:
  2 +# * id [integer, primary, not null] - primary key
  3 +# * created_at [datetime] - creation time
  4 +# * name [string]
  5 +# * project_type [string, default=Base] - same as class name that will be used as project handler (Moci::ProjectHandler::..)
  6 +# * updated_at [datetime] - last update time
  7 +# * vcs_branch_name [string]
1 8 class Project < ActiveRecord::Base
2 9 validates_presence_of :name
3 10
8 app/models/project_instance.rb
... ... @@ -1,3 +1,11 @@
  1 +# Attributes:
  2 +# * id [integer, primary, not null] - primary key
  3 +# * created_at [datetime] - creation time
  4 +# * locked_by [string] - string handle of whoever locked the instance #TODO: add locked_at and timeouts
  5 +# * project_id [integer] - belongs_to Project
  6 +# * state [string, default=new] - TODO: document me
  7 +# * updated_at [datetime] - last update time
  8 +# * working_directory [string] - directory of the project we run tests on
1 9 class ProjectInstance < ActiveRecord::Base
2 10 belongs_to :project
3 11
9 app/models/project_instance_commit.rb
... ... @@ -1,3 +1,12 @@
  1 +# Attributes:
  2 +# * id [integer, primary, not null] - primary key
  3 +# * commit_id [integer] - belongs_to Commit
  4 +# * created_at [datetime] - creation time
  5 +# * data_yaml [text] - serialized data associated with commit
  6 +# * preparation_log [text] - commaound output of first time commit preparation (use data maybe?)
  7 +# * project_instance_id [integer] - belongs_to ProjectInstance
  8 +# * state [string, default=new] - current state, 'new' -> ( 'prepared' | 'preparation_failed' )
  9 +# * updated_at [datetime] - last update time
1 10 class ProjectInstanceCommit < ActiveRecord::Base
2 11
3 12 belongs_to :commit
8 app/models/test_suite.rb
... ... @@ -1,3 +1,11 @@
  1 +# Attributes:
  2 +# * id [integer, primary, not null] - primary key
  3 +# * created_at [datetime] - creation time
  4 +# * name [string]
  5 +# * project_id [integer] - belongs_to Project
  6 +# * suite_options [text] - test suite specific options to be passed to test runner (e.g' which files to include/exclude)
  7 +# * suite_type [string] - test suite type, name same as test runner class name (inside Moci::TestRunner)
  8 +# * updated_at [datetime] - last update time
1 9 require 'moci/test_runner/spec' #FIXME this should not be necessary here
2 10
3 11 class TestSuite < ActiveRecord::Base
14 app/models/test_suite_run.rb
... ... @@ -1,3 +1,17 @@
  1 +# Attributes:
  2 +# * id [integer, primary, not null] - primary key
  3 +# * assertions_count [integer] - number of assertions made
  4 +# * commit_id [integer] - belongs_to Commit (TODO: shouldn't that be project_instance_commit?)
  5 +# * created_at [datetime] - creation time
  6 +# * errors_count [integer] - number of errors that occurred during test suite run
  7 +# * failures_count [integer] - number of failures that occured during test suite run
  8 +# * project_instance_id [integer] - belongs_to ProjectInstance
  9 +# * run_log [text] - command output of test suite run
  10 +# * run_time [float] - total test suite execution time
  11 +# * state [string] - currently only 2 states: running -> finished
  12 +# * test_suite_id [integer] - belongs_to TestSuite
  13 +# * tests_count [integer] - number of tests in the test suite
  14 +# * updated_at [datetime] - last update time
1 15 class TestSuiteRun < ActiveRecord::Base
2 16 belongs_to :commit
3 17 belongs_to :project_instance
7 app/models/test_unit.rb
... ... @@ -1,3 +1,10 @@
  1 +# Attributes:
  2 +# * id [integer, primary, not null] - primary key
  3 +# * class_name [string] - name of group of tests
  4 +# * created_at [datetime] - creation time
  5 +# * name [text]
  6 +# * test_suite_id [integer] - belongs_to TestSuite
  7 +# * updated_at [datetime] - last update time
1 8 class TestUnit < ActiveRecord::Base
2 9 belongs_to :test_suite
3 10 end
7 app/models/test_unit_run.rb
... ... @@ -1,3 +1,10 @@
  1 +# Attributes:
  2 +# * id [integer, primary, not null] - primary key
  3 +# * created_at [datetime] - creation time
  4 +# * result [string] - '.' - OK, 'E' - error, 'F' - failure, 'U' - undefined
  5 +# * run_time [float] - time taken to run this test
  6 +# * test_suite_run_id [integer] - belongs_to TestSuiteRun
  7 +# * test_unit_id [integer] - belongs_to TestUnit
1 8 class TestUnitRun < ActiveRecord::Base
2 9 belongs_to :test_unit
3 10 belongs_to :test_suite_run
9 app/views/projects/show.html.haml
@@ -39,7 +39,7 @@
39 39 .about
40 40 %h3 About project
41 41
42   - %table{:class => 'keyvalue nostyle', :style => 'width: 100%; float: right;'}
  42 + %table{:class => 'keyvalue nostyle', :style => 'width: 100%;'}
43 43 %tr
44 44 %td.key Monitored since
45 45 %td.value= @project.created_at
@@ -48,3 +48,10 @@
48 48 %td.value= @project.commits.count
49 49
50 50
  51 + %h3 Currently runnning
  52 +
  53 + %table
  54 + - @project.test_suite_runs.order('updated_at DESC').limit(5).all.each do |tr|
  55 + %tr
  56 + %td= tr.updated_at
  57 + %td= tr.state

0 comments on commit bef9de4

Please sign in to comment.
Something went wrong with that request. Please try again.