diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 00000000..b5b15333 --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,54 @@ +name: Coverage + +on: [push, pull_request] + +env: + COVERAGE: PartialSummary + CONSOLE_OUTPUT: Text + +jobs: + test: + name: ${{matrix.ruby}} on ${{matrix.os}} + runs-on: ${{matrix.os}}-latest + + strategy: + matrix: + os: + - ubuntu + - macos + + ruby: + - "3.1" + + steps: + - uses: actions/checkout@v3 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{matrix.ruby}} + bundler-cache: true + + - name: Run tests + timeout-minutes: 5 + run: bundle exec rspec + + - uses: actions/upload-artifact@v2 + with: + name: coverage-${{matrix.os}}-${{matrix.ruby}} + path: .covered.db + + validate: + needs: test + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: "3.1" + bundler-cache: true + + - uses: actions/download-artifact@v3 + + - name: Validate coverage + timeout-minutes: 5 + run: bundle exec bake covered:validate --paths */.covered.db \; diff --git a/.github/workflows/development.yml b/.github/workflows/development.yml index e9fe4098..7f5939f7 100644 --- a/.github/workflows/development.yml +++ b/.github/workflows/development.yml @@ -32,7 +32,7 @@ jobs: experimental: true steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: ruby/setup-ruby@v1 with: ruby-version: ${{matrix.ruby}} diff --git a/.github/workflows/external.yml b/.github/workflows/external.yml index 1ac12502..5874488d 100644 --- a/.github/workflows/external.yml +++ b/.github/workflows/external.yml @@ -17,7 +17,7 @@ jobs: - "head" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: ruby/setup-ruby@v1 with: ruby-version: ${{matrix.ruby}} diff --git a/spec/async/wrapper_spec.rb b/spec/async/wrapper_spec.rb index f15b8695..44e731cb 100644 --- a/spec/async/wrapper_spec.rb +++ b/spec/async/wrapper_spec.rb @@ -86,11 +86,16 @@ describe '#wait_priority' do let(:pipe) {::Socket.pair(:UNIX, :STREAM)} - it "can wait to be priority" do + it "can invoke wait_priority on the underlying io" do + expect(output.io).to receive(:wait_priority).and_return(true) + output.wait_priority + end + + it "can wait for out of band data" do begin # I've tested this successfully on Linux but it fails on Darwin. input.io.send('!', Socket::MSG_OOB) - rescue Errno::EOPNOTSUPP => error + rescue => error skip error.message end