test_bench-run 2.1.3.1 → 3.0.0.0.pre.1

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.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/lib/test_bench/run/controls/{result.rb → events.rb} +1 -1
  3. data/lib/test_bench/run/controls/{process_id.rb → message.rb} +1 -1
  4. data/lib/test_bench/run/controls/path.rb +1 -9
  5. data/lib/test_bench/run/controls/random.rb +1 -1
  6. data/lib/test_bench/run/controls/session.rb +14 -0
  7. data/lib/test_bench/run/controls/status.rb +42 -0
  8. data/lib/test_bench/run/controls/summary/file/info.rb +106 -0
  9. data/lib/test_bench/run/controls/summary/file/totals.rb +36 -0
  10. data/lib/test_bench/run/controls/summary/file.rb +42 -0
  11. data/lib/test_bench/run/controls/summary/run.rb +51 -0
  12. data/lib/test_bench/run/controls/summary.rb +43 -0
  13. data/lib/test_bench/run/controls/{events/session.rb → telemetry.rb} +2 -2
  14. data/lib/test_bench/run/controls/time.rb +1 -1
  15. data/lib/test_bench/run/controls.rb +14 -20
  16. data/lib/test_bench/run/run.rb +78 -90
  17. data/lib/test_bench/run/{get_files → select_files}/substitute.rb +11 -14
  18. data/lib/test_bench/run/select_files.rb +68 -0
  19. data/lib/test_bench/run/substitute.rb +40 -0
  20. data/lib/test_bench/run/summary/substitute.rb +17 -0
  21. data/lib/test_bench/run/summary.rb +475 -0
  22. data/lib/test_bench/run.rb +6 -14
  23. metadata +32 -45
  24. data/lib/test_bench/run/controls/directory.rb +0 -70
  25. data/lib/test_bench/run/controls/event_data.rb +0 -7
  26. data/lib/test_bench/run/controls/events/event_data.rb +0 -9
  27. data/lib/test_bench/run/controls/events/file_crashed.rb +0 -109
  28. data/lib/test_bench/run/controls/events/file_finished.rb +0 -56
  29. data/lib/test_bench/run/controls/events/file_started.rb +0 -47
  30. data/lib/test_bench/run/controls/events/finished.rb +0 -56
  31. data/lib/test_bench/run/controls/events/started.rb +0 -47
  32. data/lib/test_bench/run/controls/exception.rb +0 -101
  33. data/lib/test_bench/run/controls/executor.rb +0 -56
  34. data/lib/test_bench/run/controls/file/create.rb +0 -69
  35. data/lib/test_bench/run/controls/file/pattern.rb +0 -33
  36. data/lib/test_bench/run/controls/file.rb +0 -180
  37. data/lib/test_bench/run/events.rb +0 -12
  38. data/lib/test_bench/run/executor/serial.rb +0 -34
  39. data/lib/test_bench/run/executor/substitute.rb +0 -45
  40. data/lib/test_bench/run/executor.rb +0 -44
  41. data/lib/test_bench/run/file.rb +0 -81
  42. data/lib/test_bench/run/get_files.rb +0 -76
  43. data/lib/test_bench/run/output/file.rb +0 -135
  44. data/lib/test_bench/run/output/summary/error.rb +0 -139
  45. data/lib/test_bench/run/output/summary.rb +0 -182
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7be023cdf3b12dc26db083086bc3b65d8aeb9f3400e9c7bcbef75de454ca6a0d
4
- data.tar.gz: 8d72adc4e20569570c7b222a2bfa1f5469cd4e54b8634b8b792928e83d45d44c
3
+ metadata.gz: d92ea9bb436a4890509afed4d85267f3ef6b36d2842b3619b468b6823161af11
4
+ data.tar.gz: f3d114c236f29409b89a6010358affbdccaeebc2f8b9265108fc523f343aef3d
5
5
  SHA512:
6
- metadata.gz: 88980fb406fc8e94f2e38fab55814ad69486655a291287bd97165f79f7b82b257c100d0ec1dc291340822b969e8852db3fbf258b0e612a44eddb47099cafcb96
7
- data.tar.gz: c95f38d8d365c32ac1e75a412939dd9c8318ce224a4193143ad2c2ac66d01b96f0656787b3e38ca1155f9c3437ce108a9665ed3ebb311650dd0a5dd7641266e7
6
+ metadata.gz: e54255f27f39425a4da8774832e9dbb10bd80a07b6f59123ab7753fe789a2cf7dea05690d521144201b32c28606f0d5b7045e22b1cbc1de048bf3796810bd56d
7
+ data.tar.gz: d04349fc8ffb0db0f0db66708e8e6e06e3a2cc3996ffeca57590e7e498b1bc96d5e8085c8af88dac4d70106c546e0ef6f5da0dfbdf499e953654bcf7b0c29990
@@ -1,7 +1,7 @@
1
1
  module TestBench
