test_bench-bootstrap 3.0.0.0.pre.1 → 3.0.0
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/test_bench/bootstrap.rb +373 -0
- metadata +16 -353
- data/executables/bench-bootstrap +0 -7
- data/lib/test_bench_bootstrap/controls.rb +0 -1
- data/lib/test_bench_bootstrap/test_bench_bootstrap.rb +0 -7
- data/lib/test_bench_bootstrap.rb +0 -4
- data/upstream-lib/test_bench_bootstrap/import_constants/controls/namespace.rb +0 -84
- data/upstream-lib/test_bench_bootstrap/import_constants/controls.rb +0 -1
- data/upstream-lib/test_bench_bootstrap/import_constants/import_constants.rb +0 -46
- data/upstream-lib/test_bench_bootstrap/import_constants/macro.rb +0 -10
- data/upstream-lib/test_bench_bootstrap/import_constants.rb +0 -2
- data/upstream-lib/test_bench_bootstrap/test_bench/controls/telemetry_sink.rb +0 -7
- data/upstream-lib/test_bench_bootstrap/test_bench/controls.rb +0 -3
- data/upstream-lib/test_bench_bootstrap/test_bench/executable/controls/path.rb +0 -9
- data/upstream-lib/test_bench_bootstrap/test_bench/executable/controls/random.rb +0 -9
- data/upstream-lib/test_bench_bootstrap/test_bench/executable/controls/run.rb +0 -12
- data/upstream-lib/test_bench_bootstrap/test_bench/executable/controls/standard_input.rb +0 -31
- data/upstream-lib/test_bench_bootstrap/test_bench/executable/controls.rb +0 -8
- data/upstream-lib/test_bench_bootstrap/test_bench/executable/defaults.rb +0 -15
- data/upstream-lib/test_bench_bootstrap/test_bench/executable/executable.rb +0 -61
- data/upstream-lib/test_bench_bootstrap/test_bench/executable/parse_arguments.rb +0 -271
- data/upstream-lib/test_bench_bootstrap/test_bench/executable.rb +0 -7
- data/upstream-lib/test_bench_bootstrap/test_bench/fixture/build.rb +0 -41
- data/upstream-lib/test_bench_bootstrap/test_bench/fixture/controls/comment_style.rb +0 -9
- data/upstream-lib/test_bench_bootstrap/test_bench/fixture/controls/exception.rb +0 -9
- data/upstream-lib/test_bench_bootstrap/test_bench/fixture/controls/fixture.rb +0 -69
- data/upstream-lib/test_bench_bootstrap/test_bench/fixture/controls/message.rb +0 -9
- data/upstream-lib/test_bench_bootstrap/test_bench/fixture/controls/output.rb +0 -11
- data/upstream-lib/test_bench_bootstrap/test_bench/fixture/controls/path.rb +0 -9
- data/upstream-lib/test_bench_bootstrap/test_bench/fixture/controls/session.rb +0 -21
- data/upstream-lib/test_bench_bootstrap/test_bench/fixture/controls/status.rb +0 -9
- data/upstream-lib/test_bench_bootstrap/test_bench/fixture/controls/text.rb +0 -9
- data/upstream-lib/test_bench_bootstrap/test_bench/fixture/controls/title.rb +0 -9
- data/upstream-lib/test_bench_bootstrap/test_bench/fixture/controls.rb +0 -14
- data/upstream-lib/test_bench_bootstrap/test_bench/fixture/evaluate.rb +0 -37
- data/upstream-lib/test_bench_bootstrap/test_bench/fixture/fixture.rb +0 -213
- data/upstream-lib/test_bench_bootstrap/test_bench/fixture.rb +0 -7
- data/upstream-lib/test_bench_bootstrap/test_bench/output/comment_style.rb +0 -63
- data/upstream-lib/test_bench_bootstrap/test_bench/output/controls/comment_style.rb +0 -23
- data/upstream-lib/test_bench_bootstrap/test_bench/output/controls/event.rb +0 -9
- data/upstream-lib/test_bench_bootstrap/test_bench/output/controls/events/aborted.rb +0 -11
- data/upstream-lib/test_bench_bootstrap/test_bench/output/controls/events/commented.rb +0 -23
- data/upstream-lib/test_bench_bootstrap/test_bench/output/controls/events/context_finished.rb +0 -11
- data/upstream-lib/test_bench_bootstrap/test_bench/output/controls/events/context_started.rb +0 -11
- data/upstream-lib/test_bench_bootstrap/test_bench/output/controls/events/detailed.rb +0 -23
- data/upstream-lib/test_bench_bootstrap/test_bench/output/controls/events/failed.rb +0 -11
- data/upstream-lib/test_bench_bootstrap/test_bench/output/controls/events/file_executed.rb +0 -11
- data/upstream-lib/test_bench_bootstrap/test_bench/output/controls/events/file_not_found.rb +0 -11
- data/upstream-lib/test_bench_bootstrap/test_bench/output/controls/events/file_queued.rb +0 -11
- data/upstream-lib/test_bench_bootstrap/test_bench/output/controls/events/skipped.rb +0 -11
- data/upstream-lib/test_bench_bootstrap/test_bench/output/controls/events/test_finished.rb +0 -11
- data/upstream-lib/test_bench_bootstrap/test_bench/output/controls/events/test_started.rb +0 -11
- data/upstream-lib/test_bench_bootstrap/test_bench/output/controls/random.rb +0 -9
- data/upstream-lib/test_bench_bootstrap/test_bench/output/controls/session.rb +0 -19
- data/upstream-lib/test_bench_bootstrap/test_bench/output/controls/status.rb +0 -9
- data/upstream-lib/test_bench_bootstrap/test_bench/output/controls/style.rb +0 -41
- data/upstream-lib/test_bench_bootstrap/test_bench/output/controls/text.rb +0 -31
- data/upstream-lib/test_bench_bootstrap/test_bench/output/controls.rb +0 -26
- data/upstream-lib/test_bench_bootstrap/test_bench/output/detail_policy.rb +0 -46
- data/upstream-lib/test_bench_bootstrap/test_bench/output/device/null.rb +0 -21
- data/upstream-lib/test_bench_bootstrap/test_bench/output/device/substitute.rb +0 -46
- data/upstream-lib/test_bench_bootstrap/test_bench/output/device.rb +0 -75
- data/upstream-lib/test_bench_bootstrap/test_bench/output/get.rb +0 -32
- data/upstream-lib/test_bench_bootstrap/test_bench/output/level.rb +0 -53
- data/upstream-lib/test_bench_bootstrap/test_bench/output/output.rb +0 -572
- data/upstream-lib/test_bench_bootstrap/test_bench/output/writer/style.rb +0 -54
- data/upstream-lib/test_bench_bootstrap/test_bench/output/writer/substitute.rb +0 -27
- data/upstream-lib/test_bench_bootstrap/test_bench/output/writer.rb +0 -119
- data/upstream-lib/test_bench_bootstrap/test_bench/output.rb +0 -20
- data/upstream-lib/test_bench_bootstrap/test_bench/random/controls/seed.rb +0 -25
- data/upstream-lib/test_bench_bootstrap/test_bench/random/controls/sequence.rb +0 -70
- data/upstream-lib/test_bench_bootstrap/test_bench/random/controls.rb +0 -2
- data/upstream-lib/test_bench_bootstrap/test_bench/random/defaults.rb +0 -13
- data/upstream-lib/test_bench_bootstrap/test_bench/random/generator/substitute.rb +0 -23
- data/upstream-lib/test_bench_bootstrap/test_bench/random/generator.rb +0 -64
- data/upstream-lib/test_bench_bootstrap/test_bench/random/iterator.rb +0 -54
- data/upstream-lib/test_bench_bootstrap/test_bench/random/random.rb +0 -27
- data/upstream-lib/test_bench_bootstrap/test_bench/random.rb +0 -8
- data/upstream-lib/test_bench_bootstrap/test_bench/run/controls/events.rb +0 -9
- data/upstream-lib/test_bench_bootstrap/test_bench/run/controls/message.rb +0 -9
- data/upstream-lib/test_bench_bootstrap/test_bench/run/controls/path.rb +0 -9
- data/upstream-lib/test_bench_bootstrap/test_bench/run/controls/random.rb +0 -9
- data/upstream-lib/test_bench_bootstrap/test_bench/run/controls/session.rb +0 -16
- data/upstream-lib/test_bench_bootstrap/test_bench/run/controls/status.rb +0 -44
- data/upstream-lib/test_bench_bootstrap/test_bench/run/controls/summary/file/info.rb +0 -108
- data/upstream-lib/test_bench_bootstrap/test_bench/run/controls/summary/file/totals.rb +0 -38
- data/upstream-lib/test_bench_bootstrap/test_bench/run/controls/summary/file.rb +0 -44
- data/upstream-lib/test_bench_bootstrap/test_bench/run/controls/summary/run.rb +0 -53
- data/upstream-lib/test_bench_bootstrap/test_bench/run/controls/summary.rb +0 -45
- data/upstream-lib/test_bench_bootstrap/test_bench/run/controls/telemetry.rb +0 -11
- data/upstream-lib/test_bench_bootstrap/test_bench/run/controls/time.rb +0 -9
- data/upstream-lib/test_bench_bootstrap/test_bench/run/controls.rb +0 -20
- data/upstream-lib/test_bench_bootstrap/test_bench/run/run.rb +0 -146
- data/upstream-lib/test_bench_bootstrap/test_bench/run/select_files/substitute.rb +0 -45
- data/upstream-lib/test_bench_bootstrap/test_bench/run/select_files.rb +0 -70
- data/upstream-lib/test_bench_bootstrap/test_bench/run/substitute.rb +0 -42
- data/upstream-lib/test_bench_bootstrap/test_bench/run/summary/substitute.rb +0 -19
- data/upstream-lib/test_bench_bootstrap/test_bench/run/summary.rb +0 -477
- data/upstream-lib/test_bench_bootstrap/test_bench/run.rb +0 -10
- data/upstream-lib/test_bench_bootstrap/test_bench/session/controls/backtrace/location.rb +0 -48
- data/upstream-lib/test_bench_bootstrap/test_bench/session/controls/backtrace.rb +0 -83
- data/upstream-lib/test_bench_bootstrap/test_bench/session/controls/comment_disposition.rb +0 -17
- data/upstream-lib/test_bench_bootstrap/test_bench/session/controls/event.rb +0 -35
- data/upstream-lib/test_bench_bootstrap/test_bench/session/controls/events/aborted.rb +0 -51
- data/upstream-lib/test_bench_bootstrap/test_bench/session/controls/events/commented.rb +0 -62
- data/upstream-lib/test_bench_bootstrap/test_bench/session/controls/events/context_finished.rb +0 -112
- data/upstream-lib/test_bench_bootstrap/test_bench/session/controls/events/context_started.rb +0 -51
- data/upstream-lib/test_bench_bootstrap/test_bench/session/controls/events/detailed.rb +0 -62
- data/upstream-lib/test_bench_bootstrap/test_bench/session/controls/events/failed.rb +0 -41
- data/upstream-lib/test_bench_bootstrap/test_bench/session/controls/events/file_executed.rb +0 -101
- data/upstream-lib/test_bench_bootstrap/test_bench/session/controls/events/file_not_found.rb +0 -41
- data/upstream-lib/test_bench_bootstrap/test_bench/session/controls/events/file_queued.rb +0 -41
- data/upstream-lib/test_bench_bootstrap/test_bench/session/controls/events/skipped.rb +0 -51
- data/upstream-lib/test_bench_bootstrap/test_bench/session/controls/events/test_finished.rb +0 -92
- data/upstream-lib/test_bench_bootstrap/test_bench/session/controls/events/test_started.rb +0 -51
- data/upstream-lib/test_bench_bootstrap/test_bench/session/controls/events.rb +0 -35
- data/upstream-lib/test_bench_bootstrap/test_bench/session/controls/exception/message.rb +0 -23
- data/upstream-lib/test_bench_bootstrap/test_bench/session/controls/exception/raise.rb +0 -52
- data/upstream-lib/test_bench_bootstrap/test_bench/session/controls/exception.rb +0 -81
- data/upstream-lib/test_bench_bootstrap/test_bench/session/controls/message.rb +0 -43
- data/upstream-lib/test_bench_bootstrap/test_bench/session/controls/metadata.rb +0 -9
- data/upstream-lib/test_bench_bootstrap/test_bench/session/controls/path/apex_directory.rb +0 -76
- data/upstream-lib/test_bench_bootstrap/test_bench/session/controls/path/file/create.rb +0 -113
- data/upstream-lib/test_bench_bootstrap/test_bench/session/controls/path/file.rb +0 -42
- data/upstream-lib/test_bench_bootstrap/test_bench/session/controls/path.rb +0 -87
- data/upstream-lib/test_bench_bootstrap/test_bench/session/controls/random.rb +0 -9
- data/upstream-lib/test_bench_bootstrap/test_bench/session/controls/result.rb +0 -17
- data/upstream-lib/test_bench_bootstrap/test_bench/session/controls/sequence.rb +0 -13
- data/upstream-lib/test_bench_bootstrap/test_bench/session/controls/status.rb +0 -92
- data/upstream-lib/test_bench_bootstrap/test_bench/session/controls/telemetry.rb +0 -15
- data/upstream-lib/test_bench_bootstrap/test_bench/session/controls/telemetry_sink.rb +0 -37
- data/upstream-lib/test_bench_bootstrap/test_bench/session/controls/text.rb +0 -33
- data/upstream-lib/test_bench_bootstrap/test_bench/session/controls/title.rb +0 -41
- data/upstream-lib/test_bench_bootstrap/test_bench/session/controls.rb +0 -43
- data/upstream-lib/test_bench_bootstrap/test_bench/session/defaults.rb +0 -17
- data/upstream-lib/test_bench_bootstrap/test_bench/session/events.rb +0 -24
- data/upstream-lib/test_bench_bootstrap/test_bench/session/exception/format_backtrace/substitute.rb +0 -34
- data/upstream-lib/test_bench_bootstrap/test_bench/session/exception/format_backtrace.rb +0 -114
- data/upstream-lib/test_bench_bootstrap/test_bench/session/isolate/substitute.rb +0 -45
- data/upstream-lib/test_bench_bootstrap/test_bench/session/isolate.rb +0 -159
- data/upstream-lib/test_bench_bootstrap/test_bench/session/result.rb +0 -44
- data/upstream-lib/test_bench_bootstrap/test_bench/session/session.rb +0 -236
- data/upstream-lib/test_bench_bootstrap/test_bench/session/status.rb +0 -60
- data/upstream-lib/test_bench_bootstrap/test_bench/session/substitute/sink.rb +0 -99
- data/upstream-lib/test_bench_bootstrap/test_bench/session/substitute.rb +0 -154
- data/upstream-lib/test_bench_bootstrap/test_bench/session/trace.rb +0 -53
- data/upstream-lib/test_bench_bootstrap/test_bench/session.rb +0 -22
- data/upstream-lib/test_bench_bootstrap/test_bench/telemetry/controls/event/metadata.rb +0 -72
- data/upstream-lib/test_bench_bootstrap/test_bench/telemetry/controls/event.rb +0 -156
- data/upstream-lib/test_bench_bootstrap/test_bench/telemetry/controls/event_data.rb +0 -113
- data/upstream-lib/test_bench_bootstrap/test_bench/telemetry/controls/handler.rb +0 -83
- data/upstream-lib/test_bench_bootstrap/test_bench/telemetry/controls/path/file.rb +0 -39
- data/upstream-lib/test_bench_bootstrap/test_bench/telemetry/controls/process_id.rb +0 -25
- data/upstream-lib/test_bench_bootstrap/test_bench/telemetry/controls/random.rb +0 -11
- data/upstream-lib/test_bench_bootstrap/test_bench/telemetry/controls/sink.rb +0 -35
- data/upstream-lib/test_bench_bootstrap/test_bench/telemetry/controls/time.rb +0 -104
- data/upstream-lib/test_bench_bootstrap/test_bench/telemetry/controls.rb +0 -16
- data/upstream-lib/test_bench_bootstrap/test_bench/telemetry/event.rb +0 -130
- data/upstream-lib/test_bench_bootstrap/test_bench/telemetry/event_data/serialization.rb +0 -85
- data/upstream-lib/test_bench_bootstrap/test_bench/telemetry/event_data.rb +0 -15
- data/upstream-lib/test_bench_bootstrap/test_bench/telemetry/sink/file.rb +0 -39
- data/upstream-lib/test_bench_bootstrap/test_bench/telemetry/sink/handler/event_registry.rb +0 -44
- data/upstream-lib/test_bench_bootstrap/test_bench/telemetry/sink/handler.rb +0 -128
- data/upstream-lib/test_bench_bootstrap/test_bench/telemetry/sink.rb +0 -13
- data/upstream-lib/test_bench_bootstrap/test_bench/telemetry/substitute/sink.rb +0 -71
- data/upstream-lib/test_bench_bootstrap/test_bench/telemetry/substitute.rb +0 -43
- data/upstream-lib/test_bench_bootstrap/test_bench/telemetry/telemetry.rb +0 -92
- data/upstream-lib/test_bench_bootstrap/test_bench/telemetry.rb +0 -18
- data/upstream-lib/test_bench_bootstrap/test_bench/test_bench.rb +0 -72
- data/upstream-lib/test_bench_bootstrap/test_bench.rb +0 -4
@@ -1,477 +0,0 @@
|
|
1
|
-
module TestBenchBootstrap
|
2
|
-
module TestBench
|
3
|
-
class Run
|
4
|
-
class Summary
|
5
|
-
include Telemetry::Sink::Handler
|
6
|
-
include ImportConstants
|
7
|
-
|
8
|
-
import_constants Session::Events
|
9
|
-
|
10
|
-
def writer
|
11
|
-
@writer ||= Output::Writer::Substitute.build
|
12
|
-
end
|
13
|
-
attr_writer :writer
|
14
|
-
|
15
|
-
def status
|
16
|
-
@status ||= Session::Status.initial
|
17
|
-
end
|
18
|
-
attr_writer :status
|
19
|
-
|
20
|
-
def file_totals
|
21
|
-
@file_totals ||= FileTotals.initial
|
22
|
-
end
|
23
|
-
attr_writer :file_totals
|
24
|
-
|
25
|
-
def files
|
26
|
-
@files ||= {}
|
27
|
-
end
|
28
|
-
attr_writer :files
|
29
|
-
|
30
|
-
def file_stack
|
31
|
-
@file_stack ||= FileStack.new
|
32
|
-
end
|
33
|
-
|
34
|
-
attr_accessor :start_time
|
35
|
-
|
36
|
-
def self.build(styling: nil, device: nil)
|
37
|
-
instance = new
|
38
|
-
|
39
|
-
instance.start_time = ::Time.now
|
40
|
-
|
41
|
-
Output::Writer.configure(instance, styling:, device:)
|
42
|
-
|
43
|
-
instance
|
44
|
-
end
|
45
|
-
|
46
|
-
def self.configure(receiver, styling: nil, device: nil, attr_name: nil)
|
47
|
-
attr_name ||= :summary
|
48
|
-
|
49
|
-
instance = build(styling:, device:)
|
50
|
-
receiver.public_send(:"#{attr_name}=", instance)
|
51
|
-
end
|
52
|
-
|
53
|
-
handle Failed do |failed|
|
54
|
-
status.update(failed)
|
55
|
-
|
56
|
-
if current_file?
|
57
|
-
current_file.update(failed)
|
58
|
-
end
|
59
|
-
end
|
60
|
-
|
61
|
-
handle Aborted do |aborted|
|
62
|
-
status.update(aborted)
|
63
|
-
|
64
|
-
if current_file?
|
65
|
-
current_file.update(aborted)
|
66
|
-
end
|
67
|
-
end
|
68
|
-
|
69
|
-
handle Skipped do |skipped|
|
70
|
-
status.update(skipped)
|
71
|
-
|
72
|
-
if current_file?
|
73
|
-
current_file.update(skipped)
|
74
|
-
end
|
75
|
-
end
|
76
|
-
|
77
|
-
handle TestFinished do |test_finished|
|
78
|
-
status.update(test_finished)
|
79
|
-
|
80
|
-
if current_file?
|
81
|
-
current_file.update(test_finished)
|
82
|
-
end
|
83
|
-
end
|
84
|
-
|
85
|
-
handle FileQueued do |file_queued|
|
86
|
-
file_totals.record_file_queued
|
87
|
-
|
88
|
-
path = file_queued.file
|
89
|
-
|
90
|
-
file_info = FileInfo.initial(path)
|
91
|
-
add_file(file_info)
|
92
|
-
|
93
|
-
file_stack.push(path)
|
94
|
-
end
|
95
|
-
|
96
|
-
handle FileExecuted do |file_executed|
|
97
|
-
result = file_executed.result
|
98
|
-
|
99
|
-
case result
|
100
|
-
when Session::Result.aborted
|
101
|
-
file_totals.record_file_aborted
|
102
|
-
else
|
103
|
-
file_totals.record_file_completed
|
104
|
-
|
105
|
-
if result == Session::Result.passed
|
106
|
-
file_path = file_executed.file
|
107
|
-
files.delete(file_path)
|
108
|
-
end
|
109
|
-
end
|
110
|
-
|
111
|
-
file_stack.pop
|
112
|
-
end
|
113
|
-
|
114
|
-
handle FileNotFound do |file_not_found|
|
115
|
-
file_totals.record_file_not_found
|
116
|
-
|
117
|
-
path = file_not_found.file
|
118
|
-
|
119
|
-
file_info = FileInfo.not_found(path)
|
120
|
-
add_file(file_info)
|
121
|
-
|
122
|
-
status.update(file_not_found)
|
123
|
-
end
|
124
|
-
|
125
|
-
def print(finish_time=nil)
|
126
|
-
finish_time ||= ::Time.now
|
127
|
-
|
128
|
-
if not start_time.nil?
|
129
|
-
elapsed_time = finish_time - start_time
|
130
|
-
else
|
131
|
-
elapsed_time = 0.0
|
132
|
-
end
|
133
|
-
|
134
|
-
tests_per_second = status.test_sequence / elapsed_time
|
135
|
-
|
136
|
-
if files.any?
|
137
|
-
none_failed = files.each_value.none?(&:failed?)
|
138
|
-
|
139
|
-
if writer.styling?
|
140
|
-
writer.
|
141
|
-
style(:bold, :underline)
|
142
|
-
|
143
|
-
if not none_failed
|
144
|
-
writer.style(:red)
|
145
|
-
end
|
146
|
-
end
|
147
|
-
|
148
|
-
writer.puts("File Summary")
|
149
|
-
|
150
|
-
if not writer.styling?
|
151
|
-
writer.puts("- - -")
|
152
|
-
end
|
153
|
-
|
154
|
-
files.each_value do |file_info|
|
155
|
-
if file_info.failed?
|
156
|
-
writer.style(:red)
|
157
|
-
end
|
158
|
-
|
159
|
-
writer.
|
160
|
-
style(:faint).
|
161
|
-
print('-').
|
162
|
-
style(:reset_intensity).
|
163
|
-
print(' ').
|
164
|
-
style(:bold).
|
165
|
-
print(file_info.file_path).
|
166
|
-
style(:reset_intensity).
|
167
|
-
print(': ')
|
168
|
-
|
169
|
-
separator = false
|
170
|
-
|
171
|
-
if file_info.not_found?
|
172
|
-
writer.
|
173
|
-
puts('file not found').
|
174
|
-
puts
|
175
|
-
|
176
|
-
next
|
177
|
-
end
|
178
|
-
|
179
|
-
if not file_info.tests?
|
180
|
-
if not file_info.failed?
|
181
|
-
writer.style(:faint, :italic)
|
182
|
-
end
|
183
|
-
|
184
|
-
writer.print('no tests')
|
185
|
-
|
186
|
-
if not file_info.failed?
|
187
|
-
writer.style(:reset_italic, :reset_intensity)
|
188
|
-
end
|
189
|
-
|
190
|
-
separator = true
|
191
|
-
end
|
192
|
-
|
193
|
-
if file_info.failures?
|
194
|
-
writer.print(', ') if separator
|
195
|
-
writer.print(file_info.failures)
|
196
|
-
|
197
|
-
separator = true
|
198
|
-
end
|
199
|
-
|
200
|
-
if file_info.skipped?
|
201
|
-
writer.print(', ') if separator
|
202
|
-
|
203
|
-
if not file_info.failed?
|
204
|
-
writer.style(:bold, :yellow)
|
205
|
-
end
|
206
|
-
|
207
|
-
writer.print(file_info.skipped)
|
208
|
-
|
209
|
-
separator = true
|
210
|
-
end
|
211
|
-
|
212
|
-
if file_info.errors?
|
213
|
-
writer.print(', ') if separator
|
214
|
-
|
215
|
-
writer.print(file_info.errors)
|
216
|
-
|
217
|
-
separator = true
|
218
|
-
end
|
219
|
-
|
220
|
-
writer.puts
|
221
|
-
|
222
|
-
writer.increase_indentation
|
223
|
-
|
224
|
-
file_info.aborted_events.each_with_index do |aborted, index|
|
225
|
-
message = aborted.message
|
226
|
-
location = aborted.location
|
227
|
-
|
228
|
-
if not index.zero?
|
229
|
-
writer.puts
|
230
|
-
end
|
231
|
-
|
232
|
-
writer.
|
233
|
-
indent.
|
234
|
-
style(:red).
|
235
|
-
puts(message)
|
236
|
-
|
237
|
-
writer.
|
238
|
-
indent.
|
239
|
-
style(:red).
|
240
|
-
puts(location)
|
241
|
-
end
|
242
|
-
|
243
|
-
writer.decrease_indentation
|
244
|
-
|
245
|
-
writer.puts
|
246
|
-
end
|
247
|
-
end
|
248
|
-
|
249
|
-
writer.
|
250
|
-
print("Attempted %s: %s, " % [file_totals.attempted, file_totals.completed])
|
251
|
-
|
252
|
-
if file_totals.aborted?
|
253
|
-
writer.style(:bold, :red)
|
254
|
-
end
|
255
|
-
|
256
|
-
writer.print("%s" % file_totals.aborted)
|
257
|
-
|
258
|
-
if file_totals.aborted?
|
259
|
-
writer.style(:reset_fg, :reset_intensity)
|
260
|
-
end
|
261
|
-
|
262
|
-
writer.print(', ')
|
263
|
-
|
264
|
-
if file_totals.not_found?
|
265
|
-
writer.style(:red)
|
266
|
-
end
|
267
|
-
|
268
|
-
writer.puts("%s" % file_totals.not_found)
|
269
|
-
|
270
|
-
writer.
|
271
|
-
puts("%i test#{'s' if status.test_sequence != 1} in %0.2f seconds (%0.2f tests/sec)" % [status.test_sequence, elapsed_time, tests_per_second])
|
272
|
-
|
273
|
-
if status.test_sequence.zero?
|
274
|
-
writer.
|
275
|
-
style(:faint, :italic).
|
276
|
-
print('0 passed').
|
277
|
-
style(:reset_italic, :reset_intensity)
|
278
|
-
|
279
|
-
else
|
280
|
-
passed_tests = status.test_sequence - status.failure_sequence
|
281
|
-
|
282
|
-
writer.
|
283
|
-
style(:green).
|
284
|
-
print("%i passed" % passed_tests).
|
285
|
-
style(:reset_fg)
|
286
|
-
end
|
287
|
-
|
288
|
-
writer.print(', ')
|
289
|
-
|
290
|
-
if status.failure_sequence.zero?
|
291
|
-
writer.print('0 failed')
|
292
|
-
else
|
293
|
-
writer.
|
294
|
-
style(:bold, :red).
|
295
|
-
print("%i failed" % status.failure_sequence).
|
296
|
-
style(:reset_fg, :reset_intensity)
|
297
|
-
end
|
298
|
-
|
299
|
-
writer.print(', ')
|
300
|
-
|
301
|
-
if status.skip_sequence.zero?
|
302
|
-
writer.print('0 skipped')
|
303
|
-
else
|
304
|
-
writer.
|
305
|
-
style(:yellow).
|
306
|
-
print("%i+ skipped" % status.skip_sequence)
|
307
|
-
end
|
308
|
-
|
309
|
-
2.times do
|
310
|
-
writer.puts
|
311
|
-
end
|
312
|
-
end
|
313
|
-
|
314
|
-
def add_file(file_info)
|
315
|
-
file_path = file_info.file_path
|
316
|
-
|
317
|
-
files[file_path] = file_info
|
318
|
-
end
|
319
|
-
|
320
|
-
def current_file
|
321
|
-
current_file_path = file_stack.current_file
|
322
|
-
|
323
|
-
files[current_file_path]
|
324
|
-
end
|
325
|
-
|
326
|
-
def current_file?
|
327
|
-
file_stack.current_file?
|
328
|
-
end
|
329
|
-
|
330
|
-
class FileStack
|
331
|
-
def entries
|
332
|
-
@entries ||= []
|
333
|
-
end
|
334
|
-
attr_writer :entries
|
335
|
-
|
336
|
-
def push(file_path)
|
337
|
-
entries.push(file_path)
|
338
|
-
end
|
339
|
-
|
340
|
-
def pop
|
341
|
-
entries.pop
|
342
|
-
end
|
343
|
-
|
344
|
-
def current_file?
|
345
|
-
!entries.empty?
|
346
|
-
end
|
347
|
-
|
348
|
-
def current_file
|
349
|
-
entries.last
|
350
|
-
end
|
351
|
-
end
|
352
|
-
|
353
|
-
FileInfo = Struct.new(:file_path, :status, :aborted_events, :not_found) do
|
354
|
-
def self.initial(file_path)
|
355
|
-
status = Session::Status.initial
|
356
|
-
|
357
|
-
aborted_events = []
|
358
|
-
|
359
|
-
new(file_path, status, aborted_events)
|
360
|
-
end
|
361
|
-
|
362
|
-
def self.not_found(file_path)
|
363
|
-
instance = new(file_path)
|
364
|
-
instance.not_found = true
|
365
|
-
instance
|
366
|
-
end
|
367
|
-
|
368
|
-
def update(event)
|
369
|
-
status.update(event)
|
370
|
-
|
371
|
-
if event in Aborted => aborted
|
372
|
-
self.aborted_events << aborted
|
373
|
-
end
|
374
|
-
end
|
375
|
-
|
376
|
-
def failed?
|
377
|
-
if not_found?
|
378
|
-
return true
|
379
|
-
end
|
380
|
-
|
381
|
-
case status.result
|
382
|
-
when Session::Result.failed, Session::Result.aborted
|
383
|
-
true
|
384
|
-
else
|
385
|
-
false
|
386
|
-
end
|
387
|
-
end
|
388
|
-
|
389
|
-
def tests?
|
390
|
-
status.test_sequence > 0
|
391
|
-
end
|
392
|
-
|
393
|
-
def failures?
|
394
|
-
status.failure_sequence > 0
|
395
|
-
end
|
396
|
-
|
397
|
-
def failures
|
398
|
-
failures = status.failure_sequence
|
399
|
-
|
400
|
-
"%i failure#{'s' if failures != 1}" % failures
|
401
|
-
end
|
402
|
-
|
403
|
-
def skipped?
|
404
|
-
status.skip_sequence > 0
|
405
|
-
end
|
406
|
-
|
407
|
-
def skipped
|
408
|
-
skipped = status.skip_sequence
|
409
|
-
|
410
|
-
"%i+ skipped" % skipped
|
411
|
-
end
|
412
|
-
|
413
|
-
def errors?
|
414
|
-
aborted_events.any?
|
415
|
-
end
|
416
|
-
|
417
|
-
def errors
|
418
|
-
errors = aborted_events.count
|
419
|
-
|
420
|
-
"%i error#{'s' if errors != 1}:" % errors
|
421
|
-
end
|
422
|
-
|
423
|
-
def not_found?
|
424
|
-
not_found ? true : false
|
425
|
-
end
|
426
|
-
end
|
427
|
-
|
428
|
-
FileTotals = Struct.new(:attempted_count, :completed_count, :aborted_count, :not_found_count) do
|
429
|
-
def self.initial
|
430
|
-
new(0, 0, 0, 0)
|
431
|
-
end
|
432
|
-
|
433
|
-
def record_file_queued
|
434
|
-
self.attempted_count += 1
|
435
|
-
end
|
436
|
-
|
437
|
-
def record_file_completed
|
438
|
-
self.completed_count += 1
|
439
|
-
end
|
440
|
-
|
441
|
-
def record_file_aborted
|
442
|
-
self.aborted_count += 1
|
443
|
-
end
|
444
|
-
|
445
|
-
def record_file_not_found
|
446
|
-
self.attempted_count += 1
|
447
|
-
self.not_found_count += 1
|
448
|
-
end
|
449
|
-
|
450
|
-
def attempted
|
451
|
-
"%i file#{'s' if attempted_count != 1}" % attempted_count
|
452
|
-
end
|
453
|
-
|
454
|
-
def completed
|
455
|
-
"%i completed" % completed_count
|
456
|
-
end
|
457
|
-
|
458
|
-
def aborted?
|
459
|
-
aborted_count > 0
|
460
|
-
end
|
461
|
-
|
462
|
-
def aborted
|
463
|
-
"%i aborted" % aborted_count
|
464
|
-
end
|
465
|
-
|
466
|
-
def not_found?
|
467
|
-
not_found_count > 0
|
468
|
-
end
|
469
|
-
|
470
|
-
def not_found
|
471
|
-
"%i not found" % not_found_count
|
472
|
-
end
|
473
|
-
end
|
474
|
-
end
|
475
|
-
end
|
476
|
-
end
|
477
|
-
end
|
@@ -1,10 +0,0 @@
|
|
1
|
-
require 'test_bench_bootstrap/test_bench/output'
|
2
|
-
|
3
|
-
require 'test_bench_bootstrap/test_bench/run/select_files'
|
4
|
-
require 'test_bench_bootstrap/test_bench/run/select_files/substitute'
|
5
|
-
|
6
|
-
require 'test_bench_bootstrap/test_bench/run/summary'
|
7
|
-
require 'test_bench_bootstrap/test_bench/run/summary/substitute'
|
8
|
-
|
9
|
-
require 'test_bench_bootstrap/test_bench/run/run'
|
10
|
-
require 'test_bench_bootstrap/test_bench/run/substitute'
|
@@ -1,48 +0,0 @@
|
|
1
|
-
module TestBenchBootstrap
|
2
|
-
module TestBench
|
3
|
-
class Session
|
4
|
-
module Controls
|
5
|
-
module Backtrace
|
6
|
-
module Location
|
7
|
-
def self.example(index=nil, backtrace: nil)
|
8
|
-
index ||= 0
|
9
|
-
backtrace ||= self.backtrace
|
10
|
-
|
11
|
-
file, line_number, _ = backtrace[index].split(':', 3)
|
12
|
-
|
13
|
-
"#{file}:#{line_number}"
|
14
|
-
end
|
15
|
-
|
16
|
-
def self.backtrace
|
17
|
-
Exception::Example.backtrace
|
18
|
-
end
|
19
|
-
|
20
|
-
def self.other_example
|
21
|
-
example(1)
|
22
|
-
end
|
23
|
-
|
24
|
-
module AbsolutePath
|
25
|
-
def self.example(index=nil)
|
26
|
-
Location.example(index, backtrace:)
|
27
|
-
end
|
28
|
-
|
29
|
-
def self.backtrace
|
30
|
-
Exception::AbsolutePaths::Example.backtrace
|
31
|
-
end
|
32
|
-
|
33
|
-
module Local
|
34
|
-
def self.example(index=nil)
|
35
|
-
Location.example(index, backtrace:)
|
36
|
-
end
|
37
|
-
|
38
|
-
def self.backtrace
|
39
|
-
Backtrace::AbsolutePaths::Local.backtrace
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
@@ -1,83 +0,0 @@
|
|
1
|
-
module TestBenchBootstrap
|
2
|
-
module TestBench
|
3
|
-
class Session
|
4
|
-
module Controls
|
5
|
-
module Backtrace
|
6
|
-
def self.example
|
7
|
-
[
|
8
|
-
Exception::Example.backtrace.first,
|
9
|
-
"*omitted*",
|
10
|
-
Exception::Example.backtrace.last
|
11
|
-
]
|
12
|
-
end
|
13
|
-
|
14
|
-
def self.pattern
|
15
|
-
Pattern.example
|
16
|
-
end
|
17
|
-
|
18
|
-
def self.location
|
19
|
-
Location.example
|
20
|
-
end
|
21
|
-
|
22
|
-
module Pattern
|
23
|
-
def self.example
|
24
|
-
'*/some-subdir/*'
|
25
|
-
end
|
26
|
-
|
27
|
-
def self.other_example
|
28
|
-
'*/some-other-subdir/*'
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
module Styling
|
33
|
-
def self.example
|
34
|
-
[
|
35
|
-
Exception::Example.backtrace.first,
|
36
|
-
"\e[2;3m*omitted*\e[23;22m",
|
37
|
-
Exception::Example.backtrace.last
|
38
|
-
]
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
module Cause
|
43
|
-
def self.example
|
44
|
-
[
|
45
|
-
Exception::Cause::Example.backtrace.first,
|
46
|
-
"*omitted*",
|
47
|
-
Exception::Cause::Example.backtrace.last
|
48
|
-
]
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
module AbsolutePaths
|
53
|
-
def self.example
|
54
|
-
Exception::AbsolutePaths::Example.backtrace
|
55
|
-
end
|
56
|
-
|
57
|
-
module Local
|
58
|
-
def self.example
|
59
|
-
backtrace = self.backtrace
|
60
|
-
|
61
|
-
[
|
62
|
-
backtrace.first,
|
63
|
-
"*omitted*",
|
64
|
-
backtrace.last
|
65
|
-
]
|
66
|
-
end
|
67
|
-
|
68
|
-
def self.backtrace
|
69
|
-
Exception::AbsolutePaths::Example.backtrace_locations.map do |backtrace_location|
|
70
|
-
backtrace_location.to_s.delete_prefix(::File.join(apex_directory, ''))
|
71
|
-
end
|
72
|
-
end
|
73
|
-
|
74
|
-
def self.apex_directory
|
75
|
-
Path::ApexDirectory.tmpdir
|
76
|
-
end
|
77
|
-
end
|
78
|
-
end
|
79
|
-
end
|
80
|
-
end
|
81
|
-
end
|
82
|
-
end
|
83
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
module TestBenchBootstrap
|
2
|
-
module TestBench
|
3
|
-
class Session
|
4
|
-
module Controls
|
5
|
-
module CommentDisposition
|
6
|
-
def self.example
|
7
|
-
'some-comment-disposition'
|
8
|
-
end
|
9
|
-
|
10
|
-
def self.other_example
|
11
|
-
'some-other-comment-disposition'
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
@@ -1,35 +0,0 @@
|
|
1
|
-
module TestBenchBootstrap
|
2
|
-
module TestBench
|
3
|
-
class Session
|
4
|
-
module Controls
|
5
|
-
module Event
|
6
|
-
def self.example
|
7
|
-
Telemetry::Event.example
|
8
|
-
end
|
9
|
-
|
10
|
-
def self.event_data
|
11
|
-
Telemetry::Event.event_data
|
12
|
-
end
|
13
|
-
|
14
|
-
def self.other_example
|
15
|
-
Telemetry::Event.other_example
|
16
|
-
end
|
17
|
-
|
18
|
-
def self.random
|
19
|
-
Telemetry::Event.random
|
20
|
-
end
|
21
|
-
|
22
|
-
SomeEvent = Telemetry::Event::SomeEvent
|
23
|
-
|
24
|
-
module Pending
|
25
|
-
def self.example
|
26
|
-
SomePendingEvent.new
|
27
|
-
end
|
28
|
-
|
29
|
-
SomePendingEvent = TestBench::Telemetry::Event.define(:result)
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
@@ -1,51 +0,0 @@
|
|
1
|
-
module TestBenchBootstrap
|
2
|
-
module TestBench
|
3
|
-
class Session
|
4
|
-
module Controls
|
5
|
-
module Events
|
6
|
-
module Aborted
|
7
|
-
def self.example(message: nil, location: nil)
|
8
|
-
message ||= self.message
|
9
|
-
location ||= self.location
|
10
|
-
|
11
|
-
aborted = Session::Events::Aborted.new
|
12
|
-
|
13
|
-
aborted.message = message
|
14
|
-
aborted.location = location
|
15
|
-
|
16
|
-
aborted.metadata = Metadata.example
|
17
|
-
|
18
|
-
aborted
|
19
|
-
end
|
20
|
-
|
21
|
-
def self.message
|
22
|
-
Exception::Message.example
|
23
|
-
end
|
24
|
-
|
25
|
-
def self.location
|
26
|
-
Backtrace::Location.example
|
27
|
-
end
|
28
|
-
|
29
|
-
def self.other_example
|
30
|
-
Other.example
|
31
|
-
end
|
32
|
-
|
33
|
-
module Other
|
34
|
-
def self.example
|
35
|
-
Aborted.example(message:, location:)
|
36
|
-
end
|
37
|
-
|
38
|
-
def self.message
|
39
|
-
Message::Error.other_example
|
40
|
-
end
|
41
|
-
|
42
|
-
def self.location
|
43
|
-
Backtrace::Location.other_example
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|