Skip to content

Commit eb4a16c

Browse files
authored
Merge pull request #139 from cursande/master
Allow junits_dir to match hidden files and dirs
2 parents ec9b4d5 + d1af7b9 commit eb4a16c

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

ruby/bin/annotate

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ end
2525
class Timing < Struct.new(:name, :unit_name, :time)
2626
end
2727

28-
junit_report_files = Dir.glob(File.join(junits_dir, "**", "*"))
28+
junit_report_files = Dir.glob(File.join(junits_dir, "**", "*"), File::FNM_DOTMATCH)
2929
testcases = 0
3030
failures = []
3131
timings = []
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<testsuite name="rspec" tests="2" skipped="0" failures="0" errors="0" time="49.290713" timestamp="2018-04-18T23:29:42+00:00" hostname="626d214475e4">
3+
<testcase classname="spec.models.account_spec" name="Account#maximum_jobs_added_by_pipeline_changer returns 700 if the account is XYZ" file="./spec/models/account_spec.rb" time="0.020013"/>
4+
<testcase classname="spec.models.account_spec" name="Account#maximum_jobs_added_by_pipeline_changer returns 900 if the account is F00" file="./spec/models/account_spec.rb" time="0.020013"/>
5+
</testsuite>

ruby/tests/annotate_test.rb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -521,4 +521,17 @@
521521

522522
assert_equal 0, status.exitstatus
523523
end
524+
525+
it "handles junit dir paths with hidden directories" do
526+
output, status = Open3.capture2e("#{__dir__}/../bin/annotate", "#{__dir__}/.tests-in-hidden-dir/")
527+
528+
assert_equal <<~OUTPUT, output
529+
Parsing junit-1.xml
530+
--- ❓ Checking failures
531+
2 testcases found
532+
There were no failures/errors 🙌
533+
OUTPUT
534+
535+
assert_equal 0, status.exitstatus
536+
end
524537
end

0 commit comments

Comments
 (0)