2
2
  class Run
3
3
  module Controls
4
- Result = Fixture::Controls::Result
4
+ Events = Session::Events
5
5
  end
6
6
  end
7
7
  end
@@ -1,7 +1,7 @@
1
1
  module TestBench
2
2
  class Run
3
3
  module Controls
4
- ProcessID = Session::Controls::ProcessID
4
+ Message = Session::Message
5
5
  end
6
6
  end
7
7
  end
@@ -1,15 +1,7 @@
1
1
  module TestBench
2
2
  class Run
3
3
  module Controls
4
- module Path
5
- def self.example
6
- File.example
7
- end
8
-
9
- def self.random
10
- File.random
11
- end
12
- end
4
+ Path = Session::Path
13
5
  end
14
6
  end
15
7
  end
@@ -1,7 +1,7 @@
1
1
  module TestBench
2
2
  class Run
3
3
  module Controls
4
- Random = Fixture::Controls::Random
4
+ Random = Session::Random
5
5
  end
6
6
  end
7
7
  end
@@ -0,0 +1,14 @@
1
+ module TestBench
2
+ class Run
3
+ module Controls
4
+ module Session
5
+ Path = TestBench::Session::Controls::Path
6
+ Events = TestBench::Session::Controls::Events
7
+ Message = TestBench::Session::Controls::Message
8
+ Status = TestBench::Session::Controls::Status
9
+ BacktraceLocation = TestBench::Session::Controls::Backtrace::Location
10
+ Random = TestBench::Session::Controls::Random
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,42 @@
1
+ module TestBench
2
+ class Run
3
+ module Controls
4
+ module Status
5
+ def self.example(tests: nil, failures: nil, errors: nil, skipped: nil)
6
+ tests ||= self.tests
7
+ failures ||= self.failures
8
+ errors ||= self.errors
9
+ skipped ||= self.skipped
10
+
11
+ test_sequence = tests
12
+ failure_sequence = failures
13
+ error_sequence = errors
14
+ skip_sequence = skipped
15
+
16
+ TestBench::Session::Status.new(
17
+ test_sequence,
18
+ failure_sequence,
19
+ error_sequence,
20
+ skip_sequence
21
+ )
22
+ end
23
+
24
+ def self.tests
25
+ 1_111
26
+ end
27
+
28
+ def self.failures
29
+ 111
30
+ end
31
+
32
+ def self.errors
33
+ 0
34
+ end
35
+
36
+ def self.skipped
37
+ 11
38
+ end
39
+ end
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,106 @@
1
+ module TestBench
2
+ class Run
3
+ module Controls
4
+ module Summary
5
+ module File
6
+ module Info
7
+ def self.example(path: nil, tests: nil, failures: nil, skipped: nil, aborted_events: nil)
8
+ path ||= self.path
9
+ tests ||= self.tests
10
+ failures ||= self.failures
11
+ skipped ||= self.skipped
12
+ aborted_events ||= self.aborted_events
13
+
14
+ session_status = Status.example(
15
+ tests:,
16
+ failures:,
17
+ skipped:,
18
+ errors: aborted_events.count
19
+ )
20
+
21
+ TestBench::Run::Summary::FileInfo.new(path, session_status, aborted_events)
22
+ end
23
+
24
+ def self.path
25
+ Path::File.example
26
+ end
27
+
28
+ def self.tests
29
+ 0
30
+ end
31
+
32
+ def self.failures
33
+ 11
34
+ end
35
+
36
+ def self.skipped
37
+ 12
38
+ end
39
+
40
+ def self.aborted_events
41
+ [
42
+ Session::Events::Aborted.example,
43
+ Session::Events::Aborted.other_example
44
+ ]
45
+ end
46
+
47
+ def self.other_example
48
+ Other.example
49
+ end
50
+
51
+ module Other
52
+ def self.example(tests: nil, failures: nil, skipped: nil, aborted_events: nil)
53
+ tests ||= self.tests
54
+ failures ||= self.failures
55
+ skipped ||= self.skipped
56
+ aborted_events ||= self.aborted_events
57
+
58
+ Info.example(path:, tests:, failures:, skipped:, aborted_events:)
59
+ end
60
+
61
+ def self.path
62
+ Path::File.other_example
63
+ end
64
+
65
+ def self.tests
66
+ 1
67
+ end
68
+
69
+ def self.failures
70
+ 1
71
+ end
72
+
73
+ def self.skipped
74
+ 0
75
+ end
76
+
77
+ def self.aborted_events
78
+ []
79
+ end
80
+ end
81
+
82
+ module NotFound
83
+ def self.example
84
+ TestBench::Run::Summary::FileInfo.not_found(path)
85
+ end
86
+
87
+ def self.path
88
+ "/some-not-found-file.rb"
89
+ end
90
+ end
91
+
92
+ module Set
93
+ def self.call(summary)
94
+ file_info = File::Info.example
95
+ other_file_info = File::Info.other_example
96
+
97
+ summary.add_file(file_info)
98
+ summary.add_file(other_file_info)
99
+ end
100
+ end
101
+ end
102
+ end
103
+ end
104
+ end
105
+ end
106
+ end
@@ -0,0 +1,36 @@
1
+ module TestBench
2
+ class Run
3
+ module Controls
4
+ module Summary
5
+ module File
6
+ module Totals
7
+ def self.example(attempted: nil, completed: nil, aborted: nil, not_found: nil)
8
+ attempted ||= self.attempted
9
+ completed ||= self.completed
10
+ aborted ||= self.aborted
11
+ not_found ||= self.not_found
12
+
13
+ TestBench::Run::Summary::FileTotals.new(attempted, completed, aborted, not_found)
14
+ end
15
+
16
+ def self.attempted
17
+ 222
18
+ end
19
+
20
+ def self.completed
21
+ 200
22
+ end
23
+
24
+ def self.aborted
25
+ 20
26
+ end
27
+
28
+ def self.not_found
29
+ 2
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,42 @@
1
+ module TestBench
2
+ class Run
3
+ module Controls
4
+ module Summary
5
+ module File
6
+ module Unstyled
7
+ def self.example
8
+ <<~TEXT
9
+ File Summary
10
+ - - -
11
+ - #{Path::File.example}: no tests, 11 failures, 12+ skipped, 2 errors:
12
+ #{Message::Error.example}
13
+ #{Session::BacktraceLocation.example}
14
+
15
+ #{Message::Error.other_example}
16
+ #{Session::BacktraceLocation.other_example}
17
+
18
+ - #{Path::File.other_example}: 1 failure
19
+ TEXT
20
+ end
21
+ end
22
+
23
+ module Styled
24
+ def self.example
25
+ <<~TEXT
26
+ \e[1;4m\e[31mFile Summary\e[m
27
+ \e[31m\e[2m-\e[22m \e[1m#{Info.path}\e[22m: no tests, 11 failures, 12+ skipped, 2 errors:\e[m
28
+ \e[31m#{Message::Error.example}\e[m
29
+ \e[31m#{Session::BacktraceLocation.example}\e[m
30
+ \e[m
31
+ \e[31m#{Message::Error.other_example}\e[m
32
+ \e[31m#{Session::BacktraceLocation.other_example}\e[m
33
+ \e[m
34
+ \e[31m\e[2m-\e[22m \e[1m#{Info::Other.path}\e[22m: 1 failure\e[m
35
+ TEXT
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,51 @@
1
+ module TestBench
2
+ class Run
3
+ module Controls
4
+ module Summary
5
+ module Run
6
+ def self.example
7
+ Unstyled.example
8
+ end
9
+
10
+ module Unstyled
11
+ def self.example
12
+ <<~TEXT
13
+ Attempted 222 files: 200 completed, 20 aborted, 2 not found
14
+ 1111 tests in 0.00 seconds (Inf tests/sec)
15
+ 1000 passed, 111 failed, 11+ skipped
16
+ TEXT
17
+ end
18
+ end
19
+
20
+ module Styled
21
+ def self.example
22
+ <<~TEXT
23
+ Attempted 222 files: 200 completed, \e[1;31m20 aborted\e[39;22m, \e[31m2 not found\e[m
24
+ 1111 tests in 0.00 seconds (Inf tests/sec)\e[m
25
+ \e[32m1000 passed\e[39m, \e[1;31m111 failed\e[39;22m, \e[33m11+ skipped\e[m
26
+ TEXT
27
+ end
28
+ end
29
+
30
+ module Initial
31
+ def self.unstyled
32
+ <<~TEXT
33
+ Attempted 0 files: 0 completed, 0 aborted, 0 not found
34
+ 0 tests in 0.00 seconds (NaN tests/sec)
35
+ 0 passed, 0 failed, 0 skipped
36
+ TEXT
37
+ end
38
+
39
+ def self.styled
40
+ <<~TEXT
41
+ Attempted 0 files: 0 completed, 0 aborted, 0 not found\e[m
42
+ 0 tests in 0.00 seconds (NaN tests/sec)\e[m
43
+ \e[2;3m0 passed\e[23;22m, 0 failed, 0 skipped\e[m
44
+ TEXT
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,43 @@
1
+ module TestBench
2
+ class Run
3
+ module Controls
4
+ module Summary
5
+ def self.example
6
+ Unstyled.example
7
+ end
8
+
9
+ module Unstyled
10
+ def self.example
11
+ <<~TEXT
12
+ #{File::Unstyled.example}
13
+ #{Run::Unstyled.example}
14
+ TEXT
15
+ end
16
+ end
17
+
18
+ module Styled
19
+ def self.example
20
+ <<~TEXT
21
+ #{File::Styled.example}\e[m
22
+ #{Run::Styled.example}\e[m
23
+ TEXT
24
+ end
25
+ end
26
+
27
+ module Initial
28
+ def self.unstyled
29
+ <<~TEXT
30
+ #{Run::Initial.unstyled}
31
+ TEXT
32
+ end
33
+
34
+ def self.styled
35
+ <<~TEXT
36
+ #{Run::Initial.styled}\e[m
37
+ TEXT
38
+ end
39
+ end
40
+ end
41
+ end
42
+ end
43
+ end
@@ -1,8 +1,8 @@
1
1
  module TestBench
2
2
  class Run
3
3
  module Controls
4
- module Events
5
- Session = Session::Controls::Events
4
+ module Telemetry
5
+ Time = TestBench::Telemetry::Controls::Time
6
6
  end
7
7
  end
8
8
  end
@@ -1,7 +1,7 @@
1
1
  module TestBench
2
2
  class Run
3
3
  module Controls
4
- Time = Session::Controls::Time
4
+ Time = Telemetry::Time
5
5
  end
6
6
  end
7
7
  end
@@ -1,26 +1,20 @@
1
- require 'test_bench/fixture/controls'
1
+ require 'fileutils'
2
2
 
3
- require 'test_bench/run/controls/file'
4
- require 'test_bench/run/controls/file/create'
5
- require 'test_bench/run/controls/file/pattern'
6
- require 'test_bench/run/controls/exception'
7
- require 'test_bench/run/controls/process_id'
8
- require 'test_bench/run/controls/random'
9
- require 'test_bench/run/controls/result'
10
- require 'test_bench/run/controls/time'
3
+ require 'test_bench/output/controls'
11
4
 
12
- require 'test_bench/run/controls/events/event_data'
13
- require 'test_bench/run/controls/events/file_started'
14
- require 'test_bench/run/controls/events/file_finished'
15
- require 'test_bench/run/controls/events/file_crashed'
16
- require 'test_bench/run/controls/events/started'
17
- require 'test_bench/run/controls/events/finished'
5
+ require 'test_bench/run/controls/session'
6
+ require 'test_bench/run/controls/telemetry'
18
7
 
19
- require 'test_bench/run/controls/directory'
8
+ require 'test_bench/run/controls/events'
9
+ require 'test_bench/run/controls/message'
10
+ require 'test_bench/run/controls/random'
11
+ require 'test_bench/run/controls/status'
12
+ require 'test_bench/run/controls/time'
20
13
 
21
14
  require 'test_bench/run/controls/path'
22
15
 
23
- require 'test_bench/run/controls/event_data'
24
- require 'test_bench/run/controls/events/session'
25
-
26
- require 'test_bench/run/controls/executor'
16
+ require 'test_bench/run/controls/summary'
17
+ require 'test_bench/run/controls/summary/file'
18
+ require 'test_bench/run/controls/summary/file/totals'
19
+ require 'test_bench/run/controls/summary/file/info'
20
+ require 'test_bench/run/controls/summary/run'