19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
# File 'lib/testrail_rspec_formatter/formatter.rb', line 19
def dump_summary(notification)
disabled = testrail_config_value(:disabled, "TESTRAIL_FORMATTER_DISABLED", false)
if disabled == "1" || disabled == true
testrail_log "skipped because it was disabled"
return
end
testrail_log "starting..."
examples = notification.examples
results = []
examples.each do |example|
testrail_metadata = example.metadata[:testrail]
next unless testrail_metadata
result = {
case_id: testrail_metadata,
status_id: testrail_status(example),
}
results << result
end
if results.empty?
testrail_log "no test cases found (no spec had a testrail tag)"
else
post_testrail_results(results)
end
ensure
testrail_log "finished"
end
|