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

Harmonize Rack dependency and tests #27

Merged
merged 27 commits into from
Nov 11, 2024
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,13 @@ jobs:
- name: Standard (Lint)
run: bundle exec rake standard
test:
name: Specs
name: "Specs (Rack 2 and 3)"
runs-on: ubuntu-22.04
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
strategy:
matrix:
ruby:
- "2.7"
- "3.2"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this intentionall removed? Testing on a recent Ruby version seems useful.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, because then the matrix turns into 4 versions - and I had some trouble loading older ActiveRecord on the newer Ruby versions. I presume what works on 2.7 will work on 3.x anyway, so it felt like a good comproimse

services:
mysql:
image: mysql:5.7
Expand Down Expand Up @@ -71,8 +70,8 @@ jobs:
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: RSpec
run: bundle exec rspec
- name: RSpec via Appraisal
run: "bundle exec appraisal install && bundle exec appraisal rspec"
env:
MYSQL_HOST: 127.0.0.1
MYSQL_PORT: 3306
Expand Down
9 changes: 9 additions & 0 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
appraise "rack-3" do
gem "rack", ">= 3.0"
gem "activerecord", "~> 7.0", "< 9.0"
end

appraise "rack-2" do
gem "rack", ">= 2.0", "< 3.0"
gem "activerecord", "~> 6", "< 7.0"
end
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.3.0

- Streamline integration with both Rack 2 and 3, add tests for request fingerprinting.

## 1.2.2

- Support `#to_ary` on Rack response bodies on newer Rails/Rack versions
Expand Down
6 changes: 5 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
require "bundler/gem_tasks"
require "rspec/core/rake_task"
require "standard/rake"
require "appraisal"

RSpec::Core::RakeTask.new(:spec)

task default: :spec

if !ENV["APPRAISAL_INITIALIZED"]
julik marked this conversation as resolved.
Show resolved Hide resolved
task default: :appraisal
end
2 changes: 2 additions & 0 deletions gemfiles/.bundle/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
BUNDLE_RETRY: "1"
julik marked this conversation as resolved.
Show resolved Hide resolved
8 changes: 8 additions & 0 deletions gemfiles/rack_2.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "rack", ">= 2.0", "< 3.0"
gem "activerecord", "~> 6", "< 7.0"

gemspec path: "../"
118 changes: 118 additions & 0 deletions gemfiles/rack_2.gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
PATH
remote: ..
specs:
idempo (1.2.2)
measurometer (~> 1.3)
msgpack
rack (< 4)

GEM
remote: https://rubygems.org/
specs:
activemodel (6.1.7.8)
activesupport (= 6.1.7.8)
activerecord (6.1.7.8)
activemodel (= 6.1.7.8)
activesupport (= 6.1.7.8)
activesupport (6.1.7.8)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
zeitwerk (~> 2.3)
appraisal (2.5.0)
bundler
rake
thor (>= 0.14.0)
ast (2.4.2)
concurrent-ruby (1.3.4)
diff-lcs (1.5.1)
i18n (1.14.6)
concurrent-ruby (~> 1.0)
json (2.7.6)
language_server-protocol (3.17.0.3)
lint_roller (1.1.0)
measurometer (1.3.0)
minitest (5.25.1)
msgpack (1.7.3)
mysql2 (0.5.6)
parallel (1.26.3)
parser (3.3.5.1)
ast (~> 2.4.1)
racc
pg (1.5.9)
racc (1.8.1)
rack (2.2.9)
rack-test (2.1.0)
rack (>= 1.3)
rainbow (3.1.1)
rake (13.2.1)
redis (4.8.1)
regexp_parser (2.9.2)
rexml (3.3.9)
rspec (3.13.0)
rspec-core (~> 3.13.0)
rspec-expectations (~> 3.13.0)
rspec-mocks (~> 3.13.0)
rspec-core (3.13.2)
rspec-support (~> 3.13.0)
rspec-expectations (3.13.3)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-mocks (3.13.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-support (3.13.1)
rubocop (1.64.1)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.31.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.33.1)
parser (>= 3.3.1.0)
rubocop-performance (1.21.1)
rubocop (>= 1.48.1, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
ruby-progressbar (1.13.0)
standard (1.37.0)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.0)
rubocop (~> 1.64.0)
standard-custom (~> 1.0.0)
standard-performance (~> 1.4)
standard-custom (1.0.2)
lint_roller (~> 1.0)
rubocop (~> 1.50)
standard-performance (1.4.0)
lint_roller (~> 1.1)
rubocop-performance (~> 1.21.0)
thor (1.3.2)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (2.6.0)
zeitwerk (2.6.18)

