Commit a8f3a260fc5d68da412212e43f3e37d45b9b96fe

Authored by Rafael Manzo
1 parent 2e481354

Updated KalibroGatekeeperClient (Using KalibroProcessor)

.gitignore
... ... @@ -20,6 +20,7 @@ coverage
20 20 database.yml
21 21 database.yml~
22 22 kalibro.yml
  23 +kalibro_processor.yml
23 24 kalibro_cucumber_helpers.yml
24 25 KalibroService.tar.gz
25 26 KalibroService/
... ...
.travis.yml
... ... @@ -4,6 +4,7 @@ rvm:
4 4  
5 5 before_script:
6 6 - "cp config/database.yml.sample config/database.yml"
  7 + - "cp config/kalibro_processor.yml.sample config/kalibro_processor.yml"
7 8 - "bundle exec rake db:migrate RAILS_ENV=test"
8 9 - git clone https://gist.github.com/0c4ad3b5700c6364abf1.git -b v1.0 kalibro_install
9 10 - pushd kalibro_install
... ... @@ -12,13 +13,28 @@ before_script:
12 13 - bash install.sh
13 14 - popd
14 15 - cp features/support/kalibro_cucumber_helpers.yml.sample features/support/kalibro_cucumber_helpers.yml
15   - - git clone https://github.com/mezuro/kalibro_gatekeeper.git -b v0.0.1 kalibro_gatekeeper
16   - - pushd kalibro_gatekeeper
  16 + # Gatekeeper
  17 + - git clone https://github.com/mezuro/kalibro_gatekeeper.git -b v0.1.1 kalibro_gatekeeper
  18 + - cd kalibro_gatekeeper
17 19 - cp config/database.yml.sample config/database.yml
  20 + - cp config/kalibro_processor.yml.sample config/kalibro_processor.yml
18 21 - export BUNDLE_GEMFILE=$PWD/Gemfile
19 22 - bundle install
20   - - bundle exec rails s -p 8081 -d
21   - - popd
  23 + - RAILS_ENV=local bundle exec rails s -p 8081 -d
  24 + - cd ..
  25 + - export BUNDLE_GEMFILE=$PWD/Gemfile
  26 + # Processor
  27 + - git clone https://github.com/mezuro/kalibro_processor.git -b v0.0.2 kalibro_processor
  28 + - cd kalibro_processor
  29 + - psql -c "create role kalibro_processor with createdb login password 'kalibro_processor'" -U postgres
  30 + - cp config/database.yml.postgresql_sample config/database.yml
  31 + - cp config/repositories.yml.sample config/repositories.yml
  32 + - export BUNDLE_GEMFILE=$PWD/Gemfile
  33 + - bundle install
  34 + - bundle exec rake db:setup db:migrate
  35 + - bundle exec rails s -p 8082 -d
  36 + - bundle exec bin/delayed_job start
  37 + - cd ..
22 38 - export BUNDLE_GEMFILE=$PWD/Gemfile
23 39  
24 40 script:
... ...
Gemfile
... ... @@ -31,7 +31,7 @@ gem 'jbuilder', '~> 2.1.2'
31 31 gem 'devise', '~> 3.2.4'
32 32  
33 33 # Kalibro integration
34   -gem 'kalibro_gatekeeper_client', "~> 0.1.0"
  34 +gem 'kalibro_gatekeeper_client', "~> 0.2.1"
35 35  
36 36 # PostgreSQL integration
37 37 gem "pg", "~> 0.17.0"
... ...
Gemfile.lock
... ... @@ -130,7 +130,7 @@ GEM
130 130 jquery-ui-rails (4.2.1)
131 131 railties (>= 3.2.16)
132 132 json (1.8.1)
133   - kalibro_gatekeeper_client (0.1.1)
  133 + kalibro_gatekeeper_client (0.2.1)
134 134 activesupport (>= 2.2.1)
135 135 faraday_middleware (~> 0.9.0)
136 136 konacha (3.2.3)
... ... @@ -284,7 +284,7 @@ DEPENDENCIES
284 284 jbuilder (~> 2.1.2)
285 285 jquery-rails
286 286 jquery-ui-rails (~> 4.2.1)
287   - kalibro_gatekeeper_client (~> 0.1.0)
  287 + kalibro_gatekeeper_client (~> 0.2.1)
