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,35 +0,0 @@
|
|
1
|
-
module TestBenchBootstrap
|
2
|
-
module TestBench
|
3
|
-
class Session
|
4
|
-
module Controls
|
5
|
-
module Events
|
6
|
-
def self.examples(control_method=nil)
|
7
|
-
control_method ||= :example
|
8
|
-
|
9
|
-
[
|
10
|
-
Failed,
|
11
|
-
Aborted,
|
12
|
-
Skipped,
|
13
|
-
Commented,
|
14
|
-
Detailed,
|
15
|
-
TestStarted,
|
16
|
-
TestFinished,
|
17
|
-
ContextStarted,
|
18
|
-
ContextFinished,
|
19
|
-
FileQueued,
|
20
|
-
FileExecuted,
|
21
|
-
FileNotFound
|
22
|
-
].map do |control|
|
23
|
-
|
24
|
-
control.public_send(control_method)
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
def self.other_examples
|
29
|
-
examples(:other_example)
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
@@ -1,23 +0,0 @@
|
|
1
|
-
module TestBenchBootstrap
|
2
|
-
module TestBench
|
3
|
-
class Session
|
4
|
-
module Controls
|
5
|
-
module Exception
|
6
|
-
module Message
|
7
|
-
def self.example
|
8
|
-
exception = Example
|
9
|
-
|
10
|
-
exception.detailed_message
|
11
|
-
end
|
12
|
-
|
13
|
-
def self.other_example
|
14
|
-
exception = Other::Example
|
15
|
-
|
16
|
-
exception.detailed_message
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
@@ -1,52 +0,0 @@
|
|
1
|
-
module TestBenchBootstrap
|
2
|
-
module TestBench
|
3
|
-
class Session
|
4
|
-
module Controls
|
5
|
-
module Exception
|
6
|
-
module Raise
|
7
|
-
def self.call(exception_class, exception_message, relative: nil)
|
8
|
-
apex_directory = Path::ApexDirectory::Create.()
|
9
|
-
|
10
|
-
if Exception.const_defined?(:SomeNamespace)
|
11
|
-
Exception.send(:remove_const, :SomeNamespace)
|
12
|
-
end
|
13
|
-
|
14
|
-
file_1 = Controls::Path::File::Create.(<<~RUBY, subdirectory: :none, apex_directory:, relative:)
|
15
|
-
#{Controls::Exception}::SomeNamespace.module_exec { def self.some_method = raise #{exception_class}, #{exception_message.inspect}, caller_locations(0, 4) }
|
16
|
-
RUBY
|
17
|
-
|
18
|
-
file_2 = Controls::Path::File::Create.(<<~RUBY, basename: 'some-file', apex_directory:, relative:)
|
19
|
-
module #{Controls::Exception}::SomeNamespace
|
20
|
-
def self.some_other_method = some_method
|
21
|
-
end
|
22
|
-
RUBY
|
23
|
-
|
24
|
-
file_3 = Controls::Path::File::Create.(<<~RUBY, basename: 'some-other-file', apex_directory:, relative:)
|
25
|
-
module #{Controls::Exception}
|
26
|
-
module SomeNamespace
|
27
|
-
def self.yet_another_method = some_other_method
|
28
|
-
end
|
29
|
-
end
|
30
|
-
RUBY
|
31
|
-
|
32
|
-
file_4 = Controls::Path::File::Create.(<<~RUBY, basename: 'some-other-file', subdirectory: :none, apex_directory:, relative:)
|
33
|
-
#{[file_3, file_2, file_1].inspect}.each { |file| load file }
|
34
|
-
|
35
|
-
module #{Controls::Exception}::SomeNamespace
|
36
|
-
def self.origin = yet_another_method; origin
|
37
|
-
end
|
38
|
-
RUBY
|
39
|
-
|
40
|
-
::Dir.chdir(apex_directory) do
|
41
|
-
load file_4
|
42
|
-
end
|
43
|
-
|
44
|
-
ensure
|
45
|
-
Path::ApexDirectory::Remove.(apex_directory)
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|
@@ -1,81 +0,0 @@
|
|
1
|
-
module TestBenchBootstrap
|
2
|
-
module TestBench
|
3
|
-
class Session
|
4
|
-
module Controls
|
5
|
-
module Exception
|
6
|
-
def self.example(exception_message: nil, exception_class: nil, relative: nil)
|
7
|
-
exception_message ||= self.exception_message
|
8
|
-
exception_class ||= self.exception_class
|
9
|
-
|
10
|
-
Raise.(exception_class, exception_message, relative:)
|
11
|
-
rescue exception_class => exception
|
12
|
-
return exception
|
13
|
-
else
|
14
|
-
abort "Unreachable"
|
15
|
-
end
|
16
|
-
|
17
|
-
def self.exception_message
|
18
|
-
"Some exception"
|
19
|
-
end
|
20
|
-
|
21
|
-
def self.exception_class
|
22
|
-
SomeException
|
23
|
-
end
|
24
|
-
|
25
|
-
SomeException = Class.new(::Exception)
|
26
|
-
SomeOtherException = Class.new(::Exception)
|
27
|
-
|
28
|
-
Example = self.example
|
29
|
-
|
30
|
-
module Other
|
31
|
-
def self.example
|
32
|
-
Exception.example(exception_message:, exception_class:)
|
33
|
-
end
|
34
|
-
|
35
|
-
def self.exception_message
|
36
|
-
"Some other exception"
|
37
|
-
end
|
38
|
-
|
39
|
-
def self.exception_class
|
40
|
-
SomeOtherException
|
41
|
-
end
|
42
|
-
|
43
|
-
Example = self.example
|
44
|
-
end
|
45
|
-
|
46
|
-
module Cause
|
47
|
-
def self.example(exception_message: nil, exception_class: nil)
|
48
|
-
exception_message ||= self.exception_message
|
49
|
-
exception_class ||= self.exception_class
|
50
|
-
|
51
|
-
Raise.(exception_class, exception_message)
|
52
|
-
rescue SomeOtherException
|
53
|
-
exception = Exception.example(exception_message:, exception_class:)
|
54
|
-
return exception
|
55
|
-
else
|
56
|
-
abort "Unreachable"
|
57
|
-
end
|
58
|
-
|
59
|
-
def self.exception_message
|
60
|
-
"Some exception cause"
|
61
|
-
end
|
62
|
-
|
63
|
-
def self.exception_class
|
64
|
-
SomeOtherException
|
65
|
-
end
|
66
|
-
|
67
|
-
Example = self.example
|
68
|
-
end
|
69
|
-
|
70
|
-
module AbsolutePaths
|
71
|
-
def self.example
|
72
|
-
Exception.example(relative: false)
|
73
|
-
end
|
74
|
-
|
75
|
-
Example = self.example
|
76
|
-
end
|
77
|
-
end
|
78
|
-
end
|
79
|
-
end
|
80
|
-
end
|
81
|
-
end
|
@@ -1,43 +0,0 @@
|
|
1
|
-
module TestBenchBootstrap
|
2
|
-
module TestBench
|
3
|
-
class Session
|
4
|
-
module Controls
|
5
|
-
module Message
|
6
|
-
def self.example
|
7
|
-
"Some message"
|
8
|
-
end
|
9
|
-
|
10
|
-
module Failure
|
11
|
-
def self.example
|
12
|
-
"Some failure"
|
13
|
-
end
|
14
|
-
|
15
|
-
def self.other_example
|
16
|
-
"Some other failure"
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
module Error
|
21
|
-
def self.example
|
22
|
-
Exception::Message.example
|
23
|
-
end
|
24
|
-
|
25
|
-
def self.other_example
|
26
|
-
Exception::Message.other_example
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
module Skip
|
31
|
-
def self.example
|
32
|
-
"Some skipped test or context"
|
33
|
-
end
|
34
|
-
|
35
|
-
def self.other_example
|
36
|
-
"Some other skipped test or context"
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
@@ -1,76 +0,0 @@
|
|
1
|
-
module TestBenchBootstrap
|
2
|
-
module TestBench
|
3
|
-
class Session
|
4
|
-
module Controls
|
5
|
-
module Path
|
6
|
-
module ApexDirectory
|
7
|
-
def self.example(name=nil)
|
8
|
-
name ||= Name.example
|
9
|
-
|
10
|
-
::File.expand_path(name, tmpdir)
|
11
|
-
end
|
12
|
-
|
13
|
-
def self.tmpdir
|
14
|
-
::Dir.tmpdir
|
15
|
-
end
|
16
|
-
|
17
|
-
module Name
|
18
|
-
def self.example
|
19
|
-
'test-automated-session-controls'
|
20
|
-
end
|
21
|
-
|
22
|
-
def self.random
|
23
|
-
"#{example}-#{Random.string}"
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
module Create
|
28
|
-
def self.call(name=nil)
|
29
|
-
name ||= Name.random
|
30
|
-
|
31
|
-
apex_directory = ApexDirectory.example(name)
|
32
|
-
|
33
|
-
::Dir.mkdir(apex_directory)
|
34
|
-
|
35
|
-
if ENV.fetch('DEBUG_PATH_CONTROLS', 'off') == 'on'
|
36
|
-
warn "created directory '#{apex_directory}'"
|
37
|
-
end
|
38
|
-
|
39
|
-
apex_directory
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
module Remove
|
44
|
-
def self.call(apex_directory)
|
45
|
-
remove(apex_directory)
|
46
|
-
end
|
47
|
-
|
48
|
-
def self.remove(directory)
|
49
|
-
::Dir.each_child(directory) do |entry|
|
50
|
-
absolute_path = ::File.expand_path(entry, directory)
|
51
|
-
|
52
|
-
if ::File.directory?(absolute_path)
|
53
|
-
subdirectory = absolute_path
|
54
|
-
remove(subdirectory)
|
55
|
-
else
|
56
|
-
::File.unlink(absolute_path)
|
57
|
-
|
58
|
-
if ENV.fetch('DEBUG_PATH_CONTROLS', 'off') == 'on'
|
59
|
-
warn "removed '#{absolute_path}'"
|
60
|
-
end
|
61
|
-
end
|
62
|
-
end
|
63
|
-
|
64
|
-
::Dir.rmdir(directory)
|
65
|
-
|
66
|
-
if ENV.fetch('DEBUG_PATH_CONTROLS', 'off') == 'on'
|
67
|
-
warn "removed directory '#{directory}'"
|
68
|
-
end
|
69
|
-
end
|
70
|
-
end
|
71
|
-
end
|
72
|
-
end
|
73
|
-
end
|
74
|
-
end
|
75
|
-
end
|
76
|
-
end
|
@@ -1,113 +0,0 @@
|
|
1
|
-
module TestBenchBootstrap
|
2
|
-
module TestBench
|
3
|
-
class Session
|
4
|
-
module Controls
|
5
|
-
module Path
|
6
|
-
module File
|
7
|
-
module Create
|
8
|
-
def self.call(content=nil, basename: nil, extension: nil, directory: nil, subdirectory: nil, apex_directory: nil, relative: nil)
|
9
|
-
if relative.nil?
|
10
|
-
relative = !apex_directory.nil?
|
11
|
-
end
|
12
|
-
|
13
|
-
apex_directory ||= ::Dir.tmpdir
|
14
|
-
|
15
|
-
absolute_path = File.example(basename:, extension:, directory:, subdirectory:, apex_directory:)
|
16
|
-
|
17
|
-
relative_path = absolute_path.delete_prefix(::File.join(apex_directory, ''))
|
18
|
-
|
19
|
-
if relative
|
20
|
-
file_path = relative_path
|
21
|
-
else
|
22
|
-
file_path = absolute_path
|
23
|
-
end
|
24
|
-
|
25
|
-
content ||= "# #{file_path}\n"
|
26
|
-
|
27
|
-
segments = []
|
28
|
-
|
29
|
-
until ['.', '/'].include?(relative_path)
|
30
|
-
segments.unshift(::File.basename(relative_path))
|
31
|
-
|
32
|
-
relative_path = ::File.dirname(relative_path)
|
33
|
-
end
|
34
|
-
|
35
|
-
(1...segments.length).each do |index|
|
36
|
-
directory_segments = segments[...index]
|
37
|
-
|
38
|
-
directory = ::File.join(apex_directory, *directory_segments)
|
39
|
-
|
40
|
-
if not ::File.directory?(directory)
|
41
|
-
::Dir.mkdir(directory)
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
|
-
::File.write(absolute_path, content)
|
46
|
-
|
47
|
-
if ENV.fetch('DEBUG_PATH_CONTROLS', 'off') == 'on'
|
48
|
-
warn "created '#{absolute_path}'"
|
49
|
-
end
|
50
|
-
|
51
|
-
file_path
|
52
|
-
end
|
53
|
-
|
54
|
-
module Exception
|
55
|
-
def self.call(apex_directory: nil)
|
56
|
-
Create.(content, basename:, apex_directory:)
|
57
|
-
end
|
58
|
-
|
59
|
-
def self.basename
|
60
|
-
'some_aborting_file.rb'
|
61
|
-
end
|
62
|
-
|
63
|
-
def self.content
|
64
|
-
<<~RUBY
|
65
|
-
raise #{Controls::Exception}::Example
|
66
|
-
RUBY
|
67
|
-
end
|
68
|
-
end
|
69
|
-
|
70
|
-
module Comment
|
71
|
-
def self.call(text: nil, apex_directory: nil)
|
72
|
-
text ||= self.text
|
73
|
-
|
74
|
-
basename = "write_comment__#{text.gsub(' ', '_')}"
|
75
|
-
|
76
|
-
content = Content.example(text:)
|
77
|
-
|
78
|
-
Create.(content, basename:, apex_directory:)
|
79
|
-
end
|
80
|
-
|
81
|
-
def self.content
|
82
|
-
Content.example
|
83
|
-
end
|
84
|
-
|
85
|
-
def self.basename
|
86
|
-
'some_commenting_file'
|
87
|
-
end
|
88
|
-
|
89
|
-
def self.text
|
90
|
-
Text::Comment.example
|
91
|
-
end
|
92
|
-
|
93
|
-
module Content
|
94
|
-
def self.example(text: nil)
|
95
|
-
text ||= Comment.text
|
96
|
-
|
97
|
-
<<~RUBY
|
98
|
-
comment_text = #{text.inspect}
|
99
|
-
|
100
|
-
commented = #{Controls::Events::Commented}.example(text: comment_text)
|
101
|
-
|
102
|
-
Session.instance.record_event(commented)
|
103
|
-
RUBY
|
104
|
-
end
|
105
|
-
end
|
106
|
-
end
|
107
|
-
end
|
108
|
-
end
|
109
|
-
end
|
110
|
-
end
|
111
|
-
end
|
112
|
-
end
|
113
|
-
end
|
@@ -1,42 +0,0 @@
|
|
1
|
-
module TestBenchBootstrap
|
2
|
-
module TestBench
|
3
|
-
class Session
|
4
|
-
module Controls
|
5
|
-
module Path
|
6
|
-
module File
|
7
|
-
def self.example(basename: nil, extension: nil, directory: nil, subdirectory: nil, apex_directory: nil)
|
8
|
-
basename ||= self.basename
|
9
|
-
extension ||= self.extension
|
10
|
-
|
11
|
-
filename = "#{basename}#{extension}"
|
12
|
-
|
13
|
-
Path.example(name: filename, directory:, subdirectory:, apex_directory:)
|
14
|
-
end
|
15
|
-
|
16
|
-
def self.basename
|
17
|
-
'some-file'
|
18
|
-
end
|
19
|
-
|
20
|
-
def self.extension
|
21
|
-
'.rb'
|
22
|
-
end
|
23
|
-
|
24
|
-
def self.other_example
|
25
|
-
Other.example
|
26
|
-
end
|
27
|
-
|
28
|
-
module Other
|
29
|
-
def self.example(apex_directory: nil)
|
30
|
-
File.example(basename:, apex_directory:)
|
31
|
-
end
|
32
|
-
|
33
|
-
def self.basename
|
34
|
-
'some-other-file'
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
@@ -1,87 +0,0 @@
|
|
1
|
-
module TestBenchBootstrap
|
2
|
-
module TestBench
|
3
|
-
class Session
|
4
|
-
module Controls
|
5
|
-
module Path
|
6
|
-
def self.example(name: nil, directory: nil, subdirectory: nil, apex_directory: nil)
|
7
|
-
if apex_directory.nil?
|
8
|
-
Relative.example(name:, directory:, subdirectory:)
|
9
|
-
else
|
10
|
-
Absolute.example(name:, directory:, subdirectory:, apex_directory:)
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
def self.name
|
15
|
-
'some-entry'
|
16
|
-
end
|
17
|
-
|
18
|
-
def self.directory
|
19
|
-
'some-dir'
|
20
|
-
end
|
21
|
-
|
22
|
-
def self.subdirectory
|
23
|
-
'some-subdir'
|
24
|
-
end
|
25
|
-
|
26
|
-
def self.other_example
|
27
|
-
Other.example
|
28
|
-
end
|
29
|
-
|
30
|
-
module Other
|
31
|
-
def self.example(apex_directory: nil)
|
32
|
-
Path.example(name:, directory:, subdirectory:, apex_directory:)
|
33
|
-
end
|
34
|
-
|
35
|
-
def self.name
|
36
|
-
'some-other-entry'
|
37
|
-
end
|
38
|
-
|
39
|
-
def self.directory
|
40
|
-
'some-other-dir'
|
41
|
-
end
|
42
|
-
|
43
|
-
def self.subdirectory
|
44
|
-
'some-other-subdir'
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
module Absolute
|
49
|
-
def self.example(name: nil, directory: nil, subdirectory: nil, apex_directory: nil)
|
50
|
-
apex_directory ||= self.apex_directory
|
51
|
-
|
52
|
-
relative_path = Relative.example(name:, directory:, subdirectory:)
|
53
|
-
|
54
|
-
::File.join(apex_directory, relative_path)
|
55
|
-
end
|
56
|
-
|
57
|
-
def self.apex_directory
|
58
|
-
'/'
|
59
|
-
end
|
60
|
-
end
|
61
|
-
|
62
|
-
module Relative
|
63
|
-
def self.example(name: nil, directory: nil, subdirectory: nil)
|
64
|
-
name ||= Path.name
|
65
|
-
|
66
|
-
if directory == :none
|
67
|
-
directory = nil
|
68
|
-
else
|
69
|
-
directory ||= Path.directory
|
70
|
-
end
|
71
|
-
|
72
|
-
if subdirectory == :none
|
73
|
-
subdirectory = nil
|
74
|
-
elsif not directory.nil?
|
75
|
-
subdirectory ||= Path.subdirectory
|
76
|
-
end
|
77
|
-
|
78
|
-
segments = [directory, subdirectory, name].compact
|
79
|
-
|
80
|
-
::File.join(*segments)
|
81
|
-
end
|
82
|
-
end
|
83
|
-
end
|
84
|
-
end
|
85
|
-
end
|
86
|
-
end
|
87
|
-
end
|
@@ -1,92 +0,0 @@
|
|
1
|
-
module TestBenchBootstrap
|
2
|
-
module TestBench
|
3
|
-
class Session
|
4
|
-
module Controls
|
5
|
-
module Status
|
6
|
-
def self.example
|
7
|
-
Relative.example
|
8
|
-
end
|
9
|
-
|
10
|
-
module Passed
|
11
|
-
def self.example
|
12
|
-
Session::Status.new(
|
13
|
-
test_sequence: Sequence.example,
|
14
|
-
failure_sequence: 0,
|
15
|
-
error_sequence: 0,
|
16
|
-
skip_sequence: 0
|
17
|
-
)
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
module Failed
|
22
|
-
def self.example
|
23
|
-
Session::Status.new(
|
24
|
-
test_sequence: Sequence.example,
|
25
|
-
failure_sequence: Sequence.example,
|
26
|
-
error_sequence: 0,
|
27
|
-
skip_sequence: 0
|
28
|
-
)
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
module None
|
33
|
-
def self.example
|
34
|
-
Session::Status.new(
|
35
|
-
test_sequence: 0,
|
36
|
-
failure_sequence: 0,
|
37
|
-
error_sequence: 0,
|
38
|
-
skip_sequence: 0
|
39
|
-
)
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
module Aborted
|
44
|
-
def self.example
|
45
|
-
Session::Status.new(
|
46
|
-
test_sequence: Sequence.example,
|
47
|
-
failure_sequence: Sequence.example,
|
48
|
-
error_sequence: Sequence.example,
|
49
|
-
skip_sequence: 0
|
50
|
-
)
|
51
|
-
end
|
52
|
-
end
|
53
|
-
|
54
|
-
module Incomplete
|
55
|
-
def self.example
|
56
|
-
Session::Status.new(
|
57
|
-
test_sequence: Sequence.example,
|
58
|
-
failure_sequence: 0,
|
59
|
-
error_sequence: 0,
|
60
|
-
skip_sequence: Sequence.example
|
61
|
-
)
|
62
|
-
end
|
63
|
-
end
|
64
|
-
|
65
|
-
module Relative
|
66
|
-
def self.example
|
67
|
-
Session::Status.new(
|
68
|
-
test_sequence: 1,
|
69
|
-
failure_sequence: 11,
|
70
|
-
error_sequence: 111,
|
71
|
-
skip_sequence: 1111
|
72
|
-
)
|
73
|
-
end
|
74
|
-
|
75
|
-
def self.reference
|
76
|
-
Session::Status.new(
|
77
|
-
test_sequence: 0,
|
78
|
-
failure_sequence: 1,
|
79
|
-
error_sequence: 11,
|
80
|
-
skip_sequence: 111
|
81
|
-
)
|
82
|
-
end
|
83
|
-
|
84
|
-
def self.result
|
85
|
-
Session::Result.aborted
|
86
|
-
end
|
87
|
-
end
|
88
|
-
end
|
89
|
-
end
|
90
|
-
end
|
91
|
-
end
|
92
|
-
end
|