limited_red 0.4.3 → 0.4.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/limited_red/plugins/cucumber.rb +1 -1
- data/lib/limited_red/plugins/rspec.rb +31 -26
- data/lib/limited_red/version.rb +1 -1
- metadata +6 -6
@@ -1,42 +1,47 @@
|
|
1
1
|
require 'limited_red'
|
2
2
|
|
3
3
|
RSpec.configure do |config|
|
4
|
-
|
5
|
-
|
4
|
+
if ENV['LIMITED_RED'] || ENV['LIMITED_RED_API_KEY']
|
5
|
+
CLIENT = LimitedRed::Client.new(LimitedRed::Config.load_and_validate_config('rspec'))
|
6
|
+
BUILD_ID = Time.now.to_i
|
6
7
|
|
7
|
-
|
8
|
-
|
8
|
+
fails = []
|
9
|
+
passes = []
|
9
10
|
|
10
|
-
|
11
|
-
|
11
|
+
config.after(:each) do
|
12
|
+
metadata = LimitedRed::Rspec::Metadata.new(example.metadata)
|
12
13
|
|
13
|
-
|
14
|
-
|
14
|
+
if example.exception #Fail
|
15
|
+
fails << metadata.file_and_line
|
15
16
|
|
16
|
-
|
17
|
+
metadata.add_exception(example.exception)
|
17
18
|
|
18
|
-
|
19
|
-
|
19
|
+
without_fakeweb do
|
20
|
+
CLIENT.log_fail_result(BUILD_ID, :uri => metadata.uri, :result => metadata.to_json)
|
21
|
+
end
|
22
|
+
else # Pass
|
23
|
+
passes << metadata.file_and_line
|
24
|
+
without_fakeweb do
|
25
|
+
CLIENT.log_pass_result(BUILD_ID, :uri => metadata.uri, :result => metadata.to_json)
|
26
|
+
end
|
20
27
|
end
|
21
|
-
|
22
|
-
|
28
|
+
end
|
29
|
+
|
30
|
+
config.after(:suite) do
|
23
31
|
without_fakeweb do
|
24
|
-
CLIENT.
|
32
|
+
CLIENT.log_build(BUILD_ID, {:fails => fails,
|
33
|
+
:passes => passes})
|
25
34
|
end
|
26
35
|
end
|
27
|
-
end
|
28
36
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
37
|
+
def without_fakeweb
|
38
|
+
FakeWeb.allow_net_connect = true if defined?(FakeWeb)
|
39
|
+
yield
|
40
|
+
FakeWeb.allow_net_connect = false if defined?(FakeWeb)
|
33
41
|
end
|
34
42
|
end
|
35
|
-
|
36
|
-
def without_fakeweb
|
37
|
-
FakeWeb.allow_net_connect = true if defined?(FakeWeb)
|
38
|
-
yield
|
39
|
-
FakeWeb.allow_net_connect = false if defined?(FakeWeb)
|
40
|
-
end
|
41
|
-
|
42
43
|
end
|
44
|
+
|
45
|
+
at_exit{
|
46
|
+
LimitedRed::ThreadPool.wait_for_all_threads_to_finish
|
47
|
+
}
|
data/lib/limited_red/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: limited_red
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-09-
|
12
|
+
date: 2012-09-21 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: httparty
|
16
|
-
requirement: &
|
16
|
+
requirement: &70121349215040 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - =
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 0.8.1
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70121349215040
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: cucumber
|
27
|
-
requirement: &
|
27
|
+
requirement: &70121349214520 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,7 +32,7 @@ dependencies:
|
|
32
32
|
version: 1.1.4
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70121349214520
|
36
36
|
description: Learn and adapt from you test metrics. Used with the www.limited-red.com
|
37
37
|
service. Tests are priorited by the probability of failure
|
38
38
|
email: joe@josephwilk.net
|