Skip to content

Commit

Permalink
[#85] Appraisal Tests: fix running all tests (#86)
Browse files Browse the repository at this point in the history
This fixes an issue when running all tests in each appraisal.
```
bundle exec appraisal rake test
```

Fixes #85
  • Loading branch information
gi authored Sep 9, 2021
1 parent cc139f2 commit 0d3d18a
Show file tree
Hide file tree
Showing 19 changed files with 247 additions and 159 deletions.
19 changes: 12 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
language: ruby
rvm:
- 2.4.0
- 2.5.0
- 2.6.0
- 2.4
- 2.5
- 2.6
- 2.7
- 3.0
- jruby-9.2
before_install:
- yes | gem update --system --force
- gem install bundler
gemfile:
- gemfiles/minitest4.gemfile
- gemfiles/minitest5.gemfile
- gemfiles/test_unit_gem.gemfile
install:
- bundle install
- bundle --gemfile=gemfiles/minitest5.gemfile
- bundle --gemfile=gemfiles/minitest4.gemfile
- bundle --gemfile=gemfiles/test_unit_gem.gemfile
script:
- bundle exec rake tests
- bundle exec rake test
4 changes: 2 additions & 2 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
appraise "minitest4" do
gem 'minitest', '4.7.5'
gem 'minitest', '~> 4'
end

appraise "minitest5" do
gem 'minitest'
gem 'minitest', '~> 5'
end

appraise "test_unit_gem" do
Expand Down
53 changes: 27 additions & 26 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8,36 +8,35 @@ PATH
GEM
remote: https://rubygems.org/
specs:
activesupport (4.0.13)
i18n (~> 0.6, >= 0.6.9)
minitest (~> 4.2)
multi_json (~> 1.3)
thread_safe (~> 0.1)
tzinfo (~> 0.3.37)
activesupport (6.1.4.1)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
zeitwerk (~> 2.3)
allocation_stats (0.1.5)
appraisal (2.0.1)
activesupport (>= 3.2.21)
appraisal (2.4.1)
bundler
rake
thor (>= 0.14.0)
benchmark-ips (2.1.1)
benchmark-ips (2.9.1)
concurrent-ruby (1.1.9)
coveralls (0.8.23)
json (>= 1.8, < 3)
simplecov (~> 0.16.1)
term-ansicolor (~> 1.3)
thor (>= 0.19.4, < 2.0)
tins (~> 1.6)
docile (1.3.1)
i18n (0.7.0)
json (2.2.0)
json (2.2.0-java)
method_source (0.8.2)
minitest (4.7.5)
multi_json (1.11.0)
mustache (1.0.2)
rake (10.4.2)
rdiscount (2.1.8)
redcarpet (3.3.2)
docile (1.4.0)
i18n (1.8.10)
concurrent-ruby (~> 1.0)
json (2.5.1)
method_source (1.0.0)
minitest (5.14.4)
mustache (1.1.1)
rake (13.0.6)
rdiscount (2.2.0.2)
redcarpet (3.5.1)
rocco (0.8.2)
mustache
redcarpet
Expand All @@ -46,13 +45,15 @@ GEM
json (>= 1.8, < 3)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.2)
sync (0.5.0)
term-ansicolor (1.7.1)
tins (~> 1.0)
thor (0.20.3)
thread_safe (0.3.5)
thread_safe (0.3.5-java)
tins (1.20.2)
tzinfo (0.3.44)
thor (1.1.0)
tins (1.29.1)
sync
tzinfo (2.0.4)
concurrent-ruby (~> 1.0)
zeitwerk (2.4.2)

PLATFORMS
java
Expand All @@ -69,4 +70,4 @@ DEPENDENCIES
rocco

BUNDLED WITH
1.17.2
2.2.26
21 changes: 14 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ If you want to run all the tests in a directory as well as its subdirectories, u
Finished in 3.459902s, 45.0880 runs/s, 87.5747 assertions/s.

156 tests, 303 assertions, 0 failures, 0 errors, 13 skips

If you need to pass some option down to the actual runner, that is also supported:

$ m test/models -- --seed 1234
Expand All @@ -120,7 +120,7 @@ If you need to pass some option down to the actual runner, that is also supporte
Finished in 3.459902s, 45.0880 runs/s, 87.5747 assertions/s.

156 tests, 303 assertions, 0 failures, 0 errors, 13 skips

Ensure that you use the `--` before the options, otherwise you'll get an invalid option error. Also, these extra option should always be the last argument.


Expand All @@ -138,6 +138,17 @@ SUPPORT
CONTRIBUTING
============

## Setup

