test_bench-session 2.1.3.2 → 3.0.0.0.pre.2
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/session/controls/backtrace/location.rb +46 -0
- data/lib/test_bench/session/controls/backtrace.rb +81 -0
- data/lib/test_bench/session/controls/comment_disposition.rb +15 -0
- data/lib/test_bench/session/controls/event.rb +27 -1
- data/lib/test_bench/session/controls/events/aborted.rb +49 -0
- data/lib/test_bench/session/controls/events/commented.rb +26 -76
- data/lib/test_bench/session/controls/events/context_finished.rb +68 -28
- data/lib/test_bench/session/controls/events/context_started.rb +17 -32
- data/lib/test_bench/session/controls/events/detailed.rb +26 -76
- data/lib/test_bench/session/controls/events/failed.rb +16 -24
- data/lib/test_bench/session/controls/events/file_executed.rb +99 -0
- data/lib/test_bench/session/controls/events/file_not_found.rb +39 -0
- data/lib/test_bench/session/controls/events/file_queued.rb +39 -0
- data/lib/test_bench/session/controls/events/skipped.rb +49 -0
- data/lib/test_bench/session/controls/events/test_finished.rb +48 -28
- data/lib/test_bench/session/controls/events/test_started.rb +17 -32
- data/lib/test_bench/session/controls/events.rb +19 -19
- data/lib/test_bench/session/controls/exception/message.rb +21 -0
- data/lib/test_bench/session/controls/exception/raise.rb +50 -0
- data/lib/test_bench/session/controls/exception.rb +55 -21
- data/lib/test_bench/session/controls/message.rb +41 -0
- data/lib/test_bench/session/controls/{time.rb → metadata.rb} +1 -1
- data/lib/test_bench/session/controls/path/apex_directory.rb +74 -0
- data/lib/test_bench/session/controls/path/file/create.rb +111 -0
- data/lib/test_bench/session/controls/path/file.rb +40 -0
- data/lib/test_bench/session/controls/path.rb +85 -0
- data/lib/test_bench/session/controls/random.rb +1 -1
- data/lib/test_bench/session/controls/result.rb +3 -11
- data/lib/test_bench/session/controls/{events/event_data.rb → sequence.rb} +4 -2
- data/lib/test_bench/session/controls/status.rb +90 -0
- data/lib/test_bench/session/controls/telemetry.rb +13 -0
- data/lib/test_bench/session/controls/telemetry_sink.rb +29 -1
- data/lib/test_bench/session/controls/text.rb +31 -0
- data/lib/test_bench/session/controls/title.rb +12 -12
- data/lib/test_bench/session/controls.rb +31 -26
- data/lib/test_bench/session/defaults.rb +15 -0
- data/lib/test_bench/session/events.rb +12 -15
- data/lib/test_bench/session/exception/format_backtrace/substitute.rb +32 -0
- data/lib/test_bench/session/exception/format_backtrace.rb +112 -0
- data/lib/test_bench/session/isolate/substitute.rb +43 -0
- data/lib/test_bench/session/isolate.rb +157 -0
- data/lib/test_bench/session/result.rb +42 -0
- data/lib/test_bench/session/session.rb +137 -164
- data/lib/test_bench/session/status.rb +58 -0
- data/lib/test_bench/session/substitute/sink.rb +30 -45
- data/lib/test_bench/session/substitute.rb +91 -52
- data/lib/test_bench/session/trace.rb +51 -0
- data/lib/test_bench/session.rb +15 -15
- metadata +53 -45
- data/lib/test_bench/session/controls/comment.rb +0 -105
- data/lib/test_bench/session/controls/detail.rb +0 -91
- data/lib/test_bench/session/controls/events/context_skipped.rb +0 -47
- data/lib/test_bench/session/controls/events/fixture_finished.rb +0 -53
- data/lib/test_bench/session/controls/events/fixture_started.rb +0 -47
- data/lib/test_bench/session/controls/events/test_skipped.rb +0 -47
- data/lib/test_bench/session/controls/failure.rb +0 -19
- data/lib/test_bench/session/controls/fixture.rb +0 -19
- data/lib/test_bench/session/controls/output/detail.rb +0 -29
- data/lib/test_bench/session/controls/output.rb +0 -55
- data/lib/test_bench/session/controls/process_id.rb +0 -7
- data/lib/test_bench/session/controls/substitute/path.rb +0 -33
- data/lib/test_bench/session/output/get.rb +0 -27
- data/lib/test_bench/session/output/writer/buffer/interactive/viewport.rb +0 -165
- data/lib/test_bench/session/output/writer/buffer/interactive.rb +0 -139
- data/lib/test_bench/session/output/writer/buffer.rb +0 -27
- data/lib/test_bench/session/output/writer/defaults.rb +0 -17
- data/lib/test_bench/session/output/writer/substitute.rb +0 -17
- data/lib/test_bench/session/output/writer.rb +0 -95
- data/lib/test_bench/session/output.rb +0 -384
- data/lib/test_bench/session/projection.rb +0 -28
- data/lib/test_bench/session/store.rb +0 -59
- data/lib/test_bench/session/substitute/path.rb +0 -63
@@ -0,0 +1,50 @@
|
|
1
|
+
module TestBench
|
2
|
+
class Session
|
3
|
+
module Controls
|
4
|
+
module Exception
|
5
|
+
module Raise
|
6
|
+
def self.call(exception_class, exception_message, relative: nil)
|
7
|
+
apex_directory = Path::ApexDirectory::Create.()
|
8
|
+
|
9
|
+
if Exception.const_defined?(:SomeNamespace)
|
10
|
+
Exception.send(:remove_const, :SomeNamespace)
|
11
|
+
end
|
12
|
+
|
13
|
+
file_1 = Controls::Path::File::Create.(<<~RUBY, subdirectory: :none, apex_directory:, relative:)
|
14
|
+
#{Controls::Exception}::SomeNamespace.module_exec { def self.some_method = raise #{exception_class}, #{exception_message.inspect}, caller_locations(0, 4) }
|
15
|
+
RUBY
|
16
|
+
|
17
|
+
file_2 = Controls::Path::File::Create.(<<~RUBY, basename: 'some-file', apex_directory:, relative:)
|
18
|
+
module #{Controls::Exception}::SomeNamespace
|
19
|
+
def self.some_other_method = some_method
|
20
|
+
end
|
21
|
+
RUBY
|
22
|
+
|
23
|
+
file_3 = Controls::Path::File::Create.(<<~RUBY, basename: 'some-other-file', apex_directory:, relative:)
|
24
|
+
module #{Controls::Exception}
|
25
|
+
module SomeNamespace
|
26
|
+
def self.yet_another_method = some_other_method
|
27
|
+
end
|
28
|
+
end
|
29
|
+
RUBY
|
30
|
+
|
31
|
+
file_4 = Controls::Path::File::Create.(<<~RUBY, basename: 'some-other-file', subdirectory: :none, apex_directory:, relative:)
|
32
|
+
#{[file_3, file_2, file_1].inspect}.each { |file| load file }
|
33
|
+
|
34
|
+
module #{Controls::Exception}::SomeNamespace
|
35
|
+
def self.origin = yet_another_method; origin
|
36
|
+
end
|
37
|
+
RUBY
|
38
|
+
|
39
|
+
::Dir.chdir(apex_directory) do
|
40
|
+
load file_4
|
41
|
+
end
|
42
|
+
|
43
|
+
ensure
|
44
|
+
Path::ApexDirectory::Remove.(apex_directory)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -2,42 +2,76 @@ module TestBench
|
|
2
2
|
class Session
|
3
3
|
module Controls
|
4
4
|
module Exception
|
5
|
-
def self.example(
|
6
|
-
|
7
|
-
exception_class ||=
|
5
|
+
def self.example(exception_message: nil, exception_class: nil, relative: nil)
|
6
|
+
exception_message ||= self.exception_message
|
7
|
+
exception_class ||= self.exception_class
|
8
8
|
|
9
|
-
|
9
|
+
Raise.(exception_class, exception_message, relative:)
|
10
|
+
rescue exception_class => exception
|
11
|
+
return exception
|
12
|
+
else
|
13
|
+
abort "Unreachable"
|
10
14
|
end
|
11
15
|
|
12
|
-
def self.
|
13
|
-
|
16
|
+
def self.exception_message
|
17
|
+
"Some exception"
|
18
|
+
end
|
14
19
|
|
15
|
-
|
20
|
+
def self.exception_class
|
21
|
+
SomeException
|
16
22
|
end
|
17
23
|
|
18
|
-
|
19
|
-
|
24
|
+
SomeException = Class.new(::Exception)
|
25
|
+
SomeOtherException = Class.new(::Exception)
|
20
26
|
|
21
|
-
|
22
|
-
|
27
|
+
Example = self.example
|
28
|
+
|
29
|
+
module Other
|
30
|
+
def self.example
|
31
|
+
Exception.example(exception_message:, exception_class:)
|
32
|
+
end
|
33
|
+
|
34
|
+
def self.exception_message
|
35
|
+
"Some other exception"
|
36
|
+
end
|
37
|
+
|
38
|
+
def self.exception_class
|
39
|
+
SomeOtherException
|
40
|
+
end
|
23
41
|
|
24
|
-
|
25
|
-
Message.example
|
42
|
+
Example = self.example
|
26
43
|
end
|
27
44
|
|
28
|
-
|
29
|
-
|
45
|
+
module Cause
|
46
|
+
def self.example(exception_message: nil, exception_class: nil)
|
47
|
+
exception_message ||= self.exception_message
|
48
|
+
exception_class ||= self.exception_class
|
30
49
|
|
31
|
-
|
32
|
-
|
33
|
-
|
50
|
+
Raise.(exception_class, exception_message)
|
51
|
+
rescue SomeOtherException
|
52
|
+
exception = Exception.example(exception_message:, exception_class:)
|
53
|
+
return exception
|
54
|
+
else
|
55
|
+
abort "Unreachable"
|
56
|
+
end
|
57
|
+
|
58
|
+
def self.exception_message
|
59
|
+
"Some exception cause"
|
60
|
+
end
|
61
|
+
|
62
|
+
def self.exception_class
|
63
|
+
SomeOtherException
|
34
64
|
end
|
35
65
|
|
36
|
-
|
37
|
-
|
66
|
+
Example = self.example
|
67
|
+
end
|
38
68
|
|
39
|
-
|
69
|
+
module AbsolutePaths
|
70
|
+
def self.example
|
71
|
+
Exception.example(relative: false)
|
40
72
|
end
|
73
|
+
|
74
|
+
Example = self.example
|
41
75
|
end
|
42
76
|
end
|
43
77
|
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
module TestBench
|
2
|
+
class Session
|
3
|
+
module Controls
|
4
|
+
module Message
|
5
|
+
def self.example
|
6
|
+
"Some message"
|
7
|
+
end
|
8
|
+
|
9
|
+
module Failure
|
10
|
+
def self.example
|
11
|
+
"Some failure"
|
12
|
+
end
|
13
|
+
|
14
|
+
def self.other_example
|
15
|
+
"Some other failure"
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
module Error
|
20
|
+
def self.example
|
21
|
+
Exception::Message.example
|
22
|
+
end
|
23
|
+
|
24
|
+
def self.other_example
|
25
|
+
Exception::Message.other_example
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
module Skip
|
30
|
+
def self.example
|
31
|
+
"Some skipped test or context"
|
32
|
+
end
|
33
|
+
|
34
|
+
def self.other_example
|
35
|
+
"Some other skipped test or context"
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,74 @@
|
|
1
|
+
module TestBench
|
2
|
+
class Session
|
3
|
+
module Controls
|
4
|
+
module Path
|
5
|
+
module ApexDirectory
|
6
|
+
def self.example(name=nil)
|
7
|
+
name ||= Name.example
|
8
|
+
|
9
|
+
::File.expand_path(name, tmpdir)
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.tmpdir
|
13
|
+
::Dir.tmpdir
|
14
|
+
end
|
15
|
+
|
16
|
+
module Name
|
17
|
+
def self.example
|
18
|
+
'test-automated-session-controls'
|
19
|
+
end
|
20
|
+
|
21
|
+
def self.random
|
22
|
+
"#{example}-#{Random.string}"
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
module Create
|
27
|
+
def self.call(name=nil)
|
28
|
+
name ||= Name.random
|
29
|
+
|
30
|
+
apex_directory = ApexDirectory.example(name)
|
31
|
+
|
32
|
+
::Dir.mkdir(apex_directory)
|
33
|
+
|
34
|
+
if ENV.fetch('DEBUG_PATH_CONTROLS', 'off') == 'on'
|
35
|
+
warn "created directory '#{apex_directory}'"
|
36
|
+
end
|
37
|
+
|
38
|
+
apex_directory
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
module Remove
|
43
|
+
def self.call(apex_directory)
|
44
|
+
remove(apex_directory)
|
45
|
+
end
|
46
|
+
|
47
|
+
def self.remove(directory)
|
48
|
+
::Dir.each_child(directory) do |entry|
|
49
|
+
absolute_path = ::File.expand_path(entry, directory)
|
50
|
+
|
51
|
+
if ::File.directory?(absolute_path)
|
52
|
+
subdirectory = absolute_path
|
53
|
+
remove(subdirectory)
|
54
|
+
else
|
55
|
+
::File.unlink(absolute_path)
|
56
|
+
|
57
|
+
if ENV.fetch('DEBUG_PATH_CONTROLS', 'off') == 'on'
|
58
|
+
warn "removed '#{absolute_path}'"
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
::Dir.rmdir(directory)
|
64
|
+
|
65
|
+
if ENV.fetch('DEBUG_PATH_CONTROLS', 'off') == 'on'
|
66
|
+
warn "removed directory '#{directory}'"
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
@@ -0,0 +1,111 @@
|
|
1
|
+
module TestBench
|
2
|
+
class Session
|
3
|
+
module Controls
|
4
|
+
module Path
|
5
|
+
module File
|
6
|
+
module Create
|
7
|
+
def self.call(content=nil, basename: nil, extension: nil, directory: nil, subdirectory: nil, apex_directory: nil, relative: nil)
|
8
|
+
if relative.nil?
|
9
|
+
relative = !apex_directory.nil?
|
10
|
+
end
|
11
|
+
|
12
|
+
apex_directory ||= ::Dir.tmpdir
|
13
|
+
|
14
|
+
absolute_path = File.example(basename:, extension:, directory:, subdirectory:, apex_directory:)
|
15
|
+
|
16
|
+
relative_path = absolute_path.delete_prefix(::File.join(apex_directory, ''))
|
17
|
+
|
18
|
+
if relative
|
19
|
+
file_path = relative_path
|
20
|
+
else
|
21
|
+
file_path = absolute_path
|
22
|
+
end
|
23
|
+
|
24
|
+
content ||= "# #{file_path}\n"
|
25
|
+
|
26
|
+
segments = []
|
27
|
+
|
28
|
+
until ['.', '/'].include?(relative_path)
|
29
|
+
segments.unshift(::File.basename(relative_path))
|
30
|
+
|
31
|
+
relative_path = ::File.dirname(relative_path)
|
32
|
+
end
|
33
|
+
|
34
|
+
(1...segments.length).each do |index|
|
35
|
+
directory_segments = segments[...index]
|
36
|
+
|
37
|
+
directory = ::File.join(apex_directory, *directory_segments)
|
38
|
+
|
39
|
+
if not ::File.directory?(directory)
|
40
|
+
::Dir.mkdir(directory)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
::File.write(absolute_path, content)
|
45
|
+
|
46
|
+
if ENV.fetch('DEBUG_PATH_CONTROLS', 'off') == 'on'
|
47
|
+
warn "created '#{absolute_path}'"
|
48
|
+
end
|
49
|
+
|
50
|
+
file_path
|
51
|
+
end
|
52
|
+
|
53
|
+
module Exception
|
54
|
+
def self.call(apex_directory: nil)
|
55
|
+
Create.(content, basename:, apex_directory:)
|
56
|
+
end
|
57
|
+
|
58
|
+
def self.basename
|
59
|
+
'some_aborting_file.rb'
|
60
|
+
end
|
61
|
+
|
62
|
+
def self.content
|
63
|
+
<<~RUBY
|
64
|
+
raise #{Controls::Exception}::Example
|
65
|
+
RUBY
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
module Comment
|
70
|
+
def self.call(text: nil, apex_directory: nil)
|
71
|
+
text ||= self.text
|
72
|
+
|
73
|
+
basename = "write_comment__#{text.gsub(' ', '_')}"
|
74
|
+
|
75
|
+
content = Content.example(text:)
|
76
|
+
|
77
|
+
Create.(content, basename:, apex_directory:)
|
78
|
+
end
|
79
|
+
|
80
|
+
def self.content
|
81
|
+
Content.example
|
82
|
+
end
|
83
|
+
|
84
|
+
def self.basename
|
85
|
+
'some_commenting_file'
|
86
|
+
end
|
87
|
+
|
88
|
+
def self.text
|
89
|
+
Text::Comment.example
|
90
|
+
end
|
91
|
+
|
92
|
+
module Content
|
93
|
+
def self.example(text: nil)
|
94
|
+
text ||= Comment.text
|
95
|
+
|
96
|
+
<<~RUBY
|
97
|
+
comment_text = #{text.inspect}
|
98
|
+
|
99
|
+
commented = #{Controls::Events::Commented}.example(text: comment_text)
|
100
|
+
|
101
|
+
Session.instance.record_event(commented)
|
102
|
+
RUBY
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
108
|
+
end
|
109
|
+
end
|
110
|
+
end
|
111
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
module TestBench
|
2
|
+
class Session
|
3
|
+
module Controls
|
4
|
+
module Path
|
5
|
+
module File
|
6
|
+
def self.example(basename: nil, extension: nil, directory: nil, subdirectory: nil, apex_directory: nil)
|
7
|
+
basename ||= self.basename
|
8
|
+
extension ||= self.extension
|
9
|
+
|
10
|
+
filename = "#{basename}#{extension}"
|
11
|
+
|
12
|
+
Path.example(name: filename, directory:, subdirectory:, apex_directory:)
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.basename
|
16
|
+
'some-file'
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.extension
|
20
|
+
'.rb'
|
21
|
+
end
|
22
|
+
|
23
|
+
def self.other_example
|
24
|
+
Other.example
|
25
|
+
end
|
26
|
+
|
27
|
+
module Other
|
28
|
+
def self.example(apex_directory: nil)
|
29
|
+
File.example(basename:, apex_directory:)
|
30
|
+
end
|
31
|
+
|
32
|
+
def self.basename
|
33
|
+
'some-other-file'
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,85 @@
|
|
1
|
+
module TestBench
|
2
|
+
class Session
|
3
|
+
module Controls
|
4
|
+
module Path
|
5
|
+
def self.example(name: nil, directory: nil, subdirectory: nil, apex_directory: nil)
|
6
|
+
if apex_directory.nil?
|
7
|
+
Relative.example(name:, directory:, subdirectory:)
|
8
|
+
else
|
9
|
+
Absolute.example(name:, directory:, subdirectory:, apex_directory:)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.name
|
14
|
+
'some-entry'
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.directory
|
18
|
+
'some-dir'
|
19
|
+
end
|
20
|
+
|
21
|
+
def self.subdirectory
|
22
|
+
'some-subdir'
|
23
|
+
end
|
24
|
+
|
25
|
+
def self.other_example
|
26
|
+
Other.example
|
27
|
+
end
|
28
|
+
|
29
|
+
module Other
|
30
|
+
def self.example(apex_directory: nil)
|
31
|
+
Path.example(name:, directory:, subdirectory:, apex_directory:)
|
32
|
+
end
|
33
|
+
|
34
|
+
def self.name
|
35
|
+
'some-other-entry'
|
36
|
+
end
|
37
|
+
|
38
|
+
def self.directory
|
39
|
+
'some-other-dir'
|
40
|
+
end
|
41
|
+
|
42
|
+
def self.subdirectory
|
43
|
+
'some-other-subdir'
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
module Absolute
|
48
|
+
def self.example(name: nil, directory: nil, subdirectory: nil, apex_directory: nil)
|
49
|
+
apex_directory ||= self.apex_directory
|
50
|
+
|
51
|
+
relative_path = Relative.example(name:, directory:, subdirectory:)
|
52
|
+
|
53
|
+
::File.join(apex_directory, relative_path)
|
54
|
+
end
|
55
|
+
|
56
|
+
def self.apex_directory
|
57
|
+
'/'
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
module Relative
|
62
|
+
def self.example(name: nil, directory: nil, subdirectory: nil)
|
63
|
+
name ||= Path.name
|
64
|
+
|
65
|
+
if directory == :none
|
66
|
+
directory = nil
|
67
|
+
else
|
68
|
+
directory ||= Path.directory
|
69
|
+
end
|
70
|
+
|
71
|
+
if subdirectory == :none
|
72
|
+
subdirectory = nil
|
73
|
+
elsif not directory.nil?
|
74
|
+
subdirectory ||= Path.subdirectory
|
75
|
+
end
|
76
|
+
|
77
|
+
segments = [directory, subdirectory, name].compact
|
78
|
+
|
79
|
+
::File.join(*segments)
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
@@ -3,19 +3,11 @@ module TestBench
|
|
3
3
|
module Controls
|
4
4
|
module Result
|
5
5
|
def self.example
|
6
|
-
|
6
|
+
Session::Result.passed
|
7
7
|
end
|
8
8
|
|
9
|
-
def self.
|
10
|
-
|
11
|
-
end
|
12
|
-
|
13
|
-
def self.failure
|
14
|
-
false
|
15
|
-
end
|
16
|
-
|
17
|
-
def self.random
|
18
|
-
Random.boolean
|
9
|
+
def self.other_example
|
10
|
+
Session::Result.failed
|
19
11
|
end
|
20
12
|
end
|
21
13
|
end
|
@@ -0,0 +1,90 @@
|
|
1
|
+
module TestBench
|
2
|
+
class Session
|
3
|
+
module Controls
|
4
|
+
module Status
|
5
|
+
def self.example
|
6
|
+
Relative.example
|
7
|
+
end
|
8
|
+
|
9
|
+
module Passed
|
10
|
+
def self.example
|
11
|
+
Session::Status.new(
|
12
|
+
test_sequence: Sequence.example,
|
13
|
+
failure_sequence: 0,
|
14
|
+
error_sequence: 0,
|
15
|
+
skip_sequence: 0
|
16
|
+
)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
module Failed
|
21
|
+
def self.example
|
22
|
+
Session::Status.new(
|
23
|
+
test_sequence: Sequence.example,
|
24
|
+
failure_sequence: Sequence.example,
|
25
|
+
error_sequence: 0,
|
26
|
+
skip_sequence: 0
|
27
|
+
)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
module None
|
32
|
+
def self.example
|
33
|
+
Session::Status.new(
|
34
|
+
test_sequence: 0,
|
35
|
+
failure_sequence: 0,
|
36
|
+
error_sequence: 0,
|
37
|
+
skip_sequence: 0
|
38
|
+
)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
module Aborted
|
43
|
+
def self.example
|
44
|
+
Session::Status.new(
|
45
|
+
test_sequence: Sequence.example,
|
46
|
+
failure_sequence: Sequence.example,
|
47
|
+
error_sequence: Sequence.example,
|
48
|
+
skip_sequence: 0
|
49
|
+
)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
module Incomplete
|
54
|
+
def self.example
|
55
|
+
Session::Status.new(
|
56
|
+
test_sequence: Sequence.example,
|
57
|
+
failure_sequence: 0,
|
58
|
+
error_sequence: 0,
|
59
|
+
skip_sequence: Sequence.example
|
60
|
+
)
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
module Relative
|
65
|
+
def self.example
|
66
|
+
Session::Status.new(
|
67
|
+
test_sequence: 1,
|
68
|
+
failure_sequence: 11,
|
69
|
+
error_sequence: 111,
|
70
|
+
skip_sequence: 1111
|
71
|
+
)
|
72
|
+
end
|
73
|
+
|
74
|
+
def self.reference
|
75
|
+
Session::Status.new(
|
76
|
+
test_sequence: 0,
|
77
|
+
failure_sequence: 1,
|
78
|
+
error_sequence: 11,
|
79
|
+
skip_sequence: 111
|
80
|
+
)
|
81
|
+
end
|
82
|
+
|
83
|
+
def self.result
|
84
|
+
Session::Result.aborted
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module TestBench
|
2
|
+
class Session
|
3
|
+
module Controls
|
4
|
+
module Telemetry
|
5
|
+
Event = TestBench::Telemetry::Controls::Event
|
6
|
+
EventData = TestBench::Telemetry::Controls::EventData
|
7
|
+
Metadata = TestBench::Telemetry::Controls::Event::Metadata
|
8
|
+
Random = TestBench::Telemetry::Controls::Random
|
9
|
+
Sink = TestBench::Telemetry::Controls::Sink
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -1,7 +1,35 @@
|
|
1
1
|
module TestBench
|
2
2
|
class Session
|
3
3
|
module Controls
|
4
|
-
TelemetrySink
|
4
|
+
module TelemetrySink
|
5
|
+
def self.example
|
6
|
+
Telemetry::Sink.example
|
7
|
+
end
|
8
|
+
|
9
|
+
class SetTrace
|
10
|
+
include TestBench::Telemetry::Sink
|
11
|
+
|
12
|
+
attr_accessor :trace_text
|
13
|
+
|
14
|
+
attr_reader :session
|
15
|
+
|
16
|
+
def initialize(session)
|
17
|
+
@session = session
|
18
|
+
end
|
19
|
+
|
20
|
+
def self.register(session)
|
21
|
+
instance = new(session)
|
22
|
+
session.register_telemetry_sink(instance)
|
23
|
+
instance
|
24
|
+
end
|
25
|
+
|
26
|
+
def receive(_event_data)
|
27
|
+
trace_text = session.trace.join
|
28
|
+
|
29
|
+
self.trace_text = trace_text
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
5
33
|
end
|
6
34
|
end
|
7
35
|
end
|