tryouts 3.7.0 → 3.7.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.
- checksums.yaml +4 -4
- data/lib/tryouts/cli/formatters/agent.rb +10 -16
- data/lib/tryouts/cli/opts.rb +6 -5
- data/lib/tryouts/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d3934c079df9042f8ef837ea6eb7dc14a04706a1fcba4853d26a5f1ce69672bf
|
4
|
+
data.tar.gz: adf6be71e206ad4747f83268370772ffdaeddfc6a9b49576bbd74cb6cf9b650c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d88b6998f1bd4d35329f501f4cbf710d1f653ca3faece95bc88c89ef626e6fe1413bd0129890817ff5d4cc15341e8c7bebd1209056cfc4fbd8bb730dc3ef4574
|
7
|
+
data.tar.gz: 3d919417a2bc28cebb759a77a340bd2dd996ed290de6a7b96c2fe40f4936d5df6d952242b6991fb12d34646e325699f0837f817fc5aa2b6e03257e6d903a541c
|
@@ -89,10 +89,11 @@ class Tryouts
|
|
89
89
|
end
|
90
90
|
|
91
91
|
def file_parsed(_file_path, test_count:, setup_present: false, teardown_present: false)
|
92
|
+
# Store per-file parsed test count for reference
|
93
|
+
# Total executed tests come from TestResultAggregator via grand_total()
|
92
94
|
if @current_file_data
|
93
95
|
@current_file_data[:tests] = test_count
|
94
96
|
end
|
95
|
-
@total_stats[:tests] += test_count
|
96
97
|
end
|
97
98
|
|
98
99
|
def parser_warnings(file_path, warnings:)
|
@@ -117,9 +118,7 @@ class Tryouts
|
|
117
118
|
end
|
118
119
|
|
119
120
|
def file_result(file_path, total_tests:, failed_count:, error_count:, elapsed_time: nil)
|
120
|
-
#
|
121
|
-
@total_stats[:failures] += failed_count
|
122
|
-
@total_stats[:errors] += error_count
|
121
|
+
# Update elapsed time (other stats come from TestResultAggregator via grand_total)
|
123
122
|
@total_stats[:elapsed_time] += elapsed_time if elapsed_time
|
124
123
|
|
125
124
|
# Update per-file data - file_result is called AFTER file_end, so data is in @collected_files
|
@@ -168,24 +167,19 @@ class Tryouts
|
|
168
167
|
|
169
168
|
# Summary operations - reliable trigger for rendering
|
170
169
|
def batch_summary(failure_collector)
|
171
|
-
#
|
172
|
-
|
173
|
-
total_tests: @total_stats[:tests],
|
174
|
-
failed_count: @collected_files.sum { |f| f[:failures].size },
|
175
|
-
error_count: @collected_files.sum { |f| f[:errors].size },
|
176
|
-
successful_files: @collected_files.size - @collected_files.count { |f| f[:failures].any? || f[:errors].any? },
|
177
|
-
total_files: @collected_files.size,
|
178
|
-
elapsed_time: @total_stats[:elapsed_time]
|
179
|
-
) unless @output_rendered
|
170
|
+
# NOTE: We don't render here because test_runner.rb calls grand_total directly
|
171
|
+
# with accurate counts from the TestResultAggregator
|
180
172
|
end
|
181
173
|
|
182
174
|
def grand_total(total_tests:, failed_count:, error_count:, successful_files:, total_files:, elapsed_time:)
|
183
175
|
return if @output_rendered # Prevent double rendering
|
184
176
|
|
177
|
+
# Use the accurate counts from TestResultAggregator (passed as parameters)
|
178
|
+
# NOT the parsed counts we accumulated in file_parsed()
|
185
179
|
@total_stats.merge!(
|
186
|
-
tests: total_tests,
|
187
|
-
failures: failed_count,
|
188
|
-
errors: error_count,
|
180
|
+
tests: total_tests, # Actual executed test count from aggregator
|
181
|
+
failures: failed_count, # Actual failures from aggregator
|
182
|
+
errors: error_count, # Actual errors from aggregator
|
189
183
|
successful_files: successful_files,
|
190
184
|
total_files: total_files,
|
191
185
|
elapsed_time: elapsed_time,
|
data/lib/tryouts/cli/opts.rb
CHANGED
@@ -73,17 +73,18 @@ class Tryouts
|
|
73
73
|
#=1> STDOUT content #=2> STDERR content #=<> Intentional failure
|
74
74
|
|
75
75
|
Exception Testing:
|
76
|
-
|
76
|
+
## Method 1: Rescue and test exception
|
77
77
|
begin
|
78
78
|
risky_operation
|
79
|
-
rescue
|
79
|
+
rescue MySpecificError => e
|
80
80
|
e.class
|
81
81
|
end
|
82
|
-
#=>
|
82
|
+
#=> MySpecificError
|
83
83
|
|
84
|
-
|
84
|
+
## Method 2: Let it raise and test with #=!> and #=~>
|
85
85
|
risky_operation
|
86
|
-
#=!>
|
86
|
+
#=!> MySpecificError
|
87
|
+
#=~> /Could not complete action/
|
87
88
|
HELP
|
88
89
|
|
89
90
|
class << self
|
data/lib/tryouts/version.rb
CHANGED