coverband 5.0.3 → 5.1.0.rcmailer.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/ISSUE_TEMPLATE/bug_report.md +38 -0
- data/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
- data/.github/workflows/main.yml +30 -0
- data/CONTRIBUTING.md +1 -0
- data/README.md +6 -5
- data/lib/coverband/collectors/view_tracker.rb +1 -1
- data/lib/coverband/version.rb +1 -1
- data/test/coverband/collectors/view_tracker_test.rb +10 -0
- metadata +11 -8
- data/.travis.yml +0 -48
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ec5d51bc8a16c6d59cb6a04ae43ffd0f242677038851c7f44fe0f2720d1686c8
|
4
|
+
data.tar.gz: 608b0442f7993d8e18c686c49037521dbe96325f2f240bb11a542229e3a0bbb8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9d88524814527a2df8c30d7e15005d3cbab174612fdc841035e46bef0847bd352450357c64a64945e8ed72935c0f288746e1f90773397836ed74fdce5c7f0f83
|
7
|
+
data.tar.gz: d56b0c8f50e6d985b5eecac8051e2516359698c41b70f230d21256b73faab0392097ad5b1ece4cfad685251e5a816fa52db0bdcdbc5fbc71640c94686f6ef141
|
@@ -0,0 +1,38 @@
|
|
1
|
+
---
|
2
|
+
name: Bug report
|
3
|
+
about: Create a report to help us improve
|
4
|
+
title: ''
|
5
|
+
labels: ''
|
6
|
+
assignees: ''
|
7
|
+
|
8
|
+
---
|
9
|
+
|
10
|
+
**Describe the bug**
|
11
|
+
A clear and concise description of what the bug is.
|
12
|
+
|
13
|
+
**To Reproduce**
|
14
|
+
Steps to reproduce the behavior:
|
15
|
+
1. Go to '...'
|
16
|
+
2. Click on '....'
|
17
|
+
3. Scroll down to '....'
|
18
|
+
4. See error
|
19
|
+
|
20
|
+
**Expected behavior**
|
21
|
+
A clear and concise description of what you expected to happen.
|
22
|
+
|
23
|
+
**Screenshots**
|
24
|
+
If applicable, add screenshots to help explain your problem.
|
25
|
+
|
26
|
+
**Desktop (please complete the following information):**
|
27
|
+
- OS: [e.g. iOS]
|
28
|
+
- Browser [e.g. chrome, safari]
|
29
|
+
- Version [e.g. 22]
|
30
|
+
|
31
|
+
**Smartphone (please complete the following information):**
|
32
|
+
- Device: [e.g. iPhone6]
|
33
|
+
- OS: [e.g. iOS8.1]
|
34
|
+
- Browser [e.g. stock browser, safari]
|
35
|
+
- Version [e.g. 22]
|
36
|
+
|
37
|
+
**Additional context**
|
38
|
+
Add any other context about the problem here.
|
@@ -0,0 +1,20 @@
|
|
1
|
+
---
|
2
|
+
name: Feature request
|
3
|
+
about: Suggest an idea for this project
|
4
|
+
title: ''
|
5
|
+
labels: ''
|
6
|
+
assignees: ''
|
7
|
+
|
8
|
+
---
|
9
|
+
|
10
|
+
**Is your feature request related to a problem? Please describe.**
|
11
|
+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
12
|
+
|
13
|
+
**Describe the solution you'd like**
|
14
|
+
A clear and concise description of what you want to happen.
|
15
|
+
|
16
|
+
**Describe alternatives you've considered**
|
17
|
+
A clear and concise description of any alternative solutions or features you've considered.
|
18
|
+
|
19
|
+
**Additional context**
|
20
|
+
Add any other context or screenshots about the feature request here.
|
@@ -0,0 +1,30 @@
|
|
1
|
+
name: CI
|
2
|
+
# Controls when the action will run.
|
3
|
+
on:
|
4
|
+
# Triggers the workflow on push or pull request events but only for the master branch
|
5
|
+
push:
|
6
|
+
branches: [master]
|
7
|
+
pull_request:
|
8
|
+
branches: [master]
|
9
|
+
jobs:
|
10
|
+
test:
|
11
|
+
strategy:
|
12
|
+
fail-fast: false
|
13
|
+
matrix:
|
14
|
+
# need to figure out how to use redis on macos github actions
|
15
|
+
# os: [ubuntu, macos]
|
16
|
+
os: [ubuntu]
|
17
|
+
# remove until I sort out CI issues for truffle
|
18
|
+
# truffleruby,
|
19
|
+
# truffleruby-head,
|
20
|
+
ruby: [2.3, 2.4, 2.5, 2.6, 2.7, jruby, jruby-head]
|
21
|
+
redis-version: [5]
|
22
|
+
runs-on: ${{ matrix.os }}-latest
|
23
|
+
steps:
|
24
|
+
- uses: actions/checkout@v2
|
25
|
+
- uses: supercharge/redis-github-action@1.1.0
|
26
|
+
- uses: ruby/setup-ruby@v1
|
27
|
+
with:
|
28
|
+
ruby-version: ${{ matrix.ruby }}
|
29
|
+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
30
|
+
- run: bundle exec rake
|
data/CONTRIBUTING.md
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
See our [code of conduct](https://github.com/danmayer/coverband/blob/master/CODE_OF_CONDUCT.md)
|
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# Coverband
|
4
4
|
|
5
|
-
[![
|
5
|
+
[![GithubCI](https://github.com/danmayer/coverband/workflows/CI/badge.svg)](https://github.com/danmayer/coverband/actions)
|
6
6
|
[![Coverage Status](https://coveralls.io/repos/github/danmayer/coverband/badge.svg?branch=master)](https://coveralls.io/github/danmayer/coverband?branch=master)
|
7
7
|
[![Maintainability](https://api.codeclimate.com/v1/badges/1e6682f9540d75f26da7/maintainability)](https://codeclimate.com/github/danmayer/coverband/maintainability)
|
8
8
|
[![Discord Shield](https://img.shields.io/discord/609509533999562753)](https://discord.gg/KAH38EV)
|
@@ -65,7 +65,7 @@ The Railtie integration means you shouldn't need to do anything else other than
|
|
65
65
|
|
66
66
|
## Sinatra
|
67
67
|
|
68
|
-
For the best coverage you want this loaded as early as possible. We recommend requiring cover band directly in the `config.ru`.
|
68
|
+
For the best coverage you want this loaded as early as possible. We recommend requiring cover band directly in the `config.ru`. Requiring coverband within an initializer could also work, but you may end up missing some boot up coverage. To start collection require Coverband as early as possible.
|
69
69
|
|
70
70
|
```ruby
|
71
71
|
require 'coverband'
|
@@ -91,7 +91,7 @@ run ActionController::Dispatcher.new
|
|
91
91
|
|
92
92
|
- Clear coverage report
|
93
93
|
|
94
|
-
This will clear the coverage data. This wipes out all collected data.
|
94
|
+
This will clear the coverage data. This wipes out all collected data.
|
95
95
|
|
96
96
|
- Clear individual file coverage
|
97
97
|
|
@@ -304,6 +304,8 @@ rake coverband:coverage # report runtime coverband code coverage
|
|
304
304
|
|
305
305
|
Coverband starts on require of the the library which is usually done within the Gemfile. This can be disabled by setting the `COVERBAND_DISABLE_AUTO_START` environment variable. This environment variable can be useful to toggle coverband on and off in certain environments.
|
306
306
|
|
307
|
+
**NOTE:** That any value set for `COVERBAND_DISABLE_AUTO_START` is considered true, it does not match the string content but only checks the presence of the ENV variable.
|
308
|
+
|
307
309
|
In order to start coverband manually yourself when this flag is enabled, call `Coverband.configure` followed by `Coverband.start`.
|
308
310
|
|
309
311
|
```ruby
|
@@ -333,7 +335,7 @@ If you currently have require: false, remove the 'coverband' string from the req
|
|
333
335
|
gem 'coverband', require: ['alternative_coverband_patch']
|
334
336
|
```
|
335
337
|
|
336
|
-
This conflict happens when a ruby method is patched twice, once using module prepend, and once using method aliasing. See this ruby issue for details. The fix is to apply all patches the same way. Coverband by default will apply its patch using prepend, but you can change that to
|
338
|
+
This conflict happens when a ruby method is patched twice, once using module prepend, and once using method aliasing. See this ruby issue for details. The fix is to apply all patches the same way. Coverband by default will apply its patch using prepend, but you can change that to method aliasing by adding require: ['alternative_coverband_patch'] to the gem line as shown above.
|
337
339
|
|
338
340
|
# Prerequisites
|
339
341
|
|
@@ -385,7 +387,6 @@ If you submit a change please make sure the tests and benchmarks are passing.
|
|
385
387
|
- **total fail** on front end code, for line for line coverage, because of the precompiled template step basically coverage doesn't work well for `erb`, `slim`, and the like.
|
386
388
|
- related it will try to report something, but the line numbers reported for `ERB` files are often off and aren't considered useful. I recommend filtering out .erb using the `config.ignore` option. The default configuration excludes these files
|
387
389
|
- **NOTE:** We now have file level coverage for view files, but don't support line level detail
|
388
|
-
- The view file detection doesn't workf or mailers at the moment only for web related views / JSON templates. This is due to how Rails active mailer notifications work.
|
389
390
|
- **Coverage does NOT work when used alongside Scout APM Auto Instrumentation**
|
390
391
|
- In an environment that uses Scout's `AUTO_INSTRUMENT=true` (usually production or staging) it stops reporting any coverage, it will show one or two files that have been loaded at the start but everything else will show up as having 0% coverage
|
391
392
|
- Bug tracked here: https://github.com/scoutapp/scout_apm_ruby/issues/343
|
@@ -23,7 +23,7 @@ module Coverband
|
|
23
23
|
@ignore_patterns = Coverband.configuration.ignore
|
24
24
|
@store = options.fetch(:store) { Coverband.configuration.store }
|
25
25
|
@logger = options.fetch(:logger) { Coverband.configuration.logger }
|
26
|
-
@target = options.fetch(:target) { Dir.glob("#{@project_directory}/app/views/**/*.html.{erb,haml,slim}")
|
26
|
+
@target = options.fetch(:target) { Dir.glob("#{@project_directory}/app/views/**/*.html.{erb,haml,slim}") }
|
27
27
|
|
28
28
|
@roots = options.fetch(:roots) { Coverband.configuration.all_root_patterns }
|
29
29
|
@roots = @roots.split(",") if @roots.is_a?(String)
|
data/lib/coverband/version.rb
CHANGED
@@ -42,6 +42,16 @@ class ReporterTest < Minitest::Test
|
|
42
42
|
assert_equal [file_path], tracker.used_views.keys
|
43
43
|
end
|
44
44
|
|
45
|
+
test "track partials that include the word _mailer in the path" do
|
46
|
+
Coverband::Collectors::ViewTracker.expects(:supported_version?).returns(true)
|
47
|
+
store = fake_store
|
48
|
+
file_path = "#{File.expand_path(Coverband.configuration.root)}/_mailer/file"
|
49
|
+
tracker = Coverband::Collectors::ViewTracker.new(store: store, roots: "dir")
|
50
|
+
tracker.track_views("name", "start", "finish", "id", identifier: file_path)
|
51
|
+
tracker.report_views_tracked
|
52
|
+
assert_equal [file_path], tracker.used_views.keys
|
53
|
+
end
|
54
|
+
|
45
55
|
test "ignore partials that include the folder vendor in the path" do
|
46
56
|
Coverband::Collectors::ViewTracker.expects(:supported_version?).returns(true)
|
47
57
|
store = fake_store
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: coverband
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.0.
|
4
|
+
version: 5.1.0.rcmailer.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dan Mayer
|
8
8
|
- Karl Baum
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2020-
|
12
|
+
date: 2020-12-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: benchmark-ips
|
@@ -270,11 +270,14 @@ executables: []
|
|
270
270
|
extensions: []
|
271
271
|
extra_rdoc_files: []
|
272
272
|
files:
|
273
|
+
- ".github/ISSUE_TEMPLATE/bug_report.md"
|
274
|
+
- ".github/ISSUE_TEMPLATE/feature_request.md"
|
275
|
+
- ".github/workflows/main.yml"
|
273
276
|
- ".gitignore"
|
274
277
|
- ".jrubyrc"
|
275
278
|
- ".standard.yml"
|
276
|
-
- ".travis.yml"
|
277
279
|
- CODE_OF_CONDUCT.md
|
280
|
+
- CONTRIBUTING.md
|
278
281
|
- Gemfile
|
279
282
|
- Gemfile.rails4
|
280
283
|
- Gemfile.rails6
|
@@ -465,7 +468,7 @@ homepage: https://github.com/danmayer/coverband
|
|
465
468
|
licenses:
|
466
469
|
- MIT
|
467
470
|
metadata: {}
|
468
|
-
post_install_message:
|
471
|
+
post_install_message:
|
469
472
|
rdoc_options: []
|
470
473
|
require_paths:
|
471
474
|
- lib
|
@@ -476,12 +479,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
476
479
|
version: '0'
|
477
480
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
478
481
|
requirements:
|
479
|
-
- - "
|
482
|
+
- - ">"
|
480
483
|
- !ruby/object:Gem::Version
|
481
|
-
version:
|
484
|
+
version: 1.3.1
|
482
485
|
requirements: []
|
483
486
|
rubygems_version: 3.0.3
|
484
|
-
signing_key:
|
487
|
+
signing_key:
|
485
488
|
specification_version: 4
|
486
489
|
summary: Rack middleware to measure production code usage (LOC runtime usage)
|
487
490
|
test_files:
|
data/.travis.yml
DELETED
@@ -1,48 +0,0 @@
|
|
1
|
-
language: ruby
|
2
|
-
rvm:
|
3
|
-
- "2.3"
|
4
|
-
- "2.4"
|
5
|
-
- "2.5"
|
6
|
-
- "2.6.1"
|
7
|
-
- "2.7"
|
8
|
-
- jruby-9.2.6.0
|
9
|
-
gemfile:
|
10
|
-
- Gemfile
|
11
|
-
- Gemfile.rails4
|
12
|
-
- Gemfile.rails6
|
13
|
-
env:
|
14
|
-
global:
|
15
|
-
# --dev improves JRuby startup time
|
16
|
-
# See https://github.com/jruby/jruby/wiki/Improving-startup-time
|
17
|
-
- JRUBY_OPTS="--dev"
|
18
|
-
- JAVA_OPTS="--add-opens java.base/{java.security.cert=ALL-UNNAMED --add-opens java.base/java.security=ALL-UNNAMED --add-opens java.base/java.util.zip=ALL-UNNAMED"
|
19
|
-
|
20
|
-
jobs:
|
21
|
-
exclude:
|
22
|
-
- rvm: "2.3"
|
23
|
-
gemfile: Gemfile.rails6
|
24
|
-
- rvm: "2.4"
|
25
|
-
gemfile: Gemfile.rails6
|
26
|
-
- rvm: "2.7"
|
27
|
-
gemfile: Gemfile.rails4
|
28
|
-
- rvm: jruby-9.2.6.0
|
29
|
-
gemfile: Gemfile.rails4
|
30
|
-
|
31
|
-
cache:
|
32
|
-
bundler: true
|
33
|
-
directories:
|
34
|
-
- $HOME/lua51
|
35
|
-
services:
|
36
|
-
- redis-server
|
37
|
-
script:
|
38
|
-
- sudo ./lua/install.sh
|
39
|
-
- $HOME/lua51/bin/busted lua/test/*
|
40
|
-
- bundle exec standardrb
|
41
|
-
- COVERBAND_HASH_REDIS_STORE=t bundle exec rake
|
42
|
-
- COVERBAND_HASH_REDIS_STORE=t bundle exec rake forked_tests
|
43
|
-
- bundle exec rake
|
44
|
-
- bundle exec rake forked_tests
|
45
|
-
# remove this for now as it is flaky
|
46
|
-
# passes locally on 2.3.5 on travis passes sometimes on 2.4 and always on 2.6.1
|
47
|
-
#- bundle exec rake benchmarks:memory
|
48
|
-
- bundle exec rake benchmarks
|