Skip to content

Commit

Permalink
refactoring of test coverage:
Browse files Browse the repository at this point in the history
- replaced SingleCov with SimpleCov for CodeCov integration
- simplified Travis setup
- separate controls of RuboCop, SimpleCov, Oj and CodeCov with dedicated ENV variables
- completed coverage at 100%
  • Loading branch information
ddnexus committed Apr 28, 2019
1 parent ae3e4bc commit 8ebb1ab
Show file tree
Hide file tree
Showing 32 changed files with 193 additions and 140 deletions.
4 changes: 3 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
require: rubocop-performance

AllCops:
TargetRubyVersion: 2.5
TargetRubyVersion: 2.6

Layout:
Enabled: false
Expand Down
8 changes: 8 additions & 0 deletions .simplecov
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
if ENV['RUN_SIMPLECOV']
SimpleCov.command_name 'main'
SimpleCov.start do
add_filter %r{^/test/}
add_group 'Core', %w[lib/pagy.rb lib/pagy/backend.rb lib/pagy/frontend.rb ]
add_group 'Extras', %w[lib/pagy/countless.rb lib/pagy/extras]
end
end
57 changes: 23 additions & 34 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,62 +2,51 @@
language: ruby
cache: bundler
gemfile: gemfiles/ruby-others
script: bundle exec rake default
script:
- bundle exec rake default
after_success:
- bash <(curl -s https://codecov.io/bash)

matrix:
include:

# ruby
- rvm: 1.9
gemfile: gemfiles/ruby-1.9
env:
- SKIP_RUBOCOP=true
- SKIP_SINGLECOV=true

- rvm: 2.0
gemfile: gemfiles/ruby-2.0
env: SKIP_RUBOCOP=true

env:
- ENABLE_OJ=true
- rvm: 2.1
gemfile: gemfiles/ruby-2.0
env: SKIP_RUBOCOP=true

env:
- ENABLE_OJ=true
- rvm: 2.2
gemfile: gemfiles/ruby-2.0
env: SKIP_RUBOCOP=true

env:
- ENABLE_OJ=true
- rvm: 2.3
env: SKIP_RUBOCOP=true

env:
- ENABLE_OJ=true
- rvm: 2.4
env: SKIP_RUBOCOP=true

- rvm: 2.5 # with rubocop

env:
- ENABLE_OJ=true
- rvm: 2.5
env:
- ENABLE_OJ=true
- rvm: 2.6
env: SKIP_RUBOCOP=true

gemfile: gemfiles/ruby-latest
env:
- ENABLE_OJ=true
- RUN_SIMPLECOV=true
- RUN_RUBOCOP=true
- RUN_CODECOV=true

# jruby
- rvm: jruby-1.7
gemfile: gemfiles/ruby-1.9
env:
- SKIP_RUBOCOP=true
- SKIP_SINGLECOV=true

- rvm: jruby-9.0
gemfile: gemfiles/ruby-2.0
env:
- SKIP_RUBOCOP=true
- SKIP_SINGLECOV=true

- rvm: jruby-9.1
env:
- SKIP_RUBOCOP=true
- SKIP_SINGLECOV=true

- rvm: jruby-9.2
env:
- SKIP_RUBOCOP=true
- SKIP_SINGLECOV=true

14 changes: 8 additions & 6 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@ gem 'rake'
gem 'minitest'
gem 'rack'
gem 'i18n'
gem 'single_cov', '~> 1.3' unless ENV['SKIP_SINGLECOV']
# include minor since it constantly adds new cops
gem 'rubocop', '~> 0.63.1' unless ENV['SKIP_RUBOCOP']

gem 'oj', require: false # false is for testing with or without it

gem 'rubocop'
gem 'rubocop-performance', '~> 1.1.0'
gem 'simplecov', require: false
gem 'codecov', :require => false

# development
# gem 'slim'
Expand All @@ -21,6 +25,4 @@ gem 'rubocop', '~> 0.63.1' unless ENV['SKIP_RUBOCOP']
# gem 'memory_profiler'

# docs server
gem "github-pages", '193', group: :jekyll_plugins

gem 'oj'
gem "github-pages", '197', group: :jekyll_plugins
90 changes: 53 additions & 37 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,21 @@ GEM
addressable (2.5.2)
public_suffix (>= 2.0.2, < 4.0)
ast (2.4.0)
codecov (0.1.14)
json
simplecov
url
coffee-script (2.4.1)
coffee-script-source
execjs
coffee-script-source (1.11.1)
colorator (1.1.0)
commonmarker (0.17.13)
ruby-enum (~> 0.5)
concurrent-ruby (1.1.5)
dnsruby (1.61.2)
addressable (~> 2.5)
docile (1.3.1)
em-websocket (0.5.1)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0.6.0)
Expand All @@ -30,23 +36,23 @@ GEM
ffi (1.10.0)
forwardable-extended (2.6.0)
gemoji (3.0.0)
github-pages (193)
github-pages (197)
activesupport (= 4.2.10)
github-pages-health-check (= 1.8.1)
github-pages-health-check (= 1.16.1)
jekyll (= 3.7.4)
jekyll-avatar (= 0.6.0)
jekyll-coffeescript (= 1.1.1)
jekyll-commonmark-ghpages (= 0.1.5)
jekyll-default-layout (= 0.1.4)
jekyll-feed (= 0.11.0)
jekyll-gist (= 1.5.0)
jekyll-github-metadata (= 2.9.4)
jekyll-github-metadata (= 2.12.1)
jekyll-mentions (= 1.4.1)
jekyll-optional-front-matter (= 0.3.0)
jekyll-paginate (= 1.1.0)
jekyll-readme-index (= 0.2.0)
jekyll-redirect-from (= 0.14.0)
jekyll-relative-links (= 0.5.3)
jekyll-relative-links (= 0.6.0)
jekyll-remote-theme (= 0.3.1)
jekyll-sass-converter (= 1.5.2)
jekyll-seo-tag (= 2.5.0)
Expand All @@ -66,26 +72,27 @@ GEM
jekyll-theme-tactile (= 0.1.1)
jekyll-theme-time-machine (= 0.1.1)
jekyll-titles-from-headings (= 0.5.1)
jemoji (= 0.10.1)
jemoji (= 0.10.2)
kramdown (= 1.17.0)
liquid (= 4.0.0)
listen (= 3.1.5)
mercenary (~> 0.3)
minima (= 2.5.0)
nokogiri (>= 1.8.2, < 2.0)
nokogiri (>= 1.8.5, < 2.0)
rouge (= 2.2.1)
terminal-table (~> 1.4)
github-pages-health-check (1.8.1)
github-pages-health-check (1.16.1)
addressable (~> 2.3)
dnsruby (~> 1.60)
octokit (~> 4.0)
public_suffix (~> 2.0)
public_suffix (~> 3.0)
typhoeus (~> 1.3)
html-pipeline (2.10.0)
html-pipeline (2.11.0)
activesupport (>= 2)
nokogiri (>= 1.4)
http_parser.rb (0.6.0)
i18n (0.8.5)
i18n (0.9.5)
concurrent-ruby (~> 1.0)
jaro_winkler (1.5.2)
jekyll (3.7.4)
addressable (~> 2.4)
Expand All @@ -105,9 +112,9 @@ GEM
jekyll-coffeescript (1.1.1)
coffee-script (~> 2.2)
coffee-script-source (~> 1.11.1)
jekyll-commonmark (1.2.0)
jekyll-commonmark (1.3.1)
commonmarker (~> 0.14)
jekyll (>= 3.0, < 4.0)
jekyll (>= 3.7, < 5.0)
jekyll-commonmark-ghpages (0.1.5)
commonmarker (~> 0.17.6)
jekyll-commonmark (~> 1)
Expand All @@ -118,8 +125,8 @@ GEM
jekyll (~> 3.3)
jekyll-gist (1.5.0)
octokit (~> 4.2)
jekyll-github-metadata (2.9.4)
jekyll (~> 3.1)
jekyll-github-metadata (2.12.1)
jekyll (~> 3.4)
octokit (~> 4.0, != 4.4.0)
jekyll-mentions (1.4.1)
html-pipeline (~> 2.3)
Expand All @@ -131,7 +138,7 @@ GEM
jekyll (~> 3.0)
jekyll-redirect-from (0.14.0)
jekyll (~> 3.3)
jekyll-relative-links (0.5.3)
jekyll-relative-links (0.6.0)
jekyll (~> 3.3)
jekyll-remote-theme (0.3.1)
jekyll (~> 3.5)
Expand Down Expand Up @@ -185,12 +192,13 @@ GEM
jekyll-seo-tag (~> 2.0)
jekyll-titles-from-headings (0.5.1)
jekyll (~> 3.3)
jekyll-watch (2.1.2)
jekyll-watch (2.2.1)
listen (~> 3.0)
jemoji (0.10.1)
jemoji (0.10.2)
gemoji (~> 3.0)
html-pipeline (~> 2.2)
jekyll (~> 3.0)
json (2.2.0)
kramdown (1.17.0)
liquid (4.0.0)
listen (3.1.5)
Expand All @@ -205,70 +213,78 @@ GEM
jekyll-seo-tag (~> 2.1)
minitest (5.11.3)
multipart-post (2.0.0)
nokogiri (1.10.1)
nokogiri (1.10.3)
mini_portile2 (~> 2.4.0)
octokit (4.13.0)
octokit (4.14.0)
sawyer (~> 0.8.0, >= 0.5.3)
oj (3.7.11)
parallel (1.13.0)
parser (2.6.0.0)
oj (3.7.12)
parallel (1.17.0)
parser (2.6.2.1)
ast (~> 2.4.0)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
powerpack (0.1.2)
public_suffix (2.0.5)
rack (1.6.11)
psych (3.1.0)
public_suffix (3.0.3)
rack (2.0.7)
rainbow (3.0.0)
rake (10.5.0)
rake (12.3.2)
rb-fsevent (0.10.3)
rb-inotify (0.10.0)
ffi (~> 1.0)
rouge (2.2.1)
rubocop (0.63.1)
rubocop (0.67.2)
jaro_winkler (~> 1.5.1)
parallel (~> 1.10)
parser (>= 2.5, != 2.5.1.1)
powerpack (~> 0.1)
psych (>= 3.1.0)
rainbow (>= 2.2.2, < 4.0)
ruby-progressbar (~> 1.7)
unicode-display_width (~> 1.4.0)
unicode-display_width (>= 1.4.0, < 1.6)
rubocop-performance (1.1.0)
rubocop (>= 0.67.0)
ruby-enum (0.7.2)
i18n
ruby-progressbar (1.10.0)
ruby_dep (1.5.0)
rubyzip (1.2.2)
safe_yaml (1.0.4)
sass (3.7.3)
safe_yaml (1.0.5)
sass (3.7.4)
sass-listen (~> 4.0.0)
sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
sawyer (0.8.1)
addressable (>= 2.3.5, < 2.6)
faraday (~> 0.8, < 1.0)
single_cov (1.3.0)
simplecov (0.16.1)
docile (~> 1.1)
json (>= 1.8, < 3)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.2)
terminal-table (1.8.0)
unicode-display_width (~> 1.1, >= 1.1.1)
thread_safe (0.3.6)
typhoeus (1.3.1)
ethon (>= 0.9.0)
tzinfo (1.2.5)
thread_safe (~> 0.1)
unicode-display_width (1.4.1)
unicode-display_width (1.5.0)
url (0.3.2)

