moto 1.1.4 → 1.1.6
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/config/hash.rb +9 -0
- data/lib/{config.rb → config/manager.rb} +6 -5
- data/lib/modes/mode_selector.rb +1 -1
- data/lib/modes/run/test_provider.rb +1 -1
- data/lib/modes/run/test_runner.rb +2 -2
- data/lib/modes/run/thread_context.rb +2 -2
- data/lib/parameter_parser.rb +14 -14
- data/lib/reporting/listeners/junit_xml.rb +1 -1
- data/lib/reporting/listeners/webui.rb +1 -1
- data/lib/reporting/test_reporter.rb +1 -1
- data/lib/test/base.rb +1 -1
- data/lib/test/generator.rb +1 -1
- data/lib/test/metadata_generator.rb +1 -1
- data/lib/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '0955cad669b3d86d71325ab80d3d04010a485880'
|
4
|
+
data.tar.gz: f7b3aff8cfdd40bd0fbd009ded30ba332214f513
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 061e7b129091f5caff204a38c68a64ebbfed6870e512d20634132bb8f2441eb922de07f532a2a2decd4858a47133a32ad3911b31865e6b84cee954af33acda4b
|
7
|
+
data.tar.gz: a9ed51f091931e0781f7340852c4d72c6138f52fef2f3afb2644041f1482a6ddb877ee0b3fe3643685b8f864598f465ff42849ce8458b63a05eff633b5b3391e
|
data/lib/config/hash.rb
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
module Moto
|
2
|
+
module Config
|
3
|
+
# Purpose of this class is to enable developers of Moto-reliant apps to be able to monkey patch their custom methods
|
4
|
+
# to data structure (this) that holds, retrieves and modifies env config data
|
5
|
+
class Hash < Hash
|
6
|
+
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
@@ -1,8 +1,9 @@
|
|
1
1
|
require 'active_support/core_ext/hash/deep_merge'
|
2
|
+
require_relative 'hash'
|
2
3
|
|
3
4
|
module Moto
|
4
|
-
module
|
5
|
-
class
|
5
|
+
module Config
|
6
|
+
class Manager
|
6
7
|
|
7
8
|
# @return [String] String representing the name of the current environment
|
8
9
|
def self.environment
|
@@ -57,14 +58,14 @@ module Moto
|
|
57
58
|
end
|
58
59
|
|
59
60
|
# @return [Hash] Hash representing data from MotoApp/config/moto.rb file
|
60
|
-
def self.
|
61
|
+
def self.config_moto
|
61
62
|
@@moto
|
62
63
|
end
|
63
64
|
|
64
65
|
|
65
66
|
# @return [Hash] Configuration for selected environment + current thread combination
|
66
|
-
def self.
|
67
|
-
Thread.current['
|
67
|
+
def self.config_environment
|
68
|
+
Thread.current['config_environment'] ||= Moto::Config::Hash.new.merge!(Marshal.load(Marshal.dump(@@env_consts)))
|
68
69
|
end
|
69
70
|
|
70
71
|
end
|
data/lib/modes/mode_selector.rb
CHANGED
@@ -16,7 +16,7 @@ module Moto
|
|
16
16
|
tests_metadata = prepare_metadata(parsed_arguments)
|
17
17
|
test_reporter = prepare_test_reporter(parsed_arguments)
|
18
18
|
|
19
|
-
if Moto::
|
19
|
+
if Moto::Config::Manager.config_moto[:test_runner][:dry_run]
|
20
20
|
runner = Moto::Modes::Run::DryRunner.new(tests_metadata, test_reporter)
|
21
21
|
else
|
22
22
|
runner = Moto::Modes::Run::TestRunner.new(tests_metadata, test_reporter, parsed_arguments[:stop_on])
|
@@ -11,7 +11,7 @@ module Moto
|
|
11
11
|
# @param [Array] tests_metadata
|
12
12
|
def initialize(tests_metadata)
|
13
13
|
super()
|
14
|
-
@test_repeats = Moto::
|
14
|
+
@test_repeats = Moto::Config::Manager.config_moto[:test_runner][:test_repeats]
|
15
15
|
@current_test_repeat = 1
|
16
16
|
@queue = Queue.new
|
17
17
|
@tests_metadata = tests_metadata
|
@@ -23,7 +23,7 @@ module Moto
|
|
23
23
|
|
24
24
|
def run
|
25
25
|
test_provider = TestProvider.new(@tests_metadata)
|
26
|
-
threads_max = Moto::
|
26
|
+
threads_max = Moto::Config::Manager.config_moto[:test_runner][:thread_count] || 1
|
27
27
|
|
28
28
|
# remove log/screenshot files from previous execution
|
29
29
|
@tests_metadata.each do |metadata|
|
@@ -38,7 +38,7 @@ module Moto
|
|
38
38
|
|
39
39
|
Thread.abort_on_exception = true
|
40
40
|
|
41
|
-
|
41
|
+
threads_max.times do
|
42
42
|
Thread.new do
|
43
43
|
|
44
44
|
loop do
|
@@ -1,5 +1,5 @@
|
|
1
1
|
require 'fileutils'
|
2
|
-
require_relative '../../config'
|
2
|
+
require_relative '../../config/manager'
|
3
3
|
|
4
4
|
module Moto
|
5
5
|
module Modes
|
@@ -72,7 +72,7 @@ module Moto
|
|
72
72
|
|
73
73
|
# @return [Hash] Hash with config for ThreadContext
|
74
74
|
def config
|
75
|
-
Moto::
|
75
|
+
Moto::Config::Manager.config_moto[:test_runner]
|
76
76
|
end
|
77
77
|
private :config
|
78
78
|
|
data/lib/parameter_parser.rb
CHANGED
@@ -7,7 +7,7 @@ end
|
|
7
7
|
|
8
8
|
require 'optparse'
|
9
9
|
require 'logger'
|
10
|
-
require_relative 'config'
|
10
|
+
require_relative 'config/manager'
|
11
11
|
require_relative 'modes/mode_selector'
|
12
12
|
|
13
13
|
module Moto
|
@@ -20,7 +20,7 @@ module Moto
|
|
20
20
|
|
21
21
|
# TODO: IMPORTANT ISSUE
|
22
22
|
# xxx_parse functions should not return parsed arguments and pass them to functions
|
23
|
-
# but instead all should inject proper values into Moto::
|
23
|
+
# but instead all should inject proper values into Moto::Config::Manager.config_moto[:xxx][:yyy]
|
24
24
|
# on which all further components should relay
|
25
25
|
|
26
26
|
if argv[0] == '--version'
|
@@ -44,24 +44,24 @@ module Moto
|
|
44
44
|
end
|
45
45
|
|
46
46
|
def self.prepare_config(options)
|
47
|
-
Moto::
|
47
|
+
Moto::Config::Manager.load_configuration(options[:config_name], options[:environment])
|
48
48
|
|
49
49
|
if !config_test_runner
|
50
|
-
Moto::
|
50
|
+
Moto::Config::Manager.config_moto[:test_runner] = {}
|
51
51
|
end
|
52
52
|
|
53
53
|
if !config_test_generator
|
54
|
-
Moto::
|
54
|
+
Moto::Config::Manager.config_moto[:test_generator] = {}
|
55
55
|
end
|
56
56
|
|
57
57
|
end
|
58
58
|
|
59
59
|
def self.config_test_runner
|
60
|
-
Moto::
|
60
|
+
Moto::Config::Manager.config_moto[:test_runner]
|
61
61
|
end
|
62
62
|
|
63
63
|
def self.config_test_generator
|
64
|
-
Moto::
|
64
|
+
Moto::Config::Manager.config_moto[:test_generator]
|
65
65
|
end
|
66
66
|
|
67
67
|
def self.run_parse(argv)
|
@@ -104,15 +104,15 @@ module Moto
|
|
104
104
|
|
105
105
|
# Runner configuration
|
106
106
|
|
107
|
-
Moto::
|
108
|
-
Moto::
|
109
|
-
Moto::
|
110
|
-
Moto::
|
107
|
+
Moto::Config::Manager.config_moto[:test_runner][:thread_count] = options[:threads] if options[:threads]
|
108
|
+
Moto::Config::Manager.config_moto[:test_runner][:test_attempt_max] = options[:attempts] if options[:attempts]
|
109
|
+
Moto::Config::Manager.config_moto[:test_runner][:dry_run] = options[:dry_run] if options[:dry_run]
|
110
|
+
Moto::Config::Manager.config_moto[:test_runner][:explicit_errors] = options[:explicit_errors] if options[:explicit_errors]
|
111
111
|
|
112
112
|
# Test log level parsing
|
113
113
|
|
114
114
|
if options[:log_level]
|
115
|
-
Moto::
|
115
|
+
Moto::Config::Manager.config_moto[:test_runner][:log_level] = case options[:log_level].downcase
|
116
116
|
when 'info' then Logger::INFO
|
117
117
|
when 'warn' then Logger::WARN
|
118
118
|
when 'error' then Logger::ERROR
|
@@ -120,11 +120,11 @@ module Moto
|
|
120
120
|
else Logger::DEBUG
|
121
121
|
end
|
122
122
|
else
|
123
|
-
Moto::
|
123
|
+
Moto::Config::Manager.config_moto[:test_runner][:log_level] = Logger::DEBUG
|
124
124
|
end
|
125
125
|
|
126
126
|
# Generator configuration
|
127
|
-
Moto::
|
127
|
+
Moto::Config::Manager.config_moto[:test_generator][:param_name] = options[:param_name] if options[:param_name]
|
128
128
|
|
129
129
|
return options
|
130
130
|
end
|
@@ -7,7 +7,7 @@ module Moto
|
|
7
7
|
|
8
8
|
def end_run(run_status)
|
9
9
|
|
10
|
-
path = Moto::
|
10
|
+
path = Moto::Config::Manager.config_moto[:test_reporter][:listeners][:junit_xml][:output_file]
|
11
11
|
|
12
12
|
run_status_hash = {
|
13
13
|
errors: run_status.tests_error.length,
|
data/lib/test/base.rb
CHANGED
data/lib/test/generator.rb
CHANGED
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.1.
|
4
|
+
version: 1.1.6
|
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-15 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: activesupport
|
@@ -68,7 +68,8 @@ extensions: []
|
|
68
68
|
extra_rdoc_files: []
|
69
69
|
files:
|
70
70
|
- bin/moto
|
71
|
-
- lib/config.rb
|
71
|
+
- lib/config/hash.rb
|
72
|
+
- lib/config/manager.rb
|
72
73
|
- lib/exceptions/base.rb
|
73
74
|
- lib/exceptions/test_forced_failure.rb
|
74
75
|
- lib/exceptions/test_forced_passed.rb
|