use appraisal gem to run tests against redis 4 and 5
MODIFY
.github/workflows/build.yml
.github/workflows/build.yml
@@ -14,6 +14,7 @@ jobs:
strategy:
matrix:
ruby-version: [3.1.2, 3.0.4, 2.7.6]
+ redis-version: [4, 5]
steps:
- uses: actions/checkout@v2
@@ -35,7 +36,7 @@ jobs:
run: docker-compose up -d
- name: Install gems
- run: bundle install
+ run: bundle install && bundle exec appraisal install
- name: Compile and test beetle go binary
run: make && make test
@@ -43,10 +44,13 @@ jobs:
- name: Run beetle gem tests
run: bundle exec rake test
env:
+ BUNDLE_GEMFILE: gemfiles/redis_${{ matrix.redis-version }}.gemfile
MINITEST_REPORTER: SpecReporter
- name: Run beetle failover tests
run: bundle exec cucumber || (tail -n 100 tmp/*.{log,output}; false)
+ env:
+ BUNDLE_GEMFILE: gemfiles/redis_${{ matrix.redis-version }}.gemfile
- name: Stop services
run: docker-compose down

MODIFY
.gitignore
.gitignore
@@ -22,3 +22,4 @@ TAGS
.packr
/go/a_main-packr.go
.yardoc
+gemfiles/*

ADD
Appraisals
+appraise "redis-4" do
+ gem "redis", "~> 4.0"
+end
+appraise "redis-5" do
+ gem "redis", "~> 5.0"
+ gem "hiredis-client"
+end

MODIFY
beetle.gemspec
beetle.gemspec
@@ -47,4 +47,5 @@ Gem::Specification.new do |s|
s.add_development_dependency 'redcarpet'
s.add_development_dependency 'github-markup'
s.add_development_dependency 'byebug'
+ s.add_development_dependency 'appraisal'
end

use appraisal gem to run tests against redis 4 and 5