Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Add Ruby 3.2 #139

Merged
merged 3 commits into from Mar 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/linux.yml
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: [ '3.1', '3.0', '2.7' ]
ruby: [ '3.2', '3.1', '3.0', '2.7' ]
os:
- ubuntu-latest
name: Unit testing with Ruby ${{ matrix.ruby }} on ${{ matrix.os }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/windows.yml
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: [ '3.1', '2.7' ]
ruby: [ '3.2', '3.1', '2.7' ]
os:
- windows-latest
include:
Expand Down
4 changes: 2 additions & 2 deletions serverengine.gemspec
Expand Up @@ -21,8 +21,8 @@ Gem::Specification.new do |gem|
gem.add_dependency "sigdump", ["~> 0.2.2"]

# rake v12.x doesn't work with rspec 2. rspec should be updated to 3
gem.add_development_dependency "rake", ["~> 11.0"]
gem.add_development_dependency "rspec", ["~> 2.13.0"]
gem.add_development_dependency "rake", ["~> 13.0"]
gem.add_development_dependency "rspec", ["~> 3.12.0"]

gem.add_development_dependency 'rake-compiler-dock', ['~> 0.5.0']
gem.add_development_dependency 'rake-compiler', ['~> 0.9.4']
Expand Down
4 changes: 2 additions & 2 deletions spec/daemon_logger_spec.rb
Expand Up @@ -150,7 +150,7 @@
end

it 'inter-process locking on rotation' do
pending "fork is not implemented in Windows" if ServerEngine.windows?
skip "fork is not implemented in Windows" if ServerEngine.windows?

log = DaemonLogger.new("tmp/se4.log", level: 'trace', log_rotate_age: 3, log_rotate_size: 10)
r, w = IO.pipe
Expand All @@ -175,7 +175,7 @@
end

it 'reopen log when path is renamed' do
pending "rename isn't supported on windows" if ServerEngine.windows?
skip "rename isn't supported on windows" if ServerEngine.windows?

log = DaemonLogger.new("tmp/rotate.log", { level: 'info', log_rotate_age: 0 })

Expand Down
10 changes: 5 additions & 5 deletions spec/daemon_spec.rb
Expand Up @@ -11,7 +11,7 @@
end

it 'run and graceful stop by signal' do
pending "not supported signal base commands on Windows" if ServerEngine.windows?
skip "not supported signal base commands on Windows" if ServerEngine.windows?

dm = Daemon.new(TestServer, TestWorker, daemonize: true, pid_path: "tmp/pid", command_sender: "signal")
dm.main
Expand All @@ -33,7 +33,7 @@
end

it 'signals' do
pending "not supported signal base commands on Windows" if ServerEngine.windows?
skip "not supported signal base commands on Windows" if ServerEngine.windows?
dm = Daemon.new(TestServer, TestWorker, daemonize: true, pid_path: "tmp/pid", command_sender: "signal")
dm.main

Expand Down Expand Up @@ -112,7 +112,7 @@
end

it 'exits with status 0 when it was stopped normally' do
pending "worker type process(fork) cannot be used in Windows" if ServerEngine.windows?
skip "worker type process(fork) cannot be used in Windows" if ServerEngine.windows?
dm = Daemon.new(
TestServer,
TestWorker,
Expand All @@ -135,7 +135,7 @@
end

it 'exits with status of workers if worker exits with status specified in unrecoverable_exit_codes, without supervisor' do
pending "worker type process(fork) cannot be used in Windows" if ServerEngine.windows?
skip "worker type process(fork) cannot be used in Windows" if ServerEngine.windows?

dm = Daemon.new(
TestServer,
Expand All @@ -159,7 +159,7 @@
end

it 'exits with status of workers if worker exits with status specified in unrecoverable_exit_codes, with supervisor' do
pending "worker type process(fork) cannot be used in Windows" if ServerEngine.windows?
skip "worker type process(fork) cannot be used in Windows" if ServerEngine.windows?

dm = Daemon.new(
TestServer,
Expand Down
14 changes: 7 additions & 7 deletions spec/multi_process_server_spec.rb
Expand Up @@ -17,7 +17,7 @@
end

it 'scale up' do
pending "Windows environment does not support fork" if ServerEngine.windows? && impl_class == ServerEngine::MultiProcessServer
skip "Windows environment does not support fork" if ServerEngine.windows? && impl_class == ServerEngine::MultiProcessServer

config = {
workers: 2,
Expand Down Expand Up @@ -50,7 +50,7 @@
end

it 'scale down' do
pending "Windows environment does not support fork" if ServerEngine.windows? && impl_class == ServerEngine::MultiProcessServer
skip "Windows environment does not support fork" if ServerEngine.windows? && impl_class == ServerEngine::MultiProcessServer

config = {
workers: 2,
Expand Down Expand Up @@ -98,7 +98,7 @@
end

it 'raises SystemExit when all workers exit with specified code by unrecoverable_exit_codes' do
pending "Windows environment does not support fork" if ServerEngine.windows? && impl_class == ServerEngine::MultiProcessServer
skip "Windows environment does not support fork" if ServerEngine.windows? && impl_class == ServerEngine::MultiProcessServer

config = {
workers: 4,
Expand Down Expand Up @@ -127,7 +127,7 @@
end

it 'raises SystemExit immediately when a worker exits if stop_immediately_at_unrecoverable_exit specified' do
pending "Windows environment does not support fork" if ServerEngine.windows? && impl_class == ServerEngine::MultiProcessServer
skip "Windows environment does not support fork" if ServerEngine.windows? && impl_class == ServerEngine::MultiProcessServer

config = {
workers: 4,
Expand Down Expand Up @@ -172,7 +172,7 @@
end

it 'stop' do
pending "Windows environment does not support fork" if ServerEngine.windows?
skip "Windows environment does not support fork" if ServerEngine.windows?

config = {
workers: 1,
Expand All @@ -197,7 +197,7 @@
end

it 'non zero exit status' do
pending "Windows environment does not support fork" if ServerEngine.windows?
skip "Windows environment does not support fork" if ServerEngine.windows?

config = {
workers: 1,
Expand Down Expand Up @@ -232,7 +232,7 @@ def initialize
end

it 'zero exit status' do
pending "Windows environment does not support fork" if ServerEngine.windows?
skip "Windows environment does not support fork" if ServerEngine.windows?

config = {
workers: 1,
Expand Down
5 changes: 1 addition & 4 deletions spec/spec_helper.rb
@@ -1,9 +1,6 @@
require 'bundler'
require 'rspec'

RSpec.configure do |config|
config.color_enabled = true
end
require 'fileutils'

begin
Bundler.setup(:default, :test)
Expand Down
12 changes: 6 additions & 6 deletions spec/supervisor_spec.rb
Expand Up @@ -90,7 +90,7 @@ def start_daemon(**config)
context "when using #{sender} as command_sender" do

it 'start and graceful stop' do
pending 'not supported on Windows' if ServerEngine.windows? && sender == 'signal'
skip 'not supported on Windows' if ServerEngine.windows? && sender == 'signal'

sv, t = start_supervisor(command_sender: sender)

Expand All @@ -113,7 +113,7 @@ def start_daemon(**config)
end

it 'immediate stop' do
pending 'not supported on Windows' if ServerEngine.windows? && sender == 'signal'
skip 'not supported on Windows' if ServerEngine.windows? && sender == 'signal'

sv, t = start_supervisor(command_sender: sender)

Expand All @@ -131,7 +131,7 @@ def start_daemon(**config)
end

it 'graceful restart' do
pending 'not supported on Windows' if ServerEngine.windows? && sender == 'signal'
skip 'not supported on Windows' if ServerEngine.windows? && sender == 'signal'

sv, t = start_supervisor(command_sender: sender)

Expand All @@ -155,7 +155,7 @@ def start_daemon(**config)
end

it 'immediate restart' do
pending 'not supported on Windows' if ServerEngine.windows? && sender == 'signal'
skip 'not supported on Windows' if ServerEngine.windows? && sender == 'signal'

sv, t = start_supervisor(command_sender: sender)

Expand All @@ -179,7 +179,7 @@ def start_daemon(**config)
end

it 'reload' do
pending 'not supported on Windows' if ServerEngine.windows? && sender == 'signal'
skip 'not supported on Windows' if ServerEngine.windows? && sender == 'signal'

sv, t = start_supervisor(command_sender: sender)

Expand All @@ -200,7 +200,7 @@ def start_daemon(**config)
# TODO detach

it 'auto restart in limited ratio' do
pending 'not supported on Windows' if ServerEngine.windows? && sender == 'signal'
skip 'not supported on Windows' if ServerEngine.windows? && sender == 'signal'

RR.stub(ServerEngine).dump_uncaught_error

Expand Down