kalibro_gatekeeper_client 0.1.1 → 0.2.0.alpha

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 84a0ce9402375b7ad0808157427a4289530d0692
4
- data.tar.gz: 70ab4e629016adbb2ded06b897f7be43e7fb8b2c
3
+ metadata.gz: e14a2cd4148a881cd489d40391be723fc27a9088
4
+ data.tar.gz: d97c92b89162870299c0f1bd5b431a331978187d
5
5
  SHA512:
6
- metadata.gz: eb82d09dd8b19b9de2dec1dcfc2a88026cb422e02ad9d394cfd3f9716e29bcafa6cfd3839f23eacfaf0f1c87347d0901360f9c4c3271fa9a542b612dd9e7a7ec
7
- data.tar.gz: c72ce98773cfa90616ab65466d9b3ae5cf7f7876cf01b631c2620c364d3d340dd167e98c1b3c985ece827684dc54c099d4c71ab3545c4339269c33a518957e62
6
+ metadata.gz: c41d9f19503df37bfff0020ab5ac486a3b276c2d5740e72db17508e920869df6011bfed961b3062099c0699dbba41ad3f82c41a76aa185bd4bfee7e89e71abcb
7
+ data.tar.gz: e5e18d8075e49cd8b7a4d8f97bcb672e74b41202f5bb5e8856f35658b9a080f593ebe3c6bcf73b44a5f7dd11ad4470b977ba2525999ce7d1d577f47f3a5e6301
@@ -5,4 +5,4 @@ Feature: All Names
5
5
 
6
6
  Scenario: all base tools names
7
7
  When I get all base tool names
8
- Then it should return Checkstyle and Analizo strings inside of an array
8
+ Then it should return Analizo string inside of an array
@@ -16,4 +16,5 @@ Feature: Metric results of
16
16
  And I wait up for a ready processing
17
17
  And I call the first_processing_of method for the given repository
18
18
  When I call the metric results of method with the results root id of the given processing
19
- Then I should get a list of metric results
19
+ Then I should get a list of metric results
20
+ And the first metric result should have a metric configuration snapshot
@@ -10,8 +10,8 @@ Feature: Children
10
10
  And I have a reading group with name "Group"
11
11
  And I have a metric configuration within the given configuration
12
12
  And the given project has the following Repositories:
13
- | name | type | address |
14
- | Kalibro | GIT | https://github.com/mezuro/kalibro.git |
13
+ | name | type | address |
14
+ | Kalibro | GIT | https://git.gitorious.org/sbking/sbking.git |
15
15
  And I call the process method for the given repository
16
16
  And I wait up for a ready processing
17
17
  When I ask for the children of the processing root module result
@@ -3,9 +3,17 @@ Feature: /history of
3
3
  As an developer
4
4
  I want to get the history of module results
5
5
 
6
- @wip
7
6
  @kalibro_restart
8
7
  Scenario: get the history of a module result
9
- Given I have a module result
8
+ Given I have a project with name "Kalibro"
9
+ And I have a configuration with name "Java"
10
+ And I have a reading group with name "Group"
11
+ And I have a metric configuration within the given configuration
12
+ And the given project has the following Repositories:
13
+ | name | type | address |
14
+ | Kalibro | GIT | https://git.gitorious.org/sbking/sbking.git |
15
+ And I call the process method for the given repository
16
+ And I wait up for a ready processing
17
+ And I get the module result of the processing
10
18
  When I ask for the history of the given module result
11
19
  Then I should get a list with date module results
@@ -15,4 +15,4 @@ Feature: Last processing state of
15
15
  And I call the process method for the given repository
16
16
  And I wait up to 1 seconds
17
17
  When I call the last_processing_state_of method for the given repository
18
- Then I should get "LOADING"
18
+ Then I should get "PREPARING"
@@ -15,7 +15,7 @@ Feature: Processing of
15
15
  And I call the process method for the given repository
16
16
  And I wait up to 1 seconds
17
17
  When I call the processing_of method for the given repository
18
- Then I should get a Processing with state "LOADING"
18
+ Then I should get a Processing with state "PREPARING"
19
19
 
