Skip to content

Commit

Permalink
Appveyor CI (puma#1374)
Browse files Browse the repository at this point in the history
* appveyour config

* proper platforms for windows

* disabling tests with ssl and interrupts

* excessive ssl setup

* fixed message

* adding info in readme regarding stopgap_13632

* formatting

* trailing spaces
  • Loading branch information
NikolayRys authored and nateberkopec committed Jul 27, 2017
1 parent 9141613 commit a31a626
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ gem "jruby-openssl", :platform => "jruby"
gem "rubocop", "~> 0.49.1"

if %w(2.2.7 2.3.4 2.4.1).include? RUBY_VERSION
gem "stopgap_13632", "~> 1.0", :platform => "mri"
gem "stopgap_13632", "~> 1.0", :platforms => ["mri", "mingw", "x64_mingw"]
end
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,29 @@ reliability in production environments:
* [tools/jungle](https://github.com/puma/puma/tree/master/tools/jungle) for sysvinit (init.d) and upstart
* [docs/systemd](https://github.com/puma/puma/blob/master/docs/systemd.md)

## Known bugs
For MRI versions 2.2.7, 2.3.4 and 2.4.1 you may start erratically get the following exception in places where it should not happen:
```ruby
stream closed in another thread (IOError)
```
If that's the case then it might be caused by ruby bug https://bugs.ruby-lang.org/issues/13632 and it could be temporary fixed with the gem https://rubygems.org/gems/stopgap_13632.
Add to gemfile:
```
if %w(2.2.7 2.3.4 2.4.1).include? RUBY_VERSION
gem "stopgap_13632", "~> 1.0", :platforms => ["mri", "mingw", "x64_mingw"]
end
```
Don't forget to require it:
```
require 'stopgap_13632'
```
And when an "IOError: stream closed" happens in a thread, accessing a busy IO, catch it and call the following method:
```
rescue IOError
Thread.current.purge_interrupt_queue
end
```

## Capistrano deployment

Puma has support for Capistrano3 with an [external gem](https://github.com/seuros/capistrano-puma), you just need require that in Gemfile:
Expand Down
29 changes: 29 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
install:
- set PATH=C:\MinGW\bin;C:\Ruby%ruby_version%\bin;%PATH%
- set RAKEOPT=-rdevkit
- set DISABLE_SSL=true
- set APPVEYOR=true
- ruby --version
- gem --version
- bundle --version
- bundle install

test_script:
- bundle exec rake

environment:
matrix:
- ruby_version: "24"
- ruby_version: "24-x64"
- ruby_version: "23"
- ruby_version: "23-x64"
- ruby_version: "22"
- ruby_version: "22-x64"
- ruby_version: "21"
- ruby_version: "21-x64"

branches:
only:
- master

build: off
4 changes: 4 additions & 0 deletions test/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ module SkipTestsBasedOnRubyEngine
def skip_on_jruby
skip "Skipped on JRuby" if Puma.jruby?
end

def skip_on_appveyor
skip "Skipped on Appveyor" if ENV["APPVEYOR"]
end
end

Minitest::Test.include SkipTestsBasedOnRubyEngine
1 change: 1 addition & 0 deletions test/test_binder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def test_localhost_addresses_dont_alter_listeners_for_tcp_addresses
end

def test_localhost_addresses_dont_alter_listeners_for_ssl_addresses
skip_on_appveyor
skip_on_jruby

key = File.expand_path "../../examples/puma/puma_keypair.pem", __FILE__
Expand Down
1 change: 1 addition & 0 deletions test/test_integration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ def server(argv)
end

def restart_server_and_listen(argv)
skip_on_appveyor
server(argv)
s = connect
initial_reply = read_body(s)
Expand Down
1 change: 1 addition & 0 deletions test/test_rack_handler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def in_handler(app, options = {})


def test_handler_boots
skip_on_appveyor
in_handler(app) do |launcher|
hit(["http://0.0.0.0:#{ launcher.connected_port }/test"])
assert_equal("/test", @input["PATH_INFO"])
Expand Down

0 comments on commit a31a626

Please sign in to comment.