lopata 0.1.27 → 0.1.29
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/lopata/observers/console_output_observer.rb +5 -5
- data/lib/lopata/observers/web_logger.rb +5 -1
- data/lib/lopata/runner.rb +30 -6
- data/lib/lopata/scenario.rb +11 -9
- data/lib/lopata/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e277eccafc077953963f9f6d44543df7c7d7aac695d7871f1a3f3000cfe0685c
|
4
|
+
data.tar.gz: 30964380cf628255caa9be854b55809c2c7ac503127ec0791fd563660b8c7384
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a5716169ab5b7379c999bfeef4a45bf41df5ab7f3c9b3274352c6753fc5e1d0e218e6158a2c86e74704931f832b2ed5a7b49a3886afd3beb2104701beaa903b2
|
7
|
+
data.tar.gz: c1eb1c3a3396f3040f72a0133f530214ab49262f92b1c465f0d6f3ed8b0507be59f6eb252a614748ce995e16306f5fa53f4a7aaa5a8d4e3b1122e812e93958fd
|
@@ -7,7 +7,7 @@ module Lopata
|
|
7
7
|
class ConsoleOutputObserver < BaseObserver
|
8
8
|
extend Forwardable
|
9
9
|
# @private
|
10
|
-
attr_reader :output
|
10
|
+
attr_reader :output, :statuses
|
11
11
|
# @private
|
12
12
|
def_delegators :output, :puts, :flush
|
13
13
|
|
@@ -15,6 +15,10 @@ module Lopata
|
|
15
15
|
@output = $stdout
|
16
16
|
end
|
17
17
|
|
18
|
+
def started(world)
|
19
|
+
@statuses = {}
|
20
|
+
end
|
21
|
+
|
18
22
|
# @see Lopata::Observers::BaseObserver#finished
|
19
23
|
def finished(world)
|
20
24
|
total = statuses.values.inject(0, &:+)
|
@@ -104,10 +108,6 @@ module Lopata
|
|
104
108
|
def indent(cols, text)
|
105
109
|
text.split("\n").map { |line| " " * cols + line }.join("\n")
|
106
110
|
end
|
107
|
-
|
108
|
-
def statuses
|
109
|
-
@statuses ||= {}
|
110
|
-
end
|
111
111
|
end
|
112
112
|
end
|
113
113
|
end
|
@@ -115,6 +115,10 @@ module Lopata
|
|
115
115
|
to_rerun + get_json("/projects/#{project_code}/builds/#{build_number}/failures.json")
|
116
116
|
end
|
117
117
|
|
118
|
+
def need_run
|
119
|
+
get_json("/projects/#{project_code}/builds/#{build_number}/need_run.json")
|
120
|
+
end
|
121
|
+
|
118
122
|
private
|
119
123
|
|
120
124
|
def get_json(path)
|
@@ -159,4 +163,4 @@ module Lopata
|
|
159
163
|
@backtrace_formatter ||= Lopata::Observers::BacktraceFormatter.new
|
160
164
|
end
|
161
165
|
end
|
162
|
-
end
|
166
|
+
end
|
data/lib/lopata/runner.rb
CHANGED
@@ -9,30 +9,56 @@ require_relative 'condition'
|
|
9
9
|
module Lopata
|
10
10
|
# @private
|
11
11
|
class Runner < Thor
|
12
|
+
class_option :env, default: :qa, aliases: 'e'
|
13
|
+
class_option :keep, type: :boolean, aliases: 'k'
|
14
|
+
|
12
15
|
desc 'test', 'Run tests'
|
13
|
-
option :env, default: :qa, aliases: 'e'
|
14
16
|
option :rerun, type: :boolean, aliases: 'r'
|
15
|
-
option :keep, type: :boolean, aliases: 'k'
|
16
17
|
option :text, aliases: 't'
|
17
18
|
option :list, type: :boolean, aliases: 'l'
|
18
19
|
option :init, type: :boolean, aliases: 'i'
|
19
20
|
def test(*args)
|
20
21
|
trap_interrupt
|
21
22
|
configure_from_options
|
23
|
+
add_text_filter(options[:text]) if options[:text]
|
24
|
+
add_rerun_filter if options[:rerun]
|
22
25
|
Lopata::Loader.load_shared_steps
|
23
26
|
Lopata::Loader.load_scenarios(*args)
|
24
27
|
if options[:list]
|
25
28
|
list_scenarios
|
26
|
-
elsif
|
29
|
+
elsif options[:init]
|
27
30
|
init_scenarios
|
28
31
|
else
|
29
32
|
run_scenarios
|
30
33
|
end
|
31
34
|
end
|
32
35
|
|
36
|
+
desc 'suspect', 'Run suspect and not started tests'
|
37
|
+
option :skip, type: :numeric, default: 0, aliases: 's'
|
38
|
+
option :count, type: :numeric, default: 10, aliases: 'c'
|
39
|
+
def suspect(*args)
|
40
|
+
trap_interrupt
|
41
|
+
configure_from_options
|
42
|
+
Lopata::Loader.load_shared_steps
|
43
|
+
Lopata::Loader.load_scenarios(*args)
|
44
|
+
count = options[:count]
|
45
|
+
skip = options[:skip]
|
46
|
+
loop do
|
47
|
+
need_run = Lopata::Client.new.need_run
|
48
|
+
need_run = need_run[skip, count]
|
49
|
+
break if need_run.nil?
|
50
|
+
world = Lopata::World.new
|
51
|
+
world.scenarios.concat(Lopata.world.scenarios.select { |s| need_run.include?(s.title) })
|
52
|
+
break if world.scenarios.empty?
|
53
|
+
world.notify_observers(:started, world)
|
54
|
+
world.scenarios.each { |s| s.run }
|
55
|
+
world.notify_observers(:finished, world)
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
33
59
|
default_task :test
|
34
60
|
|
35
|
-
register Generators::App, :new, '
|
61
|
+
register Generators::App, :new, 'new [project-name]', 'Init new lopata projects'
|
36
62
|
|
37
63
|
def self.exit_on_failure?
|
38
64
|
true
|
@@ -46,8 +72,6 @@ module Lopata
|
|
46
72
|
c.load_environment
|
47
73
|
c.run_before_start_hooks
|
48
74
|
end
|
49
|
-
add_text_filter(options[:text]) if options[:text]
|
50
|
-
add_rerun_filter if options[:rerun]
|
51
75
|
end
|
52
76
|
|
53
77
|
def add_text_filter(text)
|
data/lib/lopata/scenario.rb
CHANGED
@@ -63,12 +63,12 @@ class Lopata::Scenario
|
|
63
63
|
# @private
|
64
64
|
# Scenario execution and live-cycle information
|
65
65
|
class Execution
|
66
|
-
attr_reader :scenario, :current_step, :top
|
66
|
+
attr_reader :scenario, :current_step, :top, :title, :base_metadata
|
67
67
|
|
68
68
|
def initialize(title, metadata = {})
|
69
|
-
@
|
70
|
-
@
|
71
|
-
|
69
|
+
@title = title
|
70
|
+
@base_metadata = metadata
|
71
|
+
setup
|
72
72
|
end
|
73
73
|
|
74
74
|
# Provide a human-readable representation of this class
|
@@ -82,12 +82,19 @@ class Lopata::Scenario
|
|
82
82
|
end
|
83
83
|
|
84
84
|
def run
|
85
|
+
setup unless @scenario # for second run if need
|
85
86
|
world.notify_observers(:scenario_started, self)
|
86
87
|
run_step(top)
|
87
88
|
world.notify_observers(:scenario_finished, self)
|
88
89
|
cleanup
|
89
90
|
end
|
90
91
|
|
92
|
+
def setup
|
93
|
+
@scenario = Lopata::Scenario.new(self)
|
94
|
+
@top = Lopata::GroupExecution.new(Lopata::TopStep.new(title, metadata: base_metadata), nil, steps: [])
|
95
|
+
@current_step = @top
|
96
|
+
end
|
97
|
+
|
91
98
|
def run_step(step)
|
92
99
|
@current_step = step
|
93
100
|
return :skipped if step.skipped?
|
@@ -135,10 +142,6 @@ class Lopata::Scenario
|
|
135
142
|
current_step.find_let_method(name)
|
136
143
|
end
|
137
144
|
|
138
|
-
def title
|
139
|
-
top.title
|
140
|
-
end
|
141
|
-
|
142
145
|
def status
|
143
146
|
top.status
|
144
147
|
end
|
@@ -160,7 +163,6 @@ class Lopata::Scenario
|
|
160
163
|
end
|
161
164
|
|
162
165
|
def cleanup
|
163
|
-
@title = nil
|
164
166
|
@scenario = nil
|
165
167
|
@top = nil
|
166
168
|
@current_step = nil
|
data/lib/lopata/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lopata
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.29
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexey Volochnev
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-02-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -138,5 +138,5 @@ requirements: []
|
|
138
138
|
rubygems_version: 3.2.15
|
139
139
|
signing_key:
|
140
140
|
specification_version: 4
|
141
|
-
summary: lopata-0.1.
|
141
|
+
summary: lopata-0.1.29
|
142
142
|
test_files: []
|