20
20
  @kalibro_restart
21
21
  Scenario: With one repository just after with ready processing
@@ -15,8 +15,8 @@ When(/^I search base tool Avalio by name$/) do
15
15
  end
16
16
  end
17
17
 
18
- Then(/^it should return Checkstyle and Analizo strings inside of an array$/) do
19
- expect(@base_tool_names.include?("Checkstyle") && @base_tool_names.include?("Analizo")).to be_truthy
18
+ Then(/^it should return Analizo string inside of an array$/) do
19
+ expect(@base_tool_names.include?("Analizo")).to be_truthy
20
20
  end
21
21
 
22
22
  Then(/^I should get Analizo base tool$/) do
@@ -26,4 +26,8 @@ end
26
26
  Then(/^I should get a list of date metric results$/) do
27
27
  expect(@response).to be_a(Array)
28
28
  expect(@response.first).to be_a(KalibroGatekeeperClient::Entities::DateMetricResult)
29
+ end
30
+
31
+ Then(/^the first metric result should have a metric configuration snapshot$/) do
32
+ expect(@response.first.configuration).to be_a(KalibroGatekeeperClient::Entities::MetricConfigurationSnapshot)
29
33
  end
@@ -1,8 +1,3 @@
1
- Given(/^I have a module result$/) do
2
- Pending
3
- @module_result = FactoryGirl.create(:module_result)
4
- end
5
-
6
1
  When(/^I ask a module result with the same id of the given module result$/) do
7
2
  @found_module_result = KalibroGatekeeperClient::Entities::ModuleResult.find(@module_result.id)
8
3
  end
@@ -18,13 +13,26 @@ end
18
13
 
19
14
  When(/^I ask for the children of the processing root module result$/) do
20
15
  @children = KalibroGatekeeperClient::Entities::ModuleResult.
21
- find(KalibroGatekeeperClient::Entities::Processing.processing_of(@repository.id).results_root_id)
16
+ find(KalibroGatekeeperClient::Entities::Processing.processing_of(@repository.id).results_root_id).children
22
17
  end
23
18
 
24
19
  Then(/^I should get a list with the children module results$/) do
25
- expect(@children).to be_a(KalibroGatekeeperClient::Entities::ModuleResult)
20
+ expect(@children.first).to be_a(KalibroGatekeeperClient::Entities::ModuleResult)
26
21
  end
27
22
 
28
23
  Then(/^I should get the given module result$/) do
29
24
  expect(@found_module_result).to eq(@module_result)
30
- end
25
+ end
26
+
27
+ Given(/^I get the module result of the processing$/) do
28
+ @module_result = KalibroGatekeeperClient::Entities::ModuleResult.
29
+ find(KalibroGatekeeperClient::Entities::Processing.processing_of(@repository.id).results_root_id)
30
+ end
31
+
32
+ When(/^I ask for the history of the given module result$/) do
33
+ @history = KalibroGatekeeperClient::Entities::ModuleResult.history_of(@module_result.id)
34
+ end
35
+
36
+ Then(/^I should get a list with date module results$/) do
37
+ expect(@history).to be_a(Array)
38
+ end
@@ -39,7 +39,14 @@ module KalibroGatekeeperClient
39
39
  end
40
40
 
41
41
  def self.request(action, params = {}, method = :post)
42
- client.send(method, "/#{endpoint}/#{action}", params).body
42
+ response = client.send(method) do |request|
43
+ request.url "/#{endpoint}/#{action}"
44
+ request.body = params
45
+ request.options.timeout = 300
46
+ request.options.open_timeout = 300
47
+ end
48
+
49
+ response.body
43
50
  end
44
51
 
45
52
  def self.to_object value
@@ -55,7 +62,7 @@ module KalibroGatekeeperClient
55
62
  begin
56
63
  response = self.class.request(save_action, save_params)
57
64
  self.id = response["id"]
58
- self.kalibro_errors = response["kalibro_errors"]
65
+ self.kalibro_errors = response["kalibro_errors"] unless response["kalibro_errors"].nil?
59
66
 
60
67
  self.kalibro_errors.empty? ? true : false
