1
0
Fork 0
mirror of https://github.com/puma/puma.git synced 2022-11-09 13:48:40 -05:00

Appveyor CI (#1374)

* 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
This commit is contained in:
Nikolay Vashchenko 2017-07-27 21:18:58 +03:00 committed by Nate Berkopec
parent 91416134cb
commit a31a62656d
7 changed files with 60 additions and 1 deletions

View file

@ -16,5 +16,5 @@ gem "jruby-openssl", :platform => "jruby"
gem "rubocop", "~> 0.49.1" gem "rubocop", "~> 0.49.1"
if %w(2.2.7 2.3.4 2.4.1).include? RUBY_VERSION 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 end

View file

@ -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 * [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) * [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 ## Capistrano deployment
Puma has support for Capistrano3 with an [external gem](https://github.com/seuros/capistrano-puma), you just need require that in Gemfile: Puma has support for Capistrano3 with an [external gem](https://github.com/seuros/capistrano-puma), you just need require that in Gemfile:

29
appveyor.yml Normal file
View file

@ -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

View file

@ -57,6 +57,10 @@ module SkipTestsBasedOnRubyEngine
def skip_on_jruby def skip_on_jruby
skip "Skipped on JRuby" if Puma.jruby? skip "Skipped on JRuby" if Puma.jruby?
end end
def skip_on_appveyor
skip "Skipped on Appveyor" if ENV["APPVEYOR"]
end
end end
Minitest::Test.include SkipTestsBasedOnRubyEngine Minitest::Test.include SkipTestsBasedOnRubyEngine

View file

@ -19,6 +19,7 @@ class TestBinder < Minitest::Test
end end
def test_localhost_addresses_dont_alter_listeners_for_ssl_addresses def test_localhost_addresses_dont_alter_listeners_for_ssl_addresses
skip_on_appveyor
skip_on_jruby skip_on_jruby
key = File.expand_path "../../examples/puma/puma_keypair.pem", __FILE__ key = File.expand_path "../../examples/puma/puma_keypair.pem", __FILE__

View file

@ -54,6 +54,7 @@ class TestIntegration < Minitest::Test
end end
def restart_server_and_listen(argv) def restart_server_and_listen(argv)
skip_on_appveyor
server(argv) server(argv)
s = connect s = connect
initial_reply = read_body(s) initial_reply = read_body(s)

View file

@ -48,6 +48,7 @@ class TestPathHandler < Minitest::Test
def test_handler_boots def test_handler_boots
skip_on_appveyor
in_handler(app) do |launcher| in_handler(app) do |launcher|
hit(["http://0.0.0.0:#{ launcher.connected_port }/test"]) hit(["http://0.0.0.0:#{ launcher.connected_port }/test"])
assert_equal("/test", @input["PATH_INFO"]) assert_equal("/test", @input["PATH_INFO"])