Skip to content

Commit d76dd11

Browse files
authored
Add coverage workflow, require 100% coverage. (#167)
1 parent e68ea24 commit d76dd11

File tree

4 files changed

+63
-4
lines changed

4 files changed

+63
-4
lines changed

.github/workflows/coverage.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Coverage
2+
3+
on: [push, pull_request]
4+
5+
env:
6+
COVERAGE: PartialSummary
7+
CONSOLE_OUTPUT: Text
8+
9+
jobs:
10+
test:
11+
name: ${{matrix.ruby}} on ${{matrix.os}}
12+
runs-on: ${{matrix.os}}-latest
13+
14+
strategy:
15+
matrix:
16+
os:
17+
- ubuntu
18+
- macos
19+
20+
ruby:
21+
- "3.1"
22+
23+
steps:
24+
- uses: actions/checkout@v3
25+
- uses: ruby/setup-ruby@v1
26+
with:
27+
ruby-version: ${{matrix.ruby}}
28+
bundler-cache: true
29+
30+
- name: Run tests
31+
timeout-minutes: 5
32+
run: bundle exec rspec
33+
34+
- uses: actions/upload-artifact@v2
35+
with:
36+
name: coverage-${{matrix.os}}-${{matrix.ruby}}
37+
path: .covered.db
38+
39+
validate:
40+
needs: test
41+
runs-on: ubuntu-latest
42+
43+
steps:
44+
- uses: actions/checkout@v3
45+
- uses: ruby/setup-ruby@v1
46+
with:
47+
ruby-version: "3.1"
48+
bundler-cache: true
49+
50+
- uses: actions/download-artifact@v3
51+
52+
- name: Validate coverage
53+
timeout-minutes: 5
54+
run: bundle exec bake covered:validate --paths */.covered.db \;

.github/workflows/development.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
experimental: true
3333

3434
steps:
35-
- uses: actions/checkout@v2
35+
- uses: actions/checkout@v3
3636
- uses: ruby/setup-ruby@v1
3737
with:
3838
ruby-version: ${{matrix.ruby}}

.github/workflows/external.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- "head"
1818

1919
steps:
20-
- uses: actions/checkout@v2
20+
- uses: actions/checkout@v3
2121
- uses: ruby/setup-ruby@v1
2222
with:
2323
ruby-version: ${{matrix.ruby}}

spec/async/wrapper_spec.rb

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,16 @@
8686
describe '#wait_priority' do
8787
let(:pipe) {::Socket.pair(:UNIX, :STREAM)}
8888

89-
it "can wait to be priority" do
89+
it "can invoke wait_priority on the underlying io" do
90+
expect(output.io).to receive(:wait_priority).and_return(true)
91+
output.wait_priority
92+
end
93+
94+
it "can wait for out of band data" do
9095
begin
9196
# I've tested this successfully on Linux but it fails on Darwin.
9297
input.io.send('!', Socket::MSG_OOB)
93-
rescue Errno::EOPNOTSUPP => error
98+
rescue => error
9499
skip error.message
95100
end
96101

0 commit comments

Comments
 (0)