288 288 konacha (~> 3.2.0)
289 289 mocha
290 290 pg (~> 0.17.0)
... ...
config/deploy.rb
... ... @@ -48,6 +48,7 @@ namespace :deploy do
48 48 on roles(:web) do
49 49 execute "ln -s #{File.join(deploy_to, 'shared', 'config/database.yml')} #{File.join(release_path, 'config/database.yml')}"
50 50 execute "ln -s #{File.join(deploy_to, 'shared', 'config/kalibro_gatekeeper.yml')} #{File.join(release_path, 'config/kalibro_gatekeeper.yml')}"
  51 + execute "ln -s #{File.join(deploy_to, 'shared', 'config/kalibro_processor.yml')} #{File.join(release_path, 'config/kalibro_processor.yml')}"
51 52 end
52 53 end
53 54  
... ...
config/kalibro_processor.yml.sample 0 → 100644
... ... @@ -0,0 +1 @@
  1 +address: http://localhost:8082
0 2 \ No newline at end of file
... ...
features/metric_configuration/create.feature
... ... @@ -40,9 +40,3 @@ Feature: Metric Configuration Creation
40 40 And I click the Total Lines of Code link
41 41 When I click the Back link
42 42 Then I should be at the choose metric page
43   - # Checks for error loading metrics with '' characters
44   - When I click the "Checkstyle" h3
45   - And I click the Average 'if' Depth link
46   - And I wait for "1" seconds
47   - Then I should see "Average nested depth of all 'if-else' blocks. Default maximum: 1."
48   -
... ...
features/project/create.feature
... ... @@ -3,12 +3,11 @@ Feature: Project Creation
3 3 As a regular user
4 4 I should be able to create projects
5 5  
6   - @kalibro_restart
7 6 Scenario: Should not create project without login
8 7 Given I am at the All Projects page
9 8 Then I should not see New Project
10 9  
11   - @kalibro_restart
  10 + @kalibro_processor_restart
12 11 Scenario: project creation
13 12 Given I am a regular user
14 13 And I am signed in
... ... @@ -19,7 +18,7 @@ Feature: Project Creation
19 18 Then I should see "Kalibro"
20 19 And I should see "Web Service to collect metrics"
21 20  
22   - @kalibro_restart
  21 + @kalibro_processor_restart
23 22 Scenario: project creation with already taken name
24 23 Given I am a regular user
25 24 And I am signed in
... ... @@ -30,7 +29,6 @@ Feature: Project Creation
30 29 When I press the Save button
31 30 Then I should see "There's already"
32 31  
33   - @kalibro_restart
34 32 Scenario: project creation with blank name
35 33 Given I am a regular user
36 34 And I am signed in
... ...
features/project/deletion.feature
... ... @@ -3,13 +3,13 @@ Feature: Project Deletion
3 3 As a regular user
4 4 The system should have an interface to it
5 5  
6   - @kalibro_restart
  6 + @kalibro_processor_restart
7 7 Scenario: Should not delete a project without user authetication
8 8 Given I have a sample project
9 9 When I am at the Sample Project page
10 10 Then I should not see Destroy
11 11  
12   - @kalibro_restart
  12 + @kalibro_processor_restart
13 13 Scenario: Should not delete a project that doesn't belongs to user
14 14 Given I am a regular user
15 15 And I am signed in
... ... @@ -17,7 +17,7 @@ Feature: Project Deletion
17 17 When I am at the Sample Project page
18 18 Then I should not see Destroy
19 19  
20   - @kalibro_restart
  20 + @kalibro_processor_restart
21 21 Scenario: Should delete a project that I own
22 22 Given I am a regular user
23 23 And I am signed in
... ...
features/project/edition.feature
... ... @@ -3,7 +3,7 @@ Feature: Project
3 3 As a regular user
4 4 I should be able to edit my projects
5 5  
6   - @kalibro_restarts
  6 + @kalibro_processor_restart
7 7 Scenario: Should go to the edit page from a project that I own
8 8 Given I am a regular user
9 9 And I am signed in
... ... @@ -12,7 +12,7 @@ Feature: Project
12 12 When I click the Edit link
13 13 Then I should be in the Edit Project page
14 14  
15   - @kalibro_restart
  15 + @kalibro_processor_restart
16 16 Scenario: Should not show edit links from projects that doesn't belongs to me
17 17 Given I am a regular user
18 18 And I am signed in
... ... @@ -20,7 +20,7 @@ Feature: Project
20 20 And I am at the All Projects page
21 21 Then I should not see "Edit" within "table tr td"
22 22  
23   - @kalibro_restart
  23 + @kalibro_processor_restart