PLATFORMS
ruby

DEPENDENCIES
activerecord (~> 6, < 7.0)
appraisal
idempo!
mysql2
pg
rack (>= 2.0, < 3.0)
rack-test
rake (~> 13.0)
redis (~> 4)
rspec (~> 3.0)
standard

BUNDLED WITH
2.1.4
8 changes: 8 additions & 0 deletions gemfiles/rack_3.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "rack", ">= 3.0"
gem "activerecord", "~> 7.0", "< 9.0"

gemspec path: "../"
134 changes: 134 additions & 0 deletions gemfiles/rack_3.gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
PATH
remote: ..
specs:
idempo (1.2.2)
measurometer (~> 1.3)
msgpack
rack (< 4)

GEM
remote: https://rubygems.org/
specs:
activemodel (7.1.5)
activesupport (= 7.1.5)
activerecord (7.1.5)
activemodel (= 7.1.5)
activesupport (= 7.1.5)
timeout (>= 0.4.0)
activesupport (7.1.5)
base64
benchmark (>= 0.3)
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
logger (>= 1.4.2)
minitest (>= 5.1)
mutex_m
securerandom (>= 0.3)
tzinfo (~> 2.0)
appraisal (2.5.0)
bundler
rake
thor (>= 0.14.0)
ast (2.4.2)
base64 (0.2.0)
benchmark (0.3.0)
bigdecimal (3.1.8)
concurrent-ruby (1.3.4)
connection_pool (2.4.1)
diff-lcs (1.5.1)
drb (2.2.1)
i18n (1.14.6)
concurrent-ruby (~> 1.0)
json (2.7.6)
language_server-protocol (3.17.0.3)
lint_roller (1.1.0)
logger (1.6.1)
measurometer (1.3.0)
minitest (5.25.1)
msgpack (1.7.3)
mutex_m (0.2.0)
mysql2 (0.5.6)
parallel (1.26.3)
parser (3.3.5.1)
ast (~> 2.4.1)
racc
pg (1.5.9)
racc (1.8.1)
rack (3.1.8)
rack-test (2.1.0)
rack (>= 1.3)
rainbow (3.1.1)
rake (13.2.1)
redis (4.8.1)
regexp_parser (2.9.2)
rexml (3.3.9)
rspec (3.13.0)
rspec-core (~> 3.13.0)
rspec-expectations (~> 3.13.0)
rspec-mocks (~> 3.13.0)
rspec-core (3.13.2)
rspec-support (~> 3.13.0)
rspec-expectations (3.13.3)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-mocks (3.13.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-support (3.13.1)
rubocop (1.64.1)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.31.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.33.1)
parser (>= 3.3.1.0)
rubocop-performance (1.21.1)
rubocop (>= 1.48.1, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
ruby-progressbar (1.13.0)
securerandom (0.3.1)
standard (1.37.0)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.0)
rubocop (~> 1.64.0)
standard-custom (~> 1.0.0)
standard-performance (~> 1.4)
standard-custom (1.0.2)
lint_roller (~> 1.0)
rubocop (~> 1.50)
standard-performance (1.4.0)
lint_roller (~> 1.1)
rubocop-performance (~> 1.21.0)
thor (1.3.2)
timeout (0.4.1)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (2.6.0)

PLATFORMS
ruby

DEPENDENCIES
activerecord (~> 7.0, < 9.0)
appraisal
idempo!
mysql2
pg
rack (>= 3.0)
rack-test
rake (~> 13.0)
redis (~> 4)
rspec (~> 3.0)
standard

BUNDLED WITH
2.1.4
5 changes: 3 additions & 2 deletions idempo.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@ Gem::Specification.new do |spec|
# Specify which files should be added to the gem when it is released.
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
spec.files = Dir.chdir(File.expand_path(__dir__)) do
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features)/}) }
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features|gemfiles)/}) }
end
spec.bindir = "exe"
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]

spec.add_dependency "msgpack"
spec.add_dependency "measurometer", "~> 1.3"
spec.add_dependency "rack", "< 4"

spec.add_development_dependency "rack", "~> 3"
spec.add_development_dependency "rake", "~> 13.0"
spec.add_development_dependency "rspec", "~> 3.0"
spec.add_development_dependency "redis", "~> 4"
Expand All @@ -47,6 +47,7 @@ Gem::Specification.new do |spec|
spec.add_development_dependency "mysql2"
spec.add_development_dependency "pg"
spec.add_development_dependency "standard"
spec.add_development_dependency "appraisal"

# For more information and examples about making a new gem, checkout our
# guide at: https://bundler.io/guides/creating_gem.html
Expand Down
Loading
Loading