moto 0.9.7 → 0.9.8
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/cli.rb +6 -1
- data/lib/parser.rb +3 -0
- data/lib/runner/dry_runner.rb +37 -0
- data/lib/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4ef934e2b438cf5e2a119fe709bade5d043ce709
|
4
|
+
data.tar.gz: 41073a6ea3741f99551376d070a191a91eaf5201
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c0e424998b989a0f26c90061a96f0e88339b68028ea0122c10474093b2e4fc05761d8335f59488dfcce11f568355e041cd19662591b7126650c7db9e02a59c15
|
7
|
+
data.tar.gz: 86e0d059dee16099fabc3b3412cb5c643dd5f66308bfd3d4cb601ee0f1df97135b9af6b5487209d9d3dab5678abdbbf30ab64126115d786292879fc31e4e0dc7
|
data/lib/cli.rb
CHANGED
@@ -14,6 +14,7 @@ end
|
|
14
14
|
|
15
15
|
require_relative './test_logging'
|
16
16
|
require_relative './runner_logging'
|
17
|
+
require_relative './runner/dry_runner'
|
17
18
|
require_relative './runner/test_runner'
|
18
19
|
require_relative './runner/thread_context'
|
19
20
|
require_relative './runner/test_generator'
|
@@ -106,7 +107,11 @@ module Moto
|
|
106
107
|
|
107
108
|
test_reporter = Moto::Reporting::TestReporter.new(argv[:listeners], run_params)
|
108
109
|
|
109
|
-
|
110
|
+
if Moto::Lib::Config.moto[:test_runner][:dry_run]
|
111
|
+
runner = Moto::Runner::DryRunner.new(tests_metadata, test_reporter)
|
112
|
+
else
|
113
|
+
runner = Moto::Runner::TestRunner.new(tests_metadata, test_reporter, argv[:stop_on])
|
114
|
+
end
|
110
115
|
runner.run
|
111
116
|
end
|
112
117
|
|
data/lib/parser.rb
CHANGED
@@ -56,6 +56,7 @@ module Moto
|
|
56
56
|
opts.on('--stop-on-error') { options[:stop_on][:error] = true }
|
57
57
|
opts.on('--stop-on-fail') { options[:stop_on][:fail] = true }
|
58
58
|
opts.on('--stop-on-skip') { options[:stop_on][:skip] = true }
|
59
|
+
opts.on('--dry-run') { options[:dry_run] = true }
|
59
60
|
end.parse!
|
60
61
|
|
61
62
|
if options[:run_name].nil?
|
@@ -72,6 +73,7 @@ module Moto
|
|
72
73
|
|
73
74
|
Moto::Lib::Config.moto[:test_runner][:thread_count] = options[:threads] if options[:threads]
|
74
75
|
Moto::Lib::Config.moto[:test_runner][:test_attempt_max] = options[:attempts] if options[:attempts]
|
76
|
+
Moto::Lib::Config.moto[:test_runner][:dry_run] = options[:dry_run] if options[:dry_run]
|
75
77
|
|
76
78
|
return options
|
77
79
|
end
|
@@ -149,6 +151,7 @@ module Moto
|
|
149
151
|
--stop-on-error Moto will stop test execution when an error is encountered in test results
|
150
152
|
--stop-on-fail Moto will stop test execution when a failure is encountered in test results
|
151
153
|
--stop-on-skip Moto will stop test execution when a skip is encountered in test results
|
154
|
+
--dry-run Moto will list all test cases which would be run with provided arguments
|
152
155
|
|
153
156
|
|
154
157
|
MOTO GENERATE:
|
@@ -0,0 +1,37 @@
|
|
1
|
+
require_relative '../reporting/test_reporter'
|
2
|
+
|
3
|
+
module Moto
|
4
|
+
module Runner
|
5
|
+
class DryRunner
|
6
|
+
|
7
|
+
# @param [Array] tests_metadata Collection of [Moto::Test::Metadata] objects describing Tests
|
8
|
+
# @param [Moto::Reporting::TestReporter] test_reporter Reporter of test/run statuses that communicates with external status listeners
|
9
|
+
def initialize(tests_metadata, test_reporter)
|
10
|
+
@tests_metadata = tests_metadata
|
11
|
+
@test_reporter = test_reporter
|
12
|
+
end
|
13
|
+
|
14
|
+
def run
|
15
|
+
@test_reporter.report_start_run
|
16
|
+
|
17
|
+
test_generator = TestGenerator.new
|
18
|
+
@tests_metadata.each do |metadata|
|
19
|
+
test_variants = test_generator.get_test_with_variants(metadata)
|
20
|
+
test_variants.each do |tc|
|
21
|
+
@test_reporter.report_start_test(tc.status, tc.metadata)
|
22
|
+
tc.status.initialize_run
|
23
|
+
tc.status.log_exception(Exceptions::TestSkipped.new('Dry run.'))
|
24
|
+
tc.status.finalize_run
|
25
|
+
@test_reporter.report_end_test(tc.status)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
@test_reporter.report_end_run
|
30
|
+
|
31
|
+
# Exit application with code that represents status of test run
|
32
|
+
Kernel.exit(@test_reporter.run_status.bitmap)
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
36
|
+
end
|
37
|
+
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.9.
|
4
|
+
version: 0.9.8
|
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: 2017-02-
|
14
|
+
date: 2017-02-28 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: activesupport
|
@@ -102,6 +102,7 @@ files:
|
|
102
102
|
- lib/reporting/listeners/webui_deprecated.rb
|
103
103
|
- lib/reporting/run_status.rb
|
104
104
|
- lib/reporting/test_reporter.rb
|
105
|
+
- lib/runner/dry_runner.rb
|
105
106
|
- lib/runner/test_generator.rb
|
106
107
|
- lib/runner/test_provider.rb
|
107
108
|
- lib/runner/test_runner.rb
|