Skip to content

Commit c4272b4

Browse files
authored
Merge pull request #1155 from tildeio/test-sidekiq-8-sinatra-4
Test sidekiq 8, sinatra 4, grape 2
2 parents f060810 + cd4b07f commit c4272b4

File tree

10 files changed

+92
-15
lines changed

10 files changed

+92
-15
lines changed

.github/workflows/build.yml

Lines changed: 54 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ env:
1111
RAILS_ENV: development
1212
EMBEDDED_HTTP_SERVER_TIMEOUT: '30'
1313
WORKER_SPAWN_TIMEOUT: '15'
14-
CONFIG_DIGEST: d02685daad5f72653e1a4cb618d0e01ce9c0e801e03a3b76109e0d200e373cca
14+
CONFIG_DIGEST: 444c64919a840b6bbeded52d4d4bcc6285b3e6e6e0da9e09158aa4d0d87d201d
1515
'on':
1616
push:
1717
branches:
@@ -215,6 +215,51 @@ jobs:
215215
run: bundle exec rake
216216
needs:
217217
- ruby-3-4-default
218+
ruby-3-4-sidekiq-7-x:
219+
name: ruby 3.4, sidekiq-7.x
220+
runs-on: ubuntu-latest
221+
if: github.ref == 'refs/heads/main' || contains(github.event.pull_request.labels.*.name,
222+
'full-ci') || contains(github.event.pull_request.labels.*.name, 'sidekiq-7.x')
223+
services:
224+
redis:
225+
image: redis
226+
ports:
227+
- 6379:6379
228+
options: "--entrypoint redis-server"
229+
env:
230+
BUNDLE_GEMFILE: gemfiles/sidekiq-7.x/Gemfile
231+
steps:
232+
- name: Checkout
233+
uses: actions/checkout@v3
234+
- name: Setup ruby
235+
uses: ruby/setup-ruby@v1
236+
with:
237+
ruby-version: '3.4'
238+
- name: Install APT dependencies
239+
run: |
240+
sudo apt-get update
241+
sudo apt-get install -yq sqlite3 libsqlite3-dev
242+
- name: Setup cache (bundler)
243+
uses: actions/cache@v3
244+
with:
245+
path: "${{ github.workspace }}/vendor/bundle"
246+
key: "${{ runner.os }}-gems-3.4-sidekiq-7.x-${{ hashFiles('gemfiles/sidekiq-7.x/Gemfile.lock')
247+
}}"
248+
restore-keys: |-
249+
${{ runner.os }}-gems-3.4-sidekiq-7.x-
250+
${{ runner.os }}-gems-3.4-
251+
- name: bundle install
252+
run: "gem install bundler \nbundle install\n"
253+
- name: Run tests
254+
run: |
255+
bundle exec rake workflow:verify[$CONFIG_DIGEST]
256+
bundle exec rake
257+
- name: Run tests (agent disabled)
258+
env:
259+
SKYLIGHT_DISABLE_AGENT: 'true'
260+
run: bundle exec rake
261+
needs:
262+
- ruby-3-4-default
218263
ruby-3-2-graphql-2-0-17:
219264
name: ruby 3.2, graphql-2.0.17
220265
runs-on: ubuntu-latest
@@ -582,11 +627,11 @@ jobs:
582627
run: bundle exec rake
583628
needs:
584629
- ruby-3-4-default
585-
ruby-3-4-grape-1-x:
586-
name: ruby 3.4, grape-1.x
630+
ruby-3-4-grape-2-x:
631+
name: ruby 3.4, grape-2.x
587632
runs-on: ubuntu-latest
588633
if: github.ref == 'refs/heads/main' || contains(github.event.pull_request.labels.*.name,
589-
'full-ci') || contains(github.event.pull_request.labels.*.name, 'grape-1.x')
634+
'full-ci') || contains(github.event.pull_request.labels.*.name, 'grape-2.x')
590635
|| !contains(github.event.pull_request.labels.*.name, 'dependencies')
591636
services:
592637
redis:
@@ -595,7 +640,7 @@ jobs:
595640
- 6379:6379
596641
options: "--entrypoint redis-server"
597642
env:
598-
BUNDLE_GEMFILE: gemfiles/grape-1.x/Gemfile
643+
BUNDLE_GEMFILE: gemfiles/grape-2.x/Gemfile
599644
steps:
600645
- name: Checkout
601646
uses: actions/checkout@v3
@@ -611,10 +656,10 @@ jobs:
611656
uses: actions/cache@v3
612657
with:
613658
path: "${{ github.workspace }}/vendor/bundle"
614-
key: "${{ runner.os }}-gems-3.4-grape-1.x-${{ hashFiles('gemfiles/grape-1.x/Gemfile.lock')
659+
key: "${{ runner.os }}-gems-3.4-grape-2.x-${{ hashFiles('gemfiles/grape-2.x/Gemfile.lock')
615660
}}"
616661
restore-keys: |-
617-
${{ runner.os }}-gems-3.4-grape-1.x-
662+
${{ runner.os }}-gems-3.4-grape-2.x-
618663
${{ runner.os }}-gems-3.4-
619664
- name: bundle install
620665
run: "gem install bundler \nbundle install\n"
@@ -1008,13 +1053,14 @@ jobs:
10081053
- ruby-3-2-rails-7-1-x-mongo
10091054
- ruby-3-2-elasticsearch-elasticsearch
10101055
- ruby-3-1-sidekiq-5-x
1056+
- ruby-3-4-sidekiq-7-x
10111057
- ruby-3-2-graphql-2-0-17
10121058
- ruby-3-1-rails-7-1-x
10131059
- ruby-3-2-rails-7-1-x
10141060
- ruby-3-2-rails-7-2-x
10151061
- ruby-3-4-sinatra-2-x
10161062
- ruby-3-1-grape-1-x
1017-
- ruby-3-4-grape-1-x
1063+
- ruby-3-4-grape-2-x
10181064
- ruby-3-1-sequel-4
10191065
- ruby-3-4-sequel-5
10201066
- ruby-3-1-ams-0-9-x

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
- IMPROVEMENT Initial support for AWS Lambda
44
- BREAKING end support for Ruby 2.7 and 3.0
55
- BREAKING end support for Rails < 7.1
6+
- BUGFIX Fix an issue handling deserialization errors in Delayed::Job
67

