minitest-reporters-llm 0.2.0 → 0.3.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/README.md +1 -1
- data/bin/console +1 -1
- data/lib/minitest/reporters/llm/version.rb +1 -1
- data/lib/minitest/reporters/llm_reporter.rb +34 -10
- 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: 24396eca3f60964a6fc94b3db54b83149aa25909a82bf7873ebf895a7d5062bd
|
|
4
|
+
data.tar.gz: 5a1a2994edb32c87ea66180d093ab156a1a83ae2ebe2ebcf4770683c139a2612
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 64a020be84bc34733523a8714f10e45493c22212e8e6ab55303235e0df07b20e2f6ed4e417c47d64272fd2e5da0ec3230fed4f8369d2882c5adadd97c7e7dccc
|
|
7
|
+
data.tar.gz: 5106fc7514430d1fb726a2147ba8d4b98801e7895c167e69ab23d445f8f033daffd74fd96befcc831867e8cd85b4227a50c4391416394f2a393fdc4fe5194096
|
data/README.md
CHANGED
|
@@ -107,7 +107,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
|
107
107
|
- **Dual output modes**: Compact for LLMs, verbose for humans
|
|
108
108
|
- **Configurable file paths**: No hardcoded temporary directories
|
|
109
109
|
- **TOML/JSON reports**: Structured data export for further analysis
|
|
110
|
-
- **
|
|
110
|
+
- **Minimal dependencies**: Built on minitest and minitest-reporters
|
|
111
111
|
|
|
112
112
|
## Why Use This Reporter?
|
|
113
113
|
|
data/bin/console
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# frozen_string_literal: true
|
|
3
3
|
|
|
4
4
|
require 'bundler/setup'
|
|
5
|
-
require 'minitest/llm
|
|
5
|
+
require 'minitest/reporters/llm'
|
|
6
6
|
|
|
7
7
|
# You can add fixtures and/or initialization code here to make experimenting
|
|
8
8
|
# with your gem easier. You can also use a different console, if you like.
|
|
@@ -11,6 +11,9 @@ module Minitest
|
|
|
11
11
|
|
|
12
12
|
def initialize(options = {})
|
|
13
13
|
super
|
|
14
|
+
custom_io = options.delete(:io)
|
|
15
|
+
@io = custom_io if custom_io
|
|
16
|
+
|
|
14
17
|
@options = default_options.merge(options)
|
|
15
18
|
@results_file = @options[:results_file]
|
|
16
19
|
@report_file = @options[:report_file]
|
|
@@ -26,8 +29,19 @@ module Minitest
|
|
|
26
29
|
|
|
27
30
|
def record(result)
|
|
28
31
|
super
|
|
32
|
+
status =
|
|
33
|
+
if result.skipped?
|
|
34
|
+
'skip'
|
|
35
|
+
elsif result.error?
|
|
36
|
+
'error'
|
|
37
|
+
elsif result.passed?
|
|
38
|
+
'pass'
|
|
39
|
+
else
|
|
40
|
+
'fail'
|
|
41
|
+
end
|
|
42
|
+
|
|
29
43
|
test_key = "#{result.klass}##{result.name}"
|
|
30
|
-
@current_results[test_key] =
|
|
44
|
+
@current_results[test_key] = status
|
|
31
45
|
end
|
|
32
46
|
|
|
33
47
|
def report
|
|
@@ -195,7 +209,7 @@ module Minitest
|
|
|
195
209
|
end
|
|
196
210
|
|
|
197
211
|
def show_failure_details
|
|
198
|
-
failed_tests = tests_list.select { |t| t.failure && !t.skipped? }
|
|
212
|
+
failed_tests = tests_list.select { |t| t.failure && !t.skipped? && !t.error? }
|
|
199
213
|
error_tests = tests_list.select { |t| t.failure && t.error? }
|
|
200
214
|
|
|
201
215
|
return unless failed_tests.any? || error_tests.any?
|
|
@@ -260,10 +274,11 @@ module Minitest
|
|
|
260
274
|
|
|
261
275
|
@current_results.each do |test_key, status|
|
|
262
276
|
previous_status = @previous_results[test_key]
|
|
277
|
+
next unless previous_status
|
|
263
278
|
|
|
264
|
-
if previous_status == 'pass' && status
|
|
279
|
+
if previous_status == 'pass' && %w[fail error].include?(status)
|
|
265
280
|
new_failures << test_key_to_location(test_key)
|
|
266
|
-
elsif
|
|
281
|
+
elsif %w[fail error skip].include?(previous_status) && status == 'pass'
|
|
267
282
|
fixes << test_key_to_location(test_key)
|
|
268
283
|
end
|
|
269
284
|
end
|
|
@@ -280,8 +295,10 @@ module Minitest
|
|
|
280
295
|
|
|
281
296
|
@current_results.each do |test_key, status|
|
|
282
297
|
previous_status = @previous_results[test_key]
|
|
283
|
-
|
|
284
|
-
|
|
298
|
+
next unless previous_status
|
|
299
|
+
|
|
300
|
+
new_failures += 1 if previous_status == 'pass' && %w[fail error].include?(status)
|
|
301
|
+
fixes += 1 if %w[fail error skip].include?(previous_status) && status == 'pass'
|
|
285
302
|
end
|
|
286
303
|
|
|
287
304
|
puts "REG +#{new_failures} -#{fixes}" if new_failures.positive? || fixes.positive?
|
|
@@ -327,8 +344,10 @@ module Minitest
|
|
|
327
344
|
fixes = []
|
|
328
345
|
@current_results.each do |k, status|
|
|
329
346
|
prev = @previous_results[k]
|
|
330
|
-
|
|
331
|
-
|
|
347
|
+
next unless prev
|
|
348
|
+
|
|
349
|
+
new_failures << test_key_to_location(k) if prev == 'pass' && %w[fail error].include?(status)
|
|
350
|
+
fixes << test_key_to_location(k) if %w[fail error skip].include?(prev) && status == 'pass'
|
|
332
351
|
end
|
|
333
352
|
data[:regressions] = { new_failures: new_failures, fixes: fixes }
|
|
334
353
|
end
|
|
@@ -361,8 +380,13 @@ module Minitest
|
|
|
361
380
|
key = k.to_s
|
|
362
381
|
case v
|
|
363
382
|
when Array
|
|
364
|
-
|
|
365
|
-
|
|
383
|
+
if v.empty?
|
|
384
|
+
lines << "#{key} = []"
|
|
385
|
+
else
|
|
386
|
+
escaped = v.map { |s| s.to_s.gsub('\\', '\\\\').gsub('"', '\\"') }
|
|
387
|
+
joined = escaped.join('", "')
|
|
388
|
+
lines << "#{key} = [\"#{joined}\"]"
|
|
389
|
+
end
|
|
366
390
|
when String
|
|
367
391
|
val = v.to_s.gsub('\\', '\\\\').gsub('"', '\\"')
|
|
368
392
|
lines << "#{key} = \"#{val}\""
|