limited_red 0.3.1 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,7 +2,11 @@ module LimitedRed
|
|
2
2
|
module Adapter
|
3
3
|
class HttParty
|
4
4
|
def self.new(config, options = {})
|
5
|
-
|
5
|
+
services = {}
|
6
|
+
services[:rspec] = 'https://limited-red-unit-data-service.heroku.com/'
|
7
|
+
services[:cucumber] = 'https://limited-red-data-service.heroku.com/'
|
8
|
+
|
9
|
+
host = config['host'] || services[config[type]]
|
6
10
|
port = config['port'] || ''
|
7
11
|
uri = "#{host}#{port == '' ? '' : ":#{port}"}"
|
8
12
|
|
data/lib/limited_red/config.rb
CHANGED
@@ -5,14 +5,14 @@ module LimitedRed
|
|
5
5
|
@out = out_stream
|
6
6
|
end
|
7
7
|
|
8
|
-
def self.load_and_validate_config
|
9
|
-
new.load_and_validate_config
|
8
|
+
def self.load_and_validate_config(type)
|
9
|
+
new.load_and_validate_config(type)
|
10
10
|
end
|
11
11
|
|
12
|
-
def load_and_validate_config
|
12
|
+
def load_and_validate_config(type)
|
13
13
|
ensure_config_exists
|
14
14
|
if valid_config?
|
15
|
-
config
|
15
|
+
config.merge({:type => type})
|
16
16
|
else
|
17
17
|
errors = "Make sure you have the following set in your .limited_red:\n"
|
18
18
|
errors += " * project name\n" unless config['project name']
|
@@ -11,7 +11,7 @@ module LimitedRed
|
|
11
11
|
@t = Time.now
|
12
12
|
@build_id = Time.now.to_i
|
13
13
|
@step_mother = step_mother
|
14
|
-
@client = LimitedRed::Client.new(LimitedRed::Config.load_and_validate_config)
|
14
|
+
@client = LimitedRed::Client.new(LimitedRed::Config.load_and_validate_config(:cucumber))
|
15
15
|
|
16
16
|
super
|
17
17
|
end
|
@@ -21,7 +21,7 @@ module LimitedRed
|
|
21
21
|
json = feature_hash.to_json
|
22
22
|
@client.log_result(@build_id, :result => json)
|
23
23
|
else
|
24
|
-
puts "Error: Gherkin version
|
24
|
+
puts "[limited_red]:Error: Having trouble working with your Gherkin version. Is it upto date? Report this to joe@josephwilk.net, its his fault.", ""
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
@@ -49,7 +49,7 @@ module LimitedRed
|
|
49
49
|
end
|
50
50
|
|
51
51
|
def supports_feature_hash?
|
52
|
-
gherkin_formatter.instance_variables.include?(
|
52
|
+
gherkin_formatter.instance_variables.include?('@feature_hash')
|
53
53
|
end
|
54
54
|
|
55
55
|
def feature_hash
|
@@ -7,7 +7,7 @@ AfterConfiguration do |config|
|
|
7
7
|
|
8
8
|
limited_red_config = LimitedRed::Config.load_and_validate_config
|
9
9
|
if limited_red_config
|
10
|
-
cuke_stats = LimitedRed::Stats.new(limited_red_config)
|
10
|
+
cuke_stats = LimitedRed::Stats.new(limited_red_config.merge(:type => :cucumber))
|
11
11
|
|
12
12
|
feature_files = options[:paths]
|
13
13
|
feature_files = ["features"] if feature_files.empty?
|
@@ -1,13 +1,35 @@
|
|
1
|
+
require 'limited_red'
|
2
|
+
require 'limited_red/client'
|
3
|
+
|
1
4
|
RSpec.configure do |config|
|
5
|
+
CLIENT = LimitedRed::Client.new(LimitedRed::Config.load_and_validate_config(:rspec))
|
6
|
+
BUILD_ID = Time.now
|
7
|
+
|
8
|
+
fails = []
|
9
|
+
passes = []
|
10
|
+
|
2
11
|
config.after(:each) do
|
3
12
|
metadata = example.metadata
|
4
13
|
full_description = example.metadata[:full_description]
|
5
14
|
file, line = *(example.metadata[:example_group_block].source_location)
|
15
|
+
|
16
|
+
json = {:file => file,
|
17
|
+
:line => line,
|
18
|
+
:uri => full_description}.to_json
|
6
19
|
|
7
20
|
if example.exception #Fail
|
8
|
-
|
21
|
+
fails << file
|
22
|
+
CLIENT.log_result(BUILD_ID, :result => json)
|
23
|
+
puts "Client FAIL", file, line
|
9
24
|
else # Pass
|
25
|
+
passes << file
|
26
|
+
CLIENT.log_result(BUILD_ID, :result => json)
|
10
27
|
puts "PASS", file, line
|
11
28
|
end
|
12
29
|
end
|
30
|
+
|
31
|
+
config.after(:all) do
|
32
|
+
CLIENT.log_build(BUILD_ID, {:fails => fails,
|
33
|
+
:passes => passes})
|
34
|
+
end
|
13
35
|
end
|
data/lib/limited_red/version.rb
CHANGED
metadata
CHANGED
@@ -1,47 +1,65 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: limited_red
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 23
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 3
|
9
|
+
- 2
|
10
|
+
version: 0.3.2
|
6
11
|
platform: ruby
|
7
|
-
authors:
|
12
|
+
authors:
|
8
13
|
- Joseph Wilk
|
9
14
|
autorequire:
|
10
15
|
bindir: bin
|
11
16
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
17
|
+
|
18
|
+
date: 2012-01-13 00:00:00 +00:00
|
19
|
+
default_executable:
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
15
22
|
name: httparty
|
16
|
-
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
17
25
|
none: false
|
18
|
-
requirements:
|
19
|
-
- - =
|
20
|
-
- !ruby/object:Gem::Version
|
26
|
+
requirements:
|
27
|
+
- - "="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 61
|
30
|
+
segments:
|
31
|
+
- 0
|
32
|
+
- 8
|
33
|
+
- 1
|
21
34
|
version: 0.8.1
|
22
35
|
type: :runtime
|
23
|
-
|
24
|
-
|
25
|
-
- !ruby/object:Gem::Dependency
|
36
|
+
version_requirements: *id001
|
37
|
+
- !ruby/object:Gem::Dependency
|
26
38
|
name: cucumber
|
27
|
-
|
39
|
+
prerelease: false
|
40
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
28
41
|
none: false
|
29
|
-
requirements:
|
30
|
-
- -
|
31
|
-
- !ruby/object:Gem::Version
|
42
|
+
requirements:
|
43
|
+
- - ">="
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
hash: 27
|
46
|
+
segments:
|
47
|
+
- 1
|
48
|
+
- 1
|
49
|
+
- 4
|
32
50
|
version: 1.1.4
|
33
51
|
type: :runtime
|
34
|
-
|
35
|
-
|
36
|
-
description: Learn and adapt from you test metrics. Used with the www.limited-red.com
|
37
|
-
service. Tests are priorited by the probability of failure
|
52
|
+
version_requirements: *id002
|
53
|
+
description: Learn and adapt from you test metrics. Used with the www.limited-red.com service. Tests are priorited by the probability of failure
|
38
54
|
email: joe@josephwilk.net
|
39
55
|
executables: []
|
56
|
+
|
40
57
|
extensions: []
|
41
|
-
|
58
|
+
|
59
|
+
extra_rdoc_files:
|
42
60
|
- LICENSE
|
43
61
|
- README.rdoc
|
44
|
-
files:
|
62
|
+
files:
|
45
63
|
- lib/limited_red/adapter/httparty.rb
|
46
64
|
- lib/limited_red/client.rb
|
47
65
|
- lib/limited_red/config.rb
|
@@ -55,31 +73,39 @@ files:
|
|
55
73
|
- lib/limited_red.rb
|
56
74
|
- LICENSE
|
57
75
|
- README.rdoc
|
76
|
+
has_rdoc: true
|
58
77
|
homepage: http://www.limited-red.com
|
59
|
-
licenses:
|
78
|
+
licenses:
|
60
79
|
- MIT
|
61
80
|
post_install_message:
|
62
|
-
rdoc_options:
|
81
|
+
rdoc_options:
|
63
82
|
- --charset=UTF-8
|
64
|
-
require_paths:
|
83
|
+
require_paths:
|
65
84
|
- lib
|
66
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
85
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
67
86
|
none: false
|
68
|
-
requirements:
|
69
|
-
- -
|
70
|
-
- !ruby/object:Gem::Version
|
71
|
-
|
72
|
-
|
87
|
+
requirements:
|
88
|
+
- - ">="
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
hash: 3
|
91
|
+
segments:
|
92
|
+
- 0
|
93
|
+
version: "0"
|
94
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
73
95
|
none: false
|
74
|
-
requirements:
|
75
|
-
- -
|
76
|
-
- !ruby/object:Gem::Version
|
77
|
-
|
96
|
+
requirements:
|
97
|
+
- - ">="
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
hash: 3
|
100
|
+
segments:
|
101
|
+
- 0
|
102
|
+
version: "0"
|
78
103
|
requirements: []
|
104
|
+
|
79
105
|
rubyforge_project:
|
80
|
-
rubygems_version: 1.
|
106
|
+
rubygems_version: 1.3.7
|
81
107
|
signing_key:
|
82
108
|
specification_version: 3
|
83
109
|
summary: Client for www.limited-red.com service
|
84
110
|
test_files: []
|
85
|
-
|
111
|
+
|