78
## 6.1.0.beta (June 11, 2024)
89

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ruby ">= 2.7"
66

77
gem "grape", "~> 2.2.0"
88
gem "rails", "~> 8.0.0"
9-
gem "sinatra", "~> 3.0.0"
9+
gem "sinatra", "~> 4"
1010

1111
eval_gemfile "./gemfiles/Gemfile.additional"
1212

gemfiles/Gemfile.additional

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ gem "graphql", "~> 2.5.0"
88
gem "httpclient"
99
gem "rexml"
1010
gem "sequel", "> 0"
11-
gem "sidekiq", "< 8"
11+
gem "sidekiq", ENV['SIDEKIQ_VERSION'] || "~> 8"
1212
gem "sqlite3", "~> 2.1.0"
1313
gem "tilt"
1414
gem "haml"

gemfiles/grape-2.x/Gemfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
source "https://rubygems.org"
2+
3+
gemspec path: "../.."
4+
5+
gem "grape", "~> 2"
6+
7+
# Test additional libraries with oldest and newest versions of Grape
8+
eval_gemfile "../Gemfile.additional"

gemfiles/sidekiq-7.x/Gemfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
source "https://rubygems.org"
2+
3+
gemspec path: "../.."
4+
5+
# TODO: Check if we need Rails
6+
gem "rails", "~> 7.1.0"
7+
gem "sidekiq", "~> 7"
8+
gem "sqlite3", "~> 2"

gemfiles/sinatra-2.x/Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@ gemspec path: "../.."
44

55
gem "sinatra", "~> 2"
66

7+
ENV['SIDEKIQ_VERSION'] = "~> 7"
78
# Test additional libraries with oldest and newest versions of Sintra
89
eval_gemfile "../Gemfile.additional"

lib/tasks/workflow.rake

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,14 @@ module CITasks
7171
{ "dependency-name": "sidekiq", versions: [">= 6"] },
7272
]
7373
},
74+
"sidekiq-7.x" => {
75+
allow: [
76+
{ "dependency-name": "sidekiq" },
77+
],
78+
ignore: [
79+
{ "dependency-name": "sidekiq", versions: [">= 8"] },
80+
]
81+
},
7482
"sinatra-2.x" => {
7583
allow: [{ "dependency-name": "sinatra" }]
7684
# We don't limit this so that we're aware when new versions are released
@@ -118,6 +126,7 @@ module CITasks
118126
}
119127
},
120128
{ ruby_version: OLDEST_RUBY, gemfile: "sidekiq-5.x" },
129+
{ ruby_version: NEWEST_RUBY, gemfile: "sidekiq-7.x" },
121130
# We need to test either 1.8 or 1.9 since there are more changes in 1.10.
122131
# We probably don't need to test both
123132

@@ -138,8 +147,7 @@ module CITasks
138147
{ always_run: true, ruby_version: NEWEST_RUBY, gemfile: "sinatra-2.x" },
139148
{ ruby_version: NEWEST_RUBY, allow_failure: true, gemfile: "sinatra-edge" },
140149
{ ruby_version: OLDEST_RUBY, gemfile: "grape-1.x" },
141-
{ always_run: true, ruby_version: NEWEST_RUBY, gemfile: "grape-1.x" },
142-
# Oldest supported grape version. Doesn't support 3.0.
150+
{ always_run: true, ruby_version: NEWEST_RUBY, gemfile: "grape-2.x" },
143151
{ ruby_version: NEWEST_RUBY, allow_failure: true, gemfile: "grape-edge" },
144152
{ ruby_version: "3.1", gemfile: "sequel-4" },
145153
{ ruby_version: NEWEST_RUBY, gemfile: "sequel-5" },

spec/integration/probes/sinatra_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"SinatraTest",
1717
Class.new(::Sinatra::Base) do
1818
disable :show_exceptions
19+
set :host_authorization, { permitted_hosts: [] }
1920

2021
template :hello do
2122
"Hello from named template"

spec/unit/sidekiq_spec.rb

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,15 @@
1212
module Skylight
1313
describe "Sidekiq" do
1414
def server_middleware
15-
sidekiq_7? ? ::Sidekiq.default_configuration.server_middleware : ::Sidekiq.server_middleware
15+
sidekiq_gte_7? ? ::Sidekiq.default_configuration.server_middleware : ::Sidekiq.server_middleware
1616
end
1717

18-
def sidekiq_7?
19-
::Sidekiq::VERSION =~ /\A7/
18+
def sidekiq_gte_7?
19+
sidekiq_version >= Gem::Version.new("7")
20+
end
21+
22+
def sidekiq_version
23+
Gem::Version.new(::Sidekiq::VERSION)
2024
end
2125

2226
after :each do

0 commit comments

Comments
 (0)