Skip to content

Commit

Permalink
Fix broken workflows. (#421)
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix authored Dec 15, 2024
1 parent 3f37538 commit 404ad69
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 14 deletions.
40 changes: 31 additions & 9 deletions .github/workflows/development.yml → .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,60 @@
name: Development
name: Test

on: [push, pull_request]
on:
push:
branches:
- master
pull_request:
branches:
- master

permissions:
contents: read

jobs:
test:
name: ${{matrix.ruby}} ${{matrix.gemfile}}
runs-on: ${{matrix.os}}-latest
continue-on-error: ${{matrix.experimental}}

env:
BUNDLE_GEMFILE: ${{matrix.gemfile}}

strategy:
matrix:
experimental: [false]

os:
- ubuntu
- macos

ruby:
- 2.5
- 2.6
- 2.7
- 3.0
- 3.1
- 3.2
- 3.3

gemfile: ["Gemfile"]

include:
- experimental: false
os: macos
ruby: 3.3
gemfile: gems/rack-v2.rb
- experimental: true
os: ubuntu
ruby: head
gemfile: gems/rack-v2.rb
- experimental: true
os: ubuntu
ruby: 2.7
env: BUNDLE_GEMFILE=gems/rack-v1.rb
gemfile: gems/rack-v1.rb
- experimental: true
os: ubuntu
ruby: 3.2
env: BUNDLE_GEMFILE=gems/rack-v2.rb
gemfile: gems/rack-v2.rb
# enable when rack v3 is supported
# - experimental: true
# os: ubuntu
Expand All @@ -41,12 +63,12 @@ jobs:

steps:
- uses: actions/checkout@v3

- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{matrix.ruby}}

- name: Install dependencies
run: ${{matrix.env}} bundle install
bundler-cache: true

- name: Run tests
run: ${{matrix.env}} bundle exec rake
timeout-minutes: 10
run: bundle exec rake
6 changes: 4 additions & 2 deletions spec/daemonizing_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def name

pid = subject.pid

subject.kill(1)
subject.kill(10)

expect(File.exist?(subject.pid_file)).to be_falsey
expect(Process.running?(pid)).to be_falsey
Expand Down Expand Up @@ -183,6 +183,8 @@ def name
private

def wait_for_server_to_start
expect{sleep 0.1 until File.exist?(subject.pid_file)}.to take_less_then(10)
until File.exist?(subject.pid_file)
sleep(0.1)
end
end
end
2 changes: 1 addition & 1 deletion spec/server/tcp_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
end

it "should retrieve remote address" do
expect(get('/')).to include('"REMOTE_ADDR"=>"127.0.0.1"')
expect(get('/')).to be =~ /"REMOTE_ADDR"\s*=>\s*"127.0.0.1"/
end

after do
Expand Down
4 changes: 2 additions & 2 deletions spec/server/unix_socket_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
expect(get("/?this")).to include('this')
end

it "should retreive remote address" do
expect(get('/')).to include('"REMOTE_ADDR"=>"127.0.0.1"')
it "should retreive remote address" do
expect(get('/')).to be =~ /"REMOTE_ADDR"\s*=>\s*"127.0.0.1"/
end

it "should remove socket file after server stops" do
Expand Down

0 comments on commit 404ad69

Please sign in to comment.