simplecov_badger 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.semaphore/semaphore.yml +45 -0
- data/Gemfile +2 -2
- data/Gemfile.lock +22 -11
- data/README.md +29 -5
- data/lib/simplecov_badger/version.rb +1 -1
- data/simplecov_badger.gemspec +1 -1
- metadata +9 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 479b075da95d9e0caa5cbab73f912960d382942c62e4cc82ce379b2d12d552a7
|
4
|
+
data.tar.gz: fe331af0e9bbe7aabc3959bfdfee40d317bdca65195673b10822bb791d272c64
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d0f3b631ae5eaf2fd85dfbf16cef1f5a56304048112467f6fdd4aad7c1858c8b955fbec07c0cb1310438176eff0b2578e3f119d318341118b7cce50f673cbc79
|
7
|
+
data.tar.gz: 62c4ff8422f7f36549ae2e18d4299f98d862d55ae748f03525cf6b747e3f5c7387926c9a353e396bf99845322080aadd9aa4f9003b767f57396660dd20929707
|
@@ -0,0 +1,45 @@
|
|
1
|
+
version: v1.0
|
2
|
+
name: build
|
3
|
+
agent:
|
4
|
+
machine:
|
5
|
+
type: e1-standard-2
|
6
|
+
os_image: ubuntu1804
|
7
|
+
auto_cancel:
|
8
|
+
running:
|
9
|
+
when: 'true'
|
10
|
+
blocks:
|
11
|
+
- name: Tests
|
12
|
+
task:
|
13
|
+
jobs:
|
14
|
+
- name: Ruby 2.7
|
15
|
+
commands:
|
16
|
+
- checkout
|
17
|
+
- sem-version ruby 2.7
|
18
|
+
- cache restore
|
19
|
+
- bundle install --path vendor/bundle
|
20
|
+
- cache store
|
21
|
+
- bundle exec rake test
|
22
|
+
- name: Ruby 3.0
|
23
|
+
commands:
|
24
|
+
- checkout
|
25
|
+
- sem-version ruby 3.0
|
26
|
+
- cache restore
|
27
|
+
- bundle install --path vendor/bundle
|
28
|
+
- cache store
|
29
|
+
- bundle exec rake test
|
30
|
+
- name: Ruby 3.1
|
31
|
+
commands:
|
32
|
+
- checkout
|
33
|
+
- sem-version ruby 3.1
|
34
|
+
- cache restore
|
35
|
+
- bundle install --path vendor/bundle
|
36
|
+
- cache store
|
37
|
+
- bundle exec rake test
|
38
|
+
- name: Ruby 3.2
|
39
|
+
commands:
|
40
|
+
- checkout
|
41
|
+
- sem-version ruby 3.2
|
42
|
+
- cache restore
|
43
|
+
- bundle install --path vendor/bundle
|
44
|
+
- cache store
|
45
|
+
- bundle exec rake test
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,49 +1,60 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
simplecov_badger (0.0.
|
4
|
+
simplecov_badger (0.0.4)
|
5
5
|
rest-client (~> 2.1.0)
|
6
|
-
simplecov (
|
6
|
+
simplecov (>= 0.18.5)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
|
11
|
+
debug (1.7.2)
|
12
|
+
irb (>= 1.5.0)
|
13
|
+
reline (>= 0.3.1)
|
14
|
+
docile (1.4.0)
|
12
15
|
domain_name (0.5.20190701)
|
13
16
|
unf (>= 0.0.5, < 1.0.0)
|
14
17
|
http-accept (1.7.0)
|
15
|
-
http-cookie (1.0.
|
18
|
+
http-cookie (1.0.5)
|
16
19
|
domain_name (~> 0.5)
|
20
|
+
io-console (0.6.0)
|
21
|
+
irb (1.6.4)
|
22
|
+
reline (>= 0.3.0)
|
17
23
|
m (1.5.1)
|
18
24
|
method_source (>= 0.6.7)
|
19
25
|
rake (>= 0.9.2.2)
|
20
26
|
method_source (1.0.0)
|
21
|
-
mime-types (3.
|
27
|
+
mime-types (3.4.1)
|
22
28
|
mime-types-data (~> 3.2015)
|
23
|
-
mime-types-data (3.
|
24
|
-
minitest (5.
|
29
|
+
mime-types-data (3.2023.0218.1)
|
30
|
+
minitest (5.18.0)
|
25
31
|
mocha (1.11.2)
|
26
32
|
netrc (0.11.0)
|
27
33
|
rake (12.3.3)
|
34
|
+
reline (0.3.3)
|
35
|
+
io-console (~> 0.5)
|
28
36
|
rest-client (2.1.0)
|
29
37
|
http-accept (>= 1.7.0, < 2.0)
|
30
38
|
http-cookie (>= 1.0.2, < 2.0)
|
31
39
|
mime-types (>= 1.16, < 4.0)
|
32
40
|
netrc (~> 0.8)
|
33
|
-
simplecov (0.
|
41
|
+
simplecov (0.22.0)
|
34
42
|
docile (~> 1.1)
|
35
43
|
simplecov-html (~> 0.11)
|
36
|
-
|
44
|
+
simplecov_json_formatter (~> 0.1)
|
45
|
+
simplecov-html (0.12.3)
|
46
|
+
simplecov_json_formatter (0.1.4)
|
37
47
|
unf (0.1.4)
|
38
48
|
unf_ext
|
39
|
-
unf_ext (0.0.
|
49
|
+
unf_ext (0.0.8.2)
|
40
50
|
|
41
51
|
PLATFORMS
|
42
52
|
ruby
|
43
53
|
|
44
54
|
DEPENDENCIES
|
55
|
+
debug
|
45
56
|
m (~> 1.5.1)
|
46
|
-
minitest (~> 5.0)
|
57
|
+
minitest (~> 5.18.0)
|
47
58
|
mocha (~> 1.11.2)
|
48
59
|
rake (~> 12.0)
|
49
60
|
simplecov_badger!
|
data/README.md
CHANGED
@@ -1,13 +1,16 @@
|
|
1
1
|
# SimpleCov::Badger
|
2
2
|
This gem is a formatter for SimpleCov. It sends the total test coverage from SimpleCov to a url via a post request.
|
3
3
|
The gem is connected with our simplecov badge service for rendering badge .svgs. See more at: https://coverage.traels.it
|
4
|
+
The badge can then be used in your readme.
|
4
5
|
|
5
6
|
## Installation
|
6
7
|
|
7
|
-
Add this line to your application's Gemfile:
|
8
|
+
Add this line to your application's Gemfile in the test, development group:
|
8
9
|
|
9
10
|
```ruby
|
10
|
-
|
11
|
+
group :development, :test do
|
12
|
+
gem 'simplecov_badger'
|
13
|
+
end
|
11
14
|
```
|
12
15
|
|
13
16
|
And then execute:
|
@@ -19,6 +22,7 @@ Or install it yourself as:
|
|
19
22
|
$ gem install simplecov_badger
|
20
23
|
|
21
24
|
Then run
|
25
|
+
|
22
26
|
$ bundle exec rake simplecov_badger:install
|
23
27
|
|
24
28
|
## Usage
|
@@ -26,6 +30,9 @@ Then run
|
|
26
30
|
There are very few things to do, before you can use the gem. The only necessary setup is to add the `SimpleCov::Badger::Formatter` to `SimpleCov`'s formatters in the same place you start `SimpleCov`:
|
27
31
|
|
28
32
|
```ruby
|
33
|
+
require "simplecov"
|
34
|
+
require "simplecov_badger"
|
35
|
+
|
29
36
|
SimpleCov.start do
|
30
37
|
SimpleCov.formatters = SimpleCov::Formatter::MultiFormatter.new(
|
31
38
|
[
|
@@ -36,10 +43,17 @@ SimpleCov.start do
|
|
36
43
|
end
|
37
44
|
```
|
38
45
|
|
39
|
-
And then setting the token you received from the install rake task in an env somewhere:
|
46
|
+
And then setting the token you received from the install rake task in an env somewhere, for example by using the [dotenv](https://rubygems.org/gems/dotenv) gem:
|
47
|
+
|
48
|
+
If you use rails we recommend setting the token in the [credentials](https://guides.rubyonrails.org/security.html#custom-credentials) instead and conf.
|
40
49
|
```ruby
|
41
|
-
|
42
|
-
|
50
|
+
# in config/initializers/simplecov_badger.rb
|
51
|
+
if Module.const_defined? "SimpleCov"
|
52
|
+
SimpleCov::Badger.configure do |config|
|
53
|
+
config.token = Rails.application.credentials.simplecov_badger[:token]
|
54
|
+
end
|
55
|
+
end
|
56
|
+
```
|
43
57
|
|
44
58
|
After running your test suite on your master branch, a url for your badge will be printed in the console.
|
45
59
|
Subsequent runs will update the badge on the same url.
|
@@ -60,6 +74,16 @@ The `repo_url` defaults to the git repo's origin url.
|
|
60
74
|
The `run_if` defaults to a lambda, that returns true if your current branch is master. This means the badge is only updated, when the test suite is run on the master branch. If replaced, it should be with another lambda that returns true whenever you want the badge updated.
|
61
75
|
`token` is used when updating your badge with a new coverage. It defaults to reading from an env variable. When running the install rake task, a token is saved at your projects root in a file called `.simplecov_badger_auth_token`. It is recommended to set this token as an env variable, when not running Rails. If you do use Rails, set the token in your test credentials and configure to read from there instead. Should you lose your token, there is currently no recovery process, but you can configure your repo_url to something else and run the install task again to get a new token.
|
62
76
|
|
77
|
+
Now every time your test suites is run on your master branch, a new badge is generated. A link to this badge can be found in the test output
|
78
|
+
```shell
|
79
|
+
SimpleCov::Badger: Your badge can be found at: https://coverage.traels.it/badges/some_base_64_encoded_string
|
80
|
+
```
|
81
|
+
Using markdown, the badge can be inserted like this:
|
82
|
+
```markdown
|
83
|
+
![SimpleCov coverage](https://coverage.traels.it/badges/some_base_64_encoded_string)
|
84
|
+
```
|
85
|
+
|
86
|
+
|
63
87
|
## Development
|
64
88
|
|
65
89
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
data/simplecov_badger.gemspec
CHANGED
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
|
|
25
25
|
spec.require_paths = ["lib"]
|
26
26
|
|
27
27
|
# dependencies
|
28
|
-
spec.add_dependency "simplecov", "
|
28
|
+
spec.add_dependency "simplecov", ">= 0.18.5"
|
29
29
|
spec.add_dependency "rest-client", "~> 2.1.0"
|
30
30
|
|
31
31
|
spec.add_development_dependency "m", "~> 1.5.1"
|
metadata
CHANGED
@@ -1,27 +1,27 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simplecov_badger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nicolai Bach Woller
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-04-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: simplecov
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 0.18.5
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 0.18.5
|
27
27
|
- !ruby/object:Gem::Dependency
|
@@ -75,6 +75,7 @@ extensions: []
|
|
75
75
|
extra_rdoc_files: []
|
76
76
|
files:
|
77
77
|
- ".gitignore"
|
78
|
+
- ".semaphore/semaphore.yml"
|
78
79
|
- ".travis.yml"
|
79
80
|
- Gemfile
|
80
81
|
- Gemfile.lock
|
@@ -96,7 +97,7 @@ licenses:
|
|
96
97
|
metadata:
|
97
98
|
homepage_uri: https://github.com/traels-it/simplecov_badger
|
98
99
|
source_code_uri: https://github.com/traels-it/simplecov_badger
|
99
|
-
post_install_message:
|
100
|
+
post_install_message:
|
100
101
|
rdoc_options: []
|
101
102
|
require_paths:
|
102
103
|
- lib
|
@@ -111,8 +112,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
111
112
|
- !ruby/object:Gem::Version
|
112
113
|
version: '0'
|
113
114
|
requirements: []
|
114
|
-
rubygems_version: 3.
|
115
|
-
signing_key:
|
115
|
+
rubygems_version: 3.3.7
|
116
|
+
signing_key:
|
116
117
|
specification_version: 4
|
117
118
|
summary: A small gem that posts simplecovs test coverage to a web service.
|
118
119
|
test_files: []
|