moto 0.7.0 → 0.7.1
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.
- checksums.yaml +4 -4
- data/lib/clients/clients_manager.rb +50 -50
- data/lib/runner/thread_context.rb +2 -2
- data/lib/runner_logging.rb +25 -25
- data/lib/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4c72891d116e48d0ff3999c21d91c6522ac0b1bc
|
4
|
+
data.tar.gz: 9dcb05b25cc17e74dc7e52007bf68b4cae2f61a9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 18653e61b99561362a55b000258b37e0b63c1e429dfd368662dcef12497366be63580488a33e9370b6ce8852a63160741fcaaadbd4616ddc697223db7eae577f
|
7
|
+
data.tar.gz: 36412b9a3a27c4e76546937aa0d21916370774ef283cb9d7617601e48b857b6e54c4f0bf332b48dee796f036fba061f72c1d9798061a1abde9aeebf08fd7e04d
|
@@ -1,51 +1,51 @@
|
|
1
|
-
module Moto
|
2
|
-
module Lib
|
3
|
-
module Clients
|
4
|
-
class ClientsManager
|
5
|
-
|
6
|
-
attr_reader :clients
|
7
|
-
|
8
|
-
def initialize
|
9
|
-
@clients = {}
|
10
|
-
end
|
11
|
-
|
12
|
-
def client(name)
|
13
|
-
return @clients[name] if @clients.key? name
|
14
|
-
|
15
|
-
name_app = 'MotoApp::Lib::Clients::' + name
|
16
|
-
name_moto = 'Moto::Clients::' + name
|
17
|
-
|
18
|
-
client = try_client(name_app, "#{MotoApp::DIR}/")
|
19
|
-
if client
|
20
|
-
@clients[name] = client
|
21
|
-
return client
|
22
|
-
end
|
23
|
-
|
24
|
-
client = try_client(name_moto, "#{Moto::DIR}/lib/")
|
25
|
-
if client
|
26
|
-
@clients[name] = client
|
27
|
-
return client
|
28
|
-
end
|
29
|
-
|
30
|
-
raise "Could not find client class for name: #{name}"
|
31
|
-
end
|
32
|
-
|
33
|
-
def try_client(name, dir)
|
34
|
-
client_path = name.underscore.split('/')[1..-1].join('/')
|
35
|
-
|
36
|
-
if File.file?(dir + client_path + '.rb')
|
37
|
-
require dir + client_path
|
38
|
-
client_const = name.constantize
|
39
|
-
instance = client_const.new
|
40
|
-
instance.start_run
|
41
|
-
instance
|
42
|
-
else
|
43
|
-
nil
|
44
|
-
end
|
45
|
-
end
|
46
|
-
private :try_client
|
47
|
-
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
1
|
+
module Moto
|
2
|
+
module Lib
|
3
|
+
module Clients
|
4
|
+
class ClientsManager
|
5
|
+
|
6
|
+
attr_reader :clients
|
7
|
+
|
8
|
+
def initialize
|
9
|
+
@clients = {}
|
10
|
+
end
|
11
|
+
|
12
|
+
def client(name)
|
13
|
+
return @clients[name] if @clients.key? name
|
14
|
+
|
15
|
+
name_app = 'MotoApp::Lib::Clients::' + name
|
16
|
+
name_moto = 'Moto::Clients::' + name
|
17
|
+
|
18
|
+
client = try_client(name_app, "#{MotoApp::DIR}/")
|
19
|
+
if client
|
20
|
+
@clients[name] = client
|
21
|
+
return client
|
22
|
+
end
|
23
|
+
|
24
|
+
client = try_client(name_moto, "#{Moto::DIR}/lib/")
|
25
|
+
if client
|
26
|
+
@clients[name] = client
|
27
|
+
return client
|
28
|
+
end
|
29
|
+
|
30
|
+
raise "Could not find client class for name: #{name}"
|
31
|
+
end
|
32
|
+
|
33
|
+
def try_client(name, dir)
|
34
|
+
client_path = name.underscore.split('/')[1..-1].join('/')
|
35
|
+
|
36
|
+
if File.file?(dir + client_path + '.rb')
|
37
|
+
require dir + client_path
|
38
|
+
client_const = name.constantize
|
39
|
+
instance = client_const.new
|
40
|
+
instance.start_run
|
41
|
+
instance
|
42
|
+
else
|
43
|
+
nil
|
44
|
+
end
|
45
|
+
end
|
46
|
+
private :try_client
|
47
|
+
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
51
|
end
|
@@ -51,8 +51,8 @@ module Moto
|
|
51
51
|
Thread.current['logger'].info("Result: #{@test.status.results.last.code}")
|
52
52
|
|
53
53
|
# test should have another attempt in case of an error / failure / none at all
|
54
|
-
if (@test.status.results.last.code == Moto::Test::Result::ERROR &&
|
55
|
-
(@test.status.results.last.code == Moto::Test::Result::FAILURE &&
|
54
|
+
if !(@test.status.results.last.code == Moto::Test::Result::ERROR && config[:test_reattempt_on_error]) &&
|
55
|
+
!(@test.status.results.last.code == Moto::Test::Result::FAILURE && config[:test_reattempt_on_fail] )
|
56
56
|
break
|
57
57
|
end
|
58
58
|
|
data/lib/runner_logging.rb
CHANGED
@@ -1,26 +1,26 @@
|
|
1
|
-
module Moto
|
2
|
-
module RunnerLogging
|
3
|
-
|
4
|
-
# TODO: merge it somehow with TestLogging. Parametrize logger object?
|
5
|
-
def self.included(cls)
|
6
|
-
def cls.method_added(name)
|
7
|
-
excluded_methods = Moto::EmptyListener.instance_methods(false)
|
8
|
-
excluded_methods << :new
|
9
|
-
excluded_methods << :initialize
|
10
|
-
# TODO: configure more excluded classes/methods
|
11
|
-
return if @added
|
12
|
-
@added = true # protect from recursion
|
13
|
-
original_method = "original_#{name}"
|
14
|
-
alias_method original_method, name
|
15
|
-
define_method(name) do |*args|
|
16
|
-
Thread.current['logger'].debug("#{self.class.name}::#{__callee__} ENTER >>> #{args}") unless excluded_methods.include? name
|
17
|
-
result = send original_method, *args
|
18
|
-
Thread.current['logger'].debug("#{self.class.name}::#{__callee__} LEAVE <<< #{result} ") unless excluded_methods.include? name
|
19
|
-
result
|
20
|
-
end
|
21
|
-
@added = false
|
22
|
-
end
|
23
|
-
|
24
|
-
end
|
25
|
-
end
|
1
|
+
module Moto
|
2
|
+
module RunnerLogging
|
3
|
+
|
4
|
+
# TODO: merge it somehow with TestLogging. Parametrize logger object?
|
5
|
+
def self.included(cls)
|
6
|
+
def cls.method_added(name)
|
7
|
+
excluded_methods = Moto::EmptyListener.instance_methods(false)
|
8
|
+
excluded_methods << :new
|
9
|
+
excluded_methods << :initialize
|
10
|
+
# TODO: configure more excluded classes/methods
|
11
|
+
return if @added
|
12
|
+
@added = true # protect from recursion
|
13
|
+
original_method = "original_#{name}"
|
14
|
+
alias_method original_method, name
|
15
|
+
define_method(name) do |*args|
|
16
|
+
Thread.current['logger'].debug("#{self.class.name}::#{__callee__} ENTER >>> #{args}") unless excluded_methods.include? name
|
17
|
+
result = send original_method, *args
|
18
|
+
Thread.current['logger'].debug("#{self.class.name}::#{__callee__} LEAVE <<< #{result} ") unless excluded_methods.include? name
|
19
|
+
result
|
20
|
+
end
|
21
|
+
@added = false
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
end
|
26
26
|
end
|
data/lib/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: moto
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bartek Wilczek
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2016-05-
|
14
|
+
date: 2016-05-31 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: activesupport
|