Skip to content

Commit c8d8093

Browse files
committed
Change <testcase> selector to only apply to direct descendants.
In the case where JUnit output contains nested `<testsuite>` entries the `//testsuite//testcase` selector retrieves three elements for each `<testcase>`. This change causes the iterator to only process each test case entry once.
1 parent e46bcf2 commit c8d8093

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ruby/bin/annotate

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ junit_report_files.sort.each do |file|
5252
xml = File.read(file)
5353
doc = REXML::Document.new(xml)
5454

55-
REXML::XPath.each(doc, '//testsuite//testcase') do |testcase|
55+
REXML::XPath.each(doc, '//testsuite/testcase') do |testcase|
5656
testcases += 1
5757
name = testcase.attributes['name'].to_s
5858
failed_test = testcase.attributes[failure_format].to_s

0 commit comments

Comments
 (0)