24 24 Scenario: Should not render the edit page if the project doesn't belongs to the current user
25 25 Given I am a regular user
26 26 And I am signed in
... ... @@ -29,7 +29,7 @@ Feature: Project
29 29 When I visit the sample project edit page
30 30 Then I should see "You're not allowed to do this operation"
31 31  
32   - @kalibro_restart
  32 + @kalibro_processor_restart
33 33 Scenario: Filling up the form
34 34 Given I am a regular user
35 35 And I am signed in
... ... @@ -39,7 +39,7 @@ Feature: Project
39 39 Then The field "project[name]" should be filled with the sample project "name"
40 40 And The field "project[description]" should be filled with the sample project "description"
41 41  
42   - @kalibro_restart
  42 + @kalibro_processor_restart
43 43 Scenario: With valid attributes
44 44 Given I am a regular user
45 45 And I am signed in
... ... @@ -51,7 +51,7 @@ Feature: Project
51 51 Then I should see "Kalibro"
52 52 And I should see "Web Service to collect metrics"
53 53  
54   - @kalibro_restart
  54 + @kalibro_processor_restart
55 55 Scenario: With project name already taken
56 56 Given I am a regular user
57 57 And I am signed in
... ... @@ -62,7 +62,7 @@ Feature: Project
62 62 When I press the Save button
63 63 Then I should see "There's already"
64 64  
65   - @kalibro_restart
  65 + @kalibro_processor_restart
66 66 Scenario: Editing just the description
67 67 Given I am a regular user
68 68 And I am signed in
... ... @@ -72,7 +72,7 @@ Feature: Project
72 72 When I press the Save button
73 73 And I should see "Web Service to collect metrics"
74 74  
75   - @kalibro_restart
  75 + @kalibro_processor_restart
76 76 Scenario: With blank project name
77 77 Given I am a regular user
78 78 And I am signed in
... ...
features/project/listing.feature
... ... @@ -3,7 +3,7 @@ Feature: Project listing
3 3 As a regular user
4 4 I should have various listings
5 5  
6   - Scenario: Listing projects
  6 + Scenario: Listing projects
7 7 Given I am at the homepage
8 8 When I click the Project link
9 9 Then I should see "Projects"
... ... @@ -11,7 +11,7 @@ Feature: Project listing
11 11 And I should see "Description"
12 12 And I should see "To create new projects you must be logged in page."
13 13  
14   - @kalibro_restart
  14 + @kalibro_processor_restart
15 15 Scenario: Should list the existing projects
16 16 Given I am a regular user
17 17 And I am signed in
... ... @@ -20,7 +20,7 @@ Feature: Project listing
20 20 Then the sample project should be there
21 21 And I should not see "To create new projects you must be logged in page."
22 22  
23   - @kalibro_restart
  23 + @kalibro_processor_restart
24 24 Scenario: Should show the existing project
25 25 Given I am a regular user
26 26 And I am signed in
... ...
features/project/show.feature
... ... @@ -3,7 +3,7 @@ Feature: Show Project
3 3 As a regular user
4 4 I should be able to see each of them
5 5  
6   -@kalibro_restart
  6 +@kalibro_restart @kalibro_processor_restart
7 7 Scenario: Should not show the create repository link to user that doesn't own the project
8 8 Given I am a regular user
9 9 And I have a sample project
... ... @@ -14,7 +14,7 @@ Scenario: Should not show the create repository link to user that doesn't own th
14 14 And I should not see Destroy project
15 15 And I should not see Edit
16 16  
17   -@kalibro_restart
  17 +@kalibro_processor_restart
18 18 Scenario: Should show the create repository link the project owner
19 19 Given I am a regular user
20 20 And I am signed in
... ... @@ -23,13 +23,13 @@ Scenario: Should show the create repository link the project owner
23 23 Then I should see "New Repository"
24 24  
25 25  
26   -@kalibro_restart
  26 +@kalibro_processor_restart
27 27 Scenario: Considering the project has no repositories
28 28 Given I have a sample project
29 29 When I am at the Sample Project page
30 30 Then I should see "There are no repositories yet!"
31 31  
32   -@kalibro_restart
  32 +@kalibro_restart @kalibro_processor_restart
33 33 Scenario: Considering the project has repositories
34 34 Given I have a sample project
35 35 And I have a sample configuration with native metrics
... ... @@ -37,7 +37,7 @@ Scenario: Considering the project has repositories
37 37 When I am at the Sample Project page
38 38 Then I should not see There are no repositories yet!
39 39  
40   -@kalibro_restart
  40 +@kalibro_processor_restart
41 41 Scenario: Checking project contents
42 42 Given I have a sample project
43 43 When I am at the Sample Project page
... ...
features/repository/create.feature
... ... @@ -3,7 +3,7 @@ Feature: Repository Creation
3 3 As a regular user
4 4 I should be able to create repositories
5 5  
6   -@kalibro_restart @javascript
  6 +@kalibro_restart @kalibro_processor_restart @javascript
7 7 Scenario: repository creation
8 8 Given I am a regular user
9 9 And I am signed in
... ... @@ -20,7 +20,7 @@ Scenario: repository creation
20 20 When I press the Save button
21 21 Then I should see the saved repository's content
22 22  
23   -@kalibro_restart @javascript
  23 +@kalibro_restart @kalibro_processor_restart @javascript
24 24 Scenario: repository creation blank validations
25 25 Given I am a regular user
26 26 And I am signed in
... ... @@ -35,7 +35,7 @@ Scenario: repository creation blank validations
35 35 Then I should see "Name can't be blank"
36 36 And I should see "Address can't be blank"
37 37  
38   -@kalibro_restart @javascript
  38 +@kalibro_restart @kalibro_processor_restart @javascript
39 39 Scenario: repository creation with name already taken
40 40 Given I am a regular user
41 41 And I am signed in
... ...
features/repository/delete.feature
... ... @@ -3,7 +3,7 @@ Feature: Project Deletion
3 3 As a regular user
4 4 The system should have an interface to it
5 5  
6   - @kalibro_restart
  6 + @kalibro_restart @kalibro_processor_restart
7 7 Scenario: Should delete a project that I own
8 8 Given I am a regular user
9 9 And I am signed in
... ...
features/repository/edit.feature
... ... @@ -3,7 +3,7 @@ Feature: Repository Edit
3 3 As a regular user
4 4 I should be able to edit my repositories
5 5  
6   - @kalibro_restart
  6 + @kalibro_restart @kalibro_processor_restart
7 7 Scenario: editing a repository successfully
8 8 Given I am a regular user
9 9 And I am signed in
... ... @@ -25,7 +25,7 @@ Feature: Repository Edit
25 25 And I should see "Weekly"
26 26 And I should see "EU DataGrid Software License (EUDatagrid)"
27 27  
28   - @kalibro_restart
  28 + @kalibro_restart @kalibro_processor_restart
29 29 Scenario: editing a repository with blank fields
30 30 Given I am a regular user
31 31 And I am signed in
... ... @@ -39,7 +39,7 @@ Feature: Repository Edit
39 39 Then I should see "Name can't be blank"
40 40 And I should see "Address can't be blank"
41 41  
42   - @kalibro_restart
  42 + @kalibro_restart @kalibro_processor_restart
43 43 Scenario: editing a repository with already taken name
44 44 Given I am a regular user
45 45 And I am signed in
... ...
features/repository/show/date_select.feature
... ... @@ -3,7 +3,7 @@ Feature: Date Select
3 3 As a regular user
4 4 I should be able to select a specific date
5 5  
6   - @kalibro_restart @javascript
  6 + @kalibro_restart @kalibro_processor_restart @javascript
7 7 Scenario: With a specific date selected
8 8 Given I have a sample project
9 9 And I have a sample configuration with native metrics
... ...
features/repository/show/metric_results.feature
... ... @@ -3,7 +3,7 @@ Feature: Repository metric results
3 3 As a regular user
4 4 I should see the metric results table with its graphics
5 5  
6   - @kalibro_restart @javascript
  6 + @kalibro_restart @kalibro_processor_restart @javascript
7 7 Scenario: Should show the message when the graphic of the given metric have only a single point
8 8 Given I am a regular user
9 9 And I am signed in
... ...
features/repository/show/modules_tree.feature
... ... @@ -3,7 +3,7 @@ Feature: Repository modules tree
3 3 As a regular user
4 4 I should see the tree and be able to navigate over it
5 5  
6   - @kalibro_restart @javascript
  6 + @kalibro_restart @kalibro_processor_restart @javascript
7 7 Scenario: Should show modules directories root when the process has been finished
8 8 Given I am a regular user
9 9 And I am signed in
... ... @@ -17,7 +17,7 @@ Feature: Repository modules tree
17 17 When I visit the repository show page
18 18 Then I should see the given module result
19 19  
20   - @kalibro_restart @javascript
  20 + @kalibro_restart @kalibro_processor_restart @javascript
21 21 Scenario: Should show children of root when the process has been finished
22 22 Given I am a regular user
23 23 And I am signed in
... ... @@ -36,7 +36,7 @@ Feature: Repository modules tree
36 36 And I should see "Granularity"
37 37 And I should see "Grade"
38 38  
39   - @kalibro_restart @javascript
  39 + @kalibro_restart @kalibro_processor_restart @javascript
40 40 Scenario: Module navigation
41 41 Given I am a regular user
42 42 And I am signed in
... ...
features/repository/show/repository_info.feature
... ... @@ -3,7 +3,7 @@ Feature: Show Repository
3 3 As a regular user
4 4 I should see it's informations
5 5  
6   - @kalibro_restart @javascript
  6 + @kalibro_restart @kalibro_processor_restart @javascript
7 7 Scenario: Testing the repository values
8 8 Given I have a sample project
9 9 And I have a sample configuration with native metrics
... ... @@ -19,7 +19,7 @@ Feature: Show Repository
19 19 And I should see "License"
20 20 And I should see the given repository's content
21 21  
22   - @kalibro_restart @javascript
  22 + @kalibro_restart @kalibro_processor_restart @javascript
23 23 Scenario: With a ready processing and asking to reprocess
24 24 Given I am a regular user
25 25 And I am signed in
... ... @@ -32,9 +32,12 @@ Feature: Show Repository
32 32 Then I should see the sample repository name
33 33 And I should see "State"
34 34 And I should see "Creation date"
35   - And I should see "LOADING time"
  35 + And I should see "PREPARING time"
36 36 And I should see "COLLECTING time"
37   - And I should see "ANALYZING time"
  37 + And I should see "BUILDING time"
  38 + And I should see "AGGREGATING time"
  39 + And I should see "CALCULATING time"
  40 + And I should see "INTERPRETATING time"
38 41 When I click the "Metric Results" h3
39 42 And I click the "Modules Tree" h3
40 43 Then I should see "Metric"
... ... @@ -45,9 +48,9 @@ Feature: Show Repository
45 48 And I should see "Granularity"
46 49 And I should see "Grade"
47 50 When I click the Reprocess link
48   - Then I should see "LOADING"
  51 + Then I should see "PREPARING"
49 52  
50   - @kalibro_restart @javascript
  53 + @kalibro_restart @kalibro_processor_restart @javascript
51 54 Scenario: Just after start to process
52 55 Given I am a regular user
53 56 And I am signed in
... ... @@ -57,7 +60,7 @@ Feature: Show Repository
57 60 And I start to process that repository
58 61 When I visit the repository show page
59 62 Then I should see the sample repository name
60   - And I should see "LOADING"
  63 + And I should see "PREPARING"
61 64 And I should see "Address"
62 65 And I should see "Configuration"
63 66 And I should see "State"
... ... @@ -67,5 +70,5 @@ Feature: Show Repository
67 70 When I click the "Modules Tree" h3
68 71 Then I should see "Loading data. Please, wait."
69 72 And I wait for "75" seconds or until I see "COLLECTING"
70   - And I wait for "60" seconds or until I see "ANALYZING"
  73 + And I wait for "60" seconds or until I see "AGGREGATING"
71 74 And I wait for "400" seconds or until I see "READY"
... ...
features/step_definitions/repository_steps.rb
... ... @@ -6,7 +6,8 @@ Given(/^I have a sample configuration with native metrics$/) do
6 6 {id: nil,
7 7 metric: FactoryGirl.build(:loc),
8 8 reading_group_id: reading_group.id,
9   - configuration_id: @configuration.id})
  9 + configuration_id: @configuration.id,
  10 + code: 'loc'})
10 11 range = FactoryGirl.build(:mezuro_range, {id: nil, reading_id: reading.id, beginning: '-INF', :end => 'INF', metric_configuration_id: metric_configuration.id})
11 12 range.save
12 13 end
... ...
features/users/user_projects.feature
... ... @@ -3,7 +3,7 @@ Feature: User projects list
3 3 As a regular user
4 4 I want to have a page with a list of my projects
5 5  
6   - @kalibro_restart
  6 + @kalibro_processor_restart
7 7 Scenario: with current password
8 8 Given I am a regular user
9 9 And I own a sample project
... ...