This project uses [Appraisal](https://github.com/thoughtbot/appraisal) to test against different versions of dependencies.

To install all scenarios (appraisals):

bundle install
bundle exec appraisal install

## Testing

You can run all the tests with:

bundle exec rake tests
Expand All @@ -148,11 +159,7 @@ You can also run tests selectively. For minitest 4 run:

and the ones for minitest 5 with:

appraisal minitest5 rake test TEST=test/minitest_5_test.rb

In the case of minitest 5, we have to specify the test to run, because running
the whole suite will fail due to incompatibilities with ruby (at least until
2.1.1).
appraisal minitest5 rake test


LICENSE
Expand Down
8 changes: 5 additions & 3 deletions gemfiles/minitest4.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

source "https://rubygems.org"

gem "coveralls", :require => false, :group => :coverage
gem "minitest", "4.7.5"
gem "coveralls", require: false
gem "benchmark-ips"
gem "allocation_stats"
gem "minitest", "~> 4"

gemspec :path => "../"
gemspec path: "../"
52 changes: 27 additions & 25 deletions gemfiles/minitest4.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8,34 +8,36 @@ PATH
GEM
remote: https://rubygems.org/
specs:
activesupport (4.0.2)
i18n (~> 0.6, >= 0.6.4)
activesupport (4.0.13)
i18n (~> 0.6, >= 0.6.9)
minitest (~> 4.2)
multi_json (~> 1.3)
thread_safe (~> 0.1)
tzinfo (~> 0.3.37)
appraisal (0.5.2)
allocation_stats (0.1.5)
appraisal (2.4.1)
bundler
rake
atomic (1.1.14)
atomic (1.1.14-java)
thor (>= 0.14.0)
benchmark-ips (2.9.1)
concurrent-ruby (1.1.9)
coveralls (0.8.23)
json (>= 1.8, < 3)
simplecov (~> 0.16.1)
term-ansicolor (~> 1.3)
thor (>= 0.19.4, < 2.0)
tins (~> 1.6)
docile (1.3.1)
i18n (0.6.9)
json (2.2.0)
json (2.2.0-java)
method_source (0.9.2)
docile (1.4.0)
i18n (0.9.5)
concurrent-ruby (~> 1.0)
json (2.5.1)
method_source (1.0.0)
minitest (4.7.5)
multi_json (1.8.4)
mustache (1.0.2)
rake (10.1.1)
rdiscount (2.1.8)
redcarpet (3.3.2)
multi_json (1.15.0)
mustache (1.1.1)
rake (13.0.6)
rdiscount (2.2.0.2)
redcarpet (3.5.1)
rocco (0.8.2)
mustache
redcarpet
Expand All @@ -44,28 +46,28 @@ GEM
json (>= 1.8, < 3)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.2)
sync (0.5.0)
term-ansicolor (1.7.1)
tins (~> 1.0)
thor (0.20.3)
thread_safe (0.1.3)
atomic
thread_safe (0.1.3-java)
atomic
tins (1.20.2)
tzinfo (0.3.38)
thor (1.1.0)
thread_safe (0.3.6)
tins (1.29.1)
sync
tzinfo (0.3.60)

PLATFORMS
java
ruby

DEPENDENCIES
activesupport
allocation_stats
appraisal
benchmark-ips
coveralls
m!
minitest (= 4.7.5)
minitest (~> 4)
rdiscount
rocco

BUNDLED WITH
1.17.2
2.2.26
8 changes: 5 additions & 3 deletions gemfiles/minitest5.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

source "https://rubygems.org"

gem "coveralls", :require => false, :group => :coverage
gem "minitest"
gem "coveralls", require: false
gem "benchmark-ips"
gem "allocation_stats"
gem "minitest", "~> 5"

gemspec :path => "../"
gemspec path: "../"
52 changes: 32 additions & 20 deletions gemfiles/minitest5.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,35 @@ PATH
GEM
remote: https://rubygems.org/
specs:
activesupport (3.2.16)
i18n (~> 0.6, >= 0.6.4)
multi_json (~> 1.0)
appraisal (0.5.2)
activesupport (6.1.4.1)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
zeitwerk (~> 2.3)
allocation_stats (0.1.5)
appraisal (2.4.1)
bundler
rake
thor (>= 0.14.0)
benchmark-ips (2.9.1)
concurrent-ruby (1.1.9)
coveralls (0.8.23)
json (>= 1.8, < 3)
simplecov (~> 0.16.1)
term-ansicolor (~> 1.3)
thor (>= 0.19.4, < 2.0)
tins (~> 1.6)
docile (1.3.1)
i18n (0.6.9)
json (2.2.0)
json (2.2.0-java)
method_source (0.9.2)
minitest (5.3.1)
multi_json (1.8.4)
mustache (1.0.2)
rake (10.1.1)
rdiscount (2.1.8)
redcarpet (3.3.2)
docile (1.4.0)
i18n (1.8.10)
concurrent-ruby (~> 1.0)
json (2.5.1)
method_source (1.0.0)
minitest (5.14.4)
mustache (1.1.1)
rake (13.0.6)
rdiscount (2.2.0.2)
redcarpet (3.5.1)
rocco (0.8.2)
mustache
redcarpet
Expand All @@ -39,23 +45,29 @@ GEM
json (>= 1.8, < 3)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.2)
sync (0.5.0)
term-ansicolor (1.7.1)
tins (~> 1.0)
thor (0.20.3)
tins (1.20.2)
thor (1.1.0)
tins (1.29.1)
sync
tzinfo (2.0.4)
concurrent-ruby (~> 1.0)
zeitwerk (2.4.2)

PLATFORMS
java
ruby

DEPENDENCIES
activesupport
allocation_stats
appraisal
benchmark-ips
coveralls
m!
minitest
minitest (~> 5)
rdiscount
rocco

BUNDLED WITH
1.17.2
2.2.26
6 changes: 4 additions & 2 deletions gemfiles/test_unit_gem.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

source "https://rubygems.org"

gem "coveralls", :require => false, :group => :coverage
gem "coveralls", require: false
gem "benchmark-ips"
gem "allocation_stats"
gem "test-unit"

gemspec :path => "../"
gemspec path: "../"
Loading

0 comments on commit 0d3d18a

Please sign in to comment.