moto 1.0.12 → 1.0.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/config.rb +4 -20
- data/lib/modes/run/test_runner.rb +8 -2
- data/lib/reporting/listeners/webui.rb +0 -1
- data/lib/test/base.rb +4 -22
- data/lib/test/metadata_generator.rb +0 -4
- 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: f4b0da411925819e71869d6cec3b81471ac4cdd3
|
4
|
+
data.tar.gz: 1a678c0f42a28cc37e01b41a4a4419c9290985f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dab17cc2b292dbabda911d5d989573c32749d8e9930cdf10d6c119b704807a10bc4c029509bfea88d6d95e096055321b2438cc09ba3ce9b944f02d793f1a2e72
|
7
|
+
data.tar.gz: a7fc7db8a00321daf7ba728c7bf1ee232b66d4a186ae86dfffadaa1193496717d5f2f9f64f0c93df75a5950e5bbb312c6708780abd5740fb8a637df7174ee6c3
|
data/lib/config.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require 'active_support'
|
1
|
+
require 'active_support/core_ext/hash/deep_merge'
|
2
2
|
|
3
3
|
module Moto
|
4
4
|
module Lib
|
@@ -61,26 +61,10 @@ module Moto
|
|
61
61
|
@@moto
|
62
62
|
end
|
63
63
|
|
64
|
-
#
|
65
|
-
# @param [String] key Name of the key which's value is to be retrieved
|
66
|
-
# @return [String] Value of the key
|
67
|
-
def self.environment_const(key)
|
68
|
-
key = key.to_s
|
69
64
|
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
"@@env_consts[:#{key}]"
|
74
|
-
end
|
75
|
-
|
76
|
-
begin
|
77
|
-
value = eval(code)
|
78
|
-
raise if value.nil?
|
79
|
-
rescue
|
80
|
-
raise "There is no const defined for key: #{key}."
|
81
|
-
end
|
82
|
-
|
83
|
-
Marshal.load(Marshal.dump(value))
|
65
|
+
# @return [Hash] Configuration for selected environment + current thread combination
|
66
|
+
def self.environment_config
|
67
|
+
Thread.current['environment_config'] ||= Marshal.load(Marshal.dump(@@env_consts))
|
84
68
|
end
|
85
69
|
|
86
70
|
end
|
@@ -40,16 +40,22 @@ module Moto
|
|
40
40
|
|
41
41
|
(1..threads_max).each do |index|
|
42
42
|
Thread.new do
|
43
|
-
|
43
|
+
|
44
44
|
loop do
|
45
45
|
tc = ThreadContext.new(test_provider.get_test, @test_reporter)
|
46
46
|
tc.run
|
47
|
+
|
48
|
+
# unset all leftover variables stored 'globally' in Thread
|
49
|
+
Thread.current.keys.each do |k|
|
50
|
+
Thread.current[k] = nil
|
51
|
+
end
|
52
|
+
|
47
53
|
end
|
48
54
|
end
|
49
55
|
end
|
50
56
|
|
51
57
|
# Waiting for all threads to run out of work so we can end the application
|
52
|
-
# or
|
58
|
+
# or abnormal termination to be triggered based on options provided by the user
|
53
59
|
loop do
|
54
60
|
run_status = @test_reporter.run_status
|
55
61
|
if (test_provider.num_waiting == threads_max) ||
|
data/lib/test/base.rb
CHANGED
@@ -6,7 +6,6 @@ module Moto
|
|
6
6
|
class Base
|
7
7
|
|
8
8
|
attr_reader :name
|
9
|
-
attr_reader :env
|
10
9
|
attr_reader :params
|
11
10
|
attr_accessor :static_path
|
12
11
|
attr_accessor :status
|
@@ -120,22 +119,6 @@ module Moto
|
|
120
119
|
raise Exceptions::TestForcedPassed.new msg
|
121
120
|
end
|
122
121
|
|
123
|
-
|
124
|
-
# Checks for equality of both arguments
|
125
|
-
def assert_equal(a, b)
|
126
|
-
assert(a == b, "Arguments should be equal: #{a} != #{b}.")
|
127
|
-
end
|
128
|
-
|
129
|
-
# Checks if passed value is equal to True
|
130
|
-
def assert_true(value)
|
131
|
-
assert(value, 'Logical condition not met, expecting true, given false.')
|
132
|
-
end
|
133
|
-
|
134
|
-
# Checks if passed value is equal to False
|
135
|
-
def assert_false(value)
|
136
|
-
assert(!value, 'Logical condition not met, expecting false, given true.')
|
137
|
-
end
|
138
|
-
|
139
122
|
# Checks if result of condition equals to True
|
140
123
|
def assert(condition, message)
|
141
124
|
if !condition
|
@@ -143,14 +126,13 @@ module Moto
|
|
143
126
|
|
144
127
|
status.log_failure("ASSERTION FAILED in line #{line_number}: #{message}")
|
145
128
|
logger.error(message)
|
129
|
+
env
|
146
130
|
end
|
147
131
|
end
|
148
132
|
|
149
|
-
#
|
150
|
-
|
151
|
-
|
152
|
-
def const(key)
|
153
|
-
Moto::Lib::Config.environment_const(key)
|
133
|
+
# @return [Hash] Configuration for selected environment + current thread combination
|
134
|
+
def env
|
135
|
+
Moto::Lib::Config.environment_config
|
154
136
|
end
|
155
137
|
|
156
138
|
# @return [Logger]
|
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: 1.0.
|
4
|
+
version: 1.0.13
|
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: 2018-02-
|
14
|
+
date: 2018-02-09 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: activesupport
|