Skip to content

Commit 27ae0a3

Browse files
committed
Added ruby test for skipped tests
1 parent a31a308 commit 27ae0a3

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

ruby/tests/annotate_test.rb

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -581,4 +581,22 @@
581581

582582
assert_equal 0, status.exitstatus
583583
end
584+
585+
it "correctly parses skipped tests" do
586+
stdout, stderr, status = Open3.capture3("#{__dir__}/../bin/annotate", "#{__dir__}/skipped-test/")
587+
588+
assert_equal stderr, <<~OUTPUT
589+
Parsing junit.xml
590+
--- ✍️ Preparing annotation
591+
OUTPUT
592+
593+
assert_equal stdout, <<~OUTPUT
594+
Failures: 0
595+
Errors: 0
596+
Skipped: 1
597+
Total tests: 2
598+
OUTPUT
599+
600+
assert_equal 0, status.exitstatus
601+
end
584602
end

ruby/tests/skipped-test/junit.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<testsuite name="rspec" tests="2" skipped="1" 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 500 if the account is ABC" 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 250 by default" file="./spec/models/account_spec.rb" time="0">
5+
<skipped message="because of reasons" />
6+
</testcase>
7+
</testsuite>

0 commit comments

Comments
 (0)