PLATFORMS
java
ruby

DEPENDENCIES
github-pages (= 193)
codecov
github-pages (= 197)
i18n
minitest
oj
rack
rake
rubocop (~> 0.63.1)
single_cov (~> 1.3)
rubocop
rubocop-performance (~> 1.1.0)
simplecov

BUNDLED WITH
2.0.1
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
[![Gem Version](https://img.shields.io/gem/v/pagy.svg?label=pagy&colorA=99004d&colorB=cc0066)](https://rubygems.org/gems/pagy)
![ruby](https://img.shields.io/badge/ruby-1.9+-ruby.svg?colorA=99004d&colorB=cc0066)
![jruby](https://img.shields.io/badge/jruby-1.7+-jruby.svg?colorA=99004d&colorB=cc0066)
[![CodeCov](https://img.shields.io/codecov/c/github/ddnexus/pagy.svg?colorA=1f7a1f&colorB=2aa22a)](https://codecov.io/gh/ddnexus/pagy)
[![Build Status](https://img.shields.io/travis/ddnexus/pagy/master.svg?colorA=1f7a1f&colorB=2aa22a)](https://travis-ci.org/ddnexus/pagy/branches)
[![MIT license](https://img.shields.io/badge/license-MIT-mit.svg?colorA=1f7a1f&colorB=2aa22a)](http://opensource.org/licenses/MIT)
![Commits](https://img.shields.io/github/commit-activity/y/ddnexus/pagy.svg?label=commits&colorA=004d99&colorB=0073e6)
Expand Down
Loading

0 comments on commit 8ebb1ab

Please sign in to comment.