61
68
  rescue Exception => exception
@@ -19,18 +19,20 @@ module KalibroGatekeeperClient
19
19
  class Configuration
20
20
  attr_accessor :database, :user, :password,
21
21
  :query_file_path, :psql_file_path, :kalibro_home,
22
- :tomcat_user, :tomcat_group, :tomcat_restart_command
22
+ :tomcat_user, :tomcat_group, :tomcat_restart_command,
23
+ :kalibro_processor_address
23
24
 
24
25
  def initialize(attributes={})
25
- self.database = "kalibro_test"
26
- self.user = "kalibro"
27
- self.password = "kalibro"
28
- self.psql_file_path = "/tmp/PostgreSQL.sql"
29
- self.query_file_path = "/tmp/query"
30
- self.kalibro_home = "/usr/share/tomcat6/.kalibro"
31
- self.tomcat_user = "tomcat6"
32
- self.tomcat_group = "tomcat6"
33
- self.tomcat_restart_command = "sudo\\ service\\ tomcat6\\ restart"
26
+ self.database = "kalibro_test"
27
+ self.user = "kalibro"
28
+ self.password = "kalibro"
29
+ self.psql_file_path = "/tmp/PostgreSQL.sql"
30
+ self.query_file_path = "/tmp/query"
31
+ self.kalibro_home = "/usr/share/tomcat6/.kalibro"
32
+ self.tomcat_user = "tomcat6"
33
+ self.tomcat_group = "tomcat6"
34
+ self.tomcat_restart_command = "sudo\\ service\\ tomcat6\\ restart"
35
+ self.kalibro_processor_address = "http://localhost:8082"
34
36
 
35
37
  attributes.each { |field, value| send("#{field}=", value) if respond_to?("#{field}=") }
36
38
  end
@@ -46,6 +46,7 @@ After ('@kalibro_restart') do
46
46
  #{KalibroGatekeeperClient::KalibroCucumberHelpers.configuration.database} \\
47
47
  #{KalibroGatekeeperClient::KalibroCucumberHelpers.configuration.query_file_path}"
48
48
  system command
49
+ KalibroGatekeeperClient::KalibroCucumberHelpers.clean_processor
49
50
  end
50
51
 
51
52
  at_exit do
@@ -5,7 +5,7 @@
5
5
  # it under the terms of the GNU General Public License as published by
6
6
  # the Free Software Foundation, either version 3 of the License, or
7
7
  # (at your option) any later version.
8
- #
8
+ #
9
9
  # This program is distributed in the hope that it will be useful,
10
10
  # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
11
  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@@ -36,5 +36,15 @@ module KalibroGatekeeperClient
36
36
  def KalibroCucumberHelpers.configuration
37
37
  @configuration
38
38
  end
39
+
40
+ def KalibroCucumberHelpers.clean_processor
41
+ client = Faraday.new(:url => @configuration.kalibro_processor_address) do |conn|
42
+ conn.request :json
43
+ conn.response :json, :content_type => /\bjson$/
44
+ conn.adapter Faraday.default_adapter # make requests with Net::HTTP
45
+ end
46
+
47
+ client.send(:post, "/tests/clean_database", {})
48
+ end
39
49
  end
40
50
  end
@@ -15,5 +15,5 @@
15
15
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
16
16
 
17
17
  module KalibroGatekeeperClient
18
- VERSION = "0.1.1"
18
+ VERSION = "0.2.0.alpha"
19
19
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kalibro_gatekeeper_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0.alpha
5
5
  platform: ruby
6
6
  authors:
7
7
  - Diego Araújo Martinez
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2014-07-04 00:00:00.000000000 Z
14
+ date: 2014-07-31 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: bundler
@@ -344,9 +344,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
344
344
  version: '0'
345
345
  required_rubygems_version: !ruby/object:Gem::Requirement
346
346
  requirements:
347
- - - ">="
347
+ - - ">"
348
348
  - !ruby/object:Gem::Version
349
- version: '0'
349
+ version: 1.3.1
350
350
  requirements: []
351
351
  rubyforge_project:
352
352
  rubygems_version: 2.2.2