simplecov-buildkite 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +25 -11
- data/README.md +18 -3
- data/lib/simplecov/buildkite/annotation_formatter.rb +13 -3
- data/lib/simplecov/buildkite/version.rb +1 -1
- metadata +13 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e36c234f39a45a5ad45377384e89fb607ff930845c4721ffd7401137d29f45e7
|
4
|
+
data.tar.gz: dbdfe7265bd71b56a98fb622fb26a0d8dcd42e58f473db653e1d0a7cfa2c3c4f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c017b754d7276b541cdbe4f1ceb72ed91325c60d223fb02d80cb7861f963480ab3a0b40390e528b3c17748c0a6b77b989fb39ad0438a0579517000d3a2466581
|
7
|
+
data.tar.gz: 21de73e229ee87dc405e4004b85752d74a8c8f2196dc2da6f4013950f75ed0f398cad02b0ab2d2f0f0f41dd120e069d2674e557b63f31b7122d18ff4a0d85c96
|
data/CHANGELOG.md
CHANGED
@@ -5,31 +5,45 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
|
5
5
|
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
6
6
|
|
7
7
|
## [Unreleased]
|
8
|
-
-
|
8
|
+
[Unreleased]: https://github.com/buildkite/simplecov-buildkite/compare/v0.3.0...HEAD
|
9
|
+
|
10
|
+
- Nothing yet.
|
11
|
+
|
12
|
+
## [0.3.0] - 2024-01-10
|
13
|
+
[0.3.0]: https://github.com/buildkite/simplecov-buildkite/compare/v0.2.0...v0.3.0
|
14
|
+
|
15
|
+
### Added
|
16
|
+
- Set the annotation title with the `SIMPLECOV_BUILDKITE_TITLE` env var
|
17
|
+
([#21](https://github.com/buildkite/simplecov-buildkite/pull/21))
|
18
|
+
- Set the annotation context with the `SIMPLECOV_BUILDKITE_CONTEXT` env var. This is useful for
|
19
|
+
adding multiple annotations to a single build
|
20
|
+
([#18](https://github.com/buildkite/simplecov-buildkite/pull/18),
|
21
|
+
[#21](https://github.com/buildkite/simplecov-buildkite/pull/21))
|
9
22
|
|
10
23
|
## [0.2.0] - 2020-09-08
|
24
|
+
[0.2.0]: https://github.com/buildkite/simplecov-buildkite/compare/v0.1.1...v0.2.0
|
25
|
+
|
26
|
+
### Changed
|
11
27
|
- git integration: SimpleCov groups are automatically generated based on branch
|
12
28
|
and commit metadata.
|
13
|
-
([#2](https://github.com/
|
14
|
-
[#8](https://github.com/
|
29
|
+
([#2](https://github.com/buildkite/simplecov-buildkite/pull/2),
|
30
|
+
[#8](https://github.com/buildkite/simplecov-buildkite/pull/8))
|
15
31
|
- Headers are now in sentence case
|
16
|
-
([#9](https://github.com/
|
32
|
+
([#9](https://github.com/buildkite/simplecov-buildkite/pull/9))
|
17
33
|
- Update specs for SimpleCov 0.19.0
|
18
|
-
([#12](https://github.com/
|
34
|
+
([#12](https://github.com/buildkite/simplecov-buildkite/pull/12))
|
19
35
|
|
20
36
|
## [0.1.1] - 2018-05-30
|
37
|
+
[0.1.1]: https://github.com/buildkite/simplecov-buildkite/compare/v0.1.0...v0.1.1
|
38
|
+
|
21
39
|
### Changed
|
22
40
|
- Output is now enclosed in a `<details>` for a brief summary with expandable
|
23
41
|
group stats
|
24
42
|
|
25
43
|
## [0.1.0] - 2018-05-30
|
44
|
+
[0.1.0]: https://github.com/buildkite/simplecov-buildkite/commits/v0.1.0
|
45
|
+
|
26
46
|
### Added
|
27
47
|
- New gem, simplecov-buildkite. 🎉
|
28
48
|
- Buildkite annotation formatter to consolidate reports from multiple simplecov
|
29
49
|
runs into a Buildkite annotation.
|
30
|
-
|
31
|
-
[Unreleased]: https://github.com/ticky/simplecov-buildkite/compare/v0.2.0...HEAD
|
32
|
-
[0.2.0]: https://github.com/ticky/simplecov-buildkite/compare/v0.2.0...v0.1.1
|
33
|
-
[0.1.1]: https://github.com/ticky/simplecov-buildkite/compare/v0.1.0...v0.1.1
|
34
|
-
[0.1.0]: https://github.com/ticky/simplecov-buildkite/commits/v0.1.0
|
35
|
-
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# SimpleCov::Buildkite
|
2
2
|
|
3
|
-
[](https://rubygems.org/gems/simplecov-buildkite) [](https://rubygems.org/gems/simplecov-buildkite) [](https://travis-ci.org/buildkite/simplecov-buildkite)
|
4
4
|
|
5
5
|
Generate [Buildkite annotations] from your [SimpleCov] coverage reports when running your build on [Buildkite].
|
6
6
|
|
@@ -49,6 +49,21 @@ When run on Buildkite with the `"buildkite"` profile enabled, this will also out
|
|
49
49
|
|
50
50
|
<img width="577" alt="Buildkite build showing a SimpleCov report in a Buildkite annotation" src="https://user-images.githubusercontent.com/282113/42116587-c2e9731e-7bac-11e8-9d2f-50fa7f071f09.png">
|
51
51
|
|
52
|
+
You can customize the title and annotation context using environment variables in your Pipeline. You can provide multiple coverage reports for a single build by providing distinct values for the annotation context.
|
53
|
+
|
54
|
+
```yaml
|
55
|
+
steps:
|
56
|
+
- command: bin/rails engine1:spec
|
57
|
+
env:
|
58
|
+
SIMPLECOV_BUILDKITE_TITLE: "Engine 1 Coverage"
|
59
|
+
SIMPLECOV_BUILDKITE_CONTEXT: "engine-1-coverage"
|
60
|
+
|
61
|
+
- command: bin/rails engine2:spec
|
62
|
+
env:
|
63
|
+
SIMPLECOV_BUILDKITE_TITLE: "Engine 2 Coverage"
|
64
|
+
SIMPLECOV_BUILDKITE_CONTEXT: "engine-2-coverage"
|
65
|
+
```
|
66
|
+
|
52
67
|
[Rails]: https://rubyonrails.org
|
53
68
|
[RSpec]: http://rspec.info
|
54
69
|
|
@@ -60,7 +75,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
60
75
|
|
61
76
|
## Contributing
|
62
77
|
|
63
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
78
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/buildkite/simplecov-buildkite. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant] code of conduct.
|
64
79
|
|
65
80
|
[Contributor Covenant]: http://contributor-covenant.org
|
66
81
|
|
@@ -70,4 +85,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
70
85
|
|
71
86
|
## Code of Conduct
|
72
87
|
|
73
|
-
Everyone interacting in the SimpleCov::Buildkite project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/
|
88
|
+
Everyone interacting in the SimpleCov::Buildkite project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/buildkite/simplecov-buildkite/blob/master/CODE_OF_CONDUCT.md).
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require "shellwords"
|
2
|
+
|
1
3
|
module SimpleCov::Buildkite
|
2
4
|
class AnnotationFormatter
|
3
5
|
GIT_ANNOTATION_FORMAT_REGEX = /^Files (?<action>changed|added) in (?<changeset>[a-zA-Z0-9.]+)$/
|
@@ -7,7 +9,7 @@ module SimpleCov::Buildkite
|
|
7
9
|
.values_at(:git, :general)
|
8
10
|
|
9
11
|
message = <<~MESSAGE
|
10
|
-
####
|
12
|
+
#### #{annotation_title}
|
11
13
|
|
12
14
|
<dl class="flex flex-wrap m1 mxn2">
|
13
15
|
MESSAGE
|
@@ -55,7 +57,7 @@ module SimpleCov::Buildkite
|
|
55
57
|
if ENV['BUILDKITE']
|
56
58
|
system 'buildkite-agent',
|
57
59
|
'annotate',
|
58
|
-
'--context',
|
60
|
+
'--context', annotation_context,
|
59
61
|
'--style', 'info',
|
60
62
|
message
|
61
63
|
else
|
@@ -65,6 +67,14 @@ module SimpleCov::Buildkite
|
|
65
67
|
|
66
68
|
private
|
67
69
|
|
70
|
+
def annotation_title
|
71
|
+
ENV.fetch("SIMPLECOV_BUILDKITE_TITLE", "Coverage")
|
72
|
+
end
|
73
|
+
|
74
|
+
def annotation_context
|
75
|
+
Shellwords.shellescape(ENV.fetch("SIMPLECOV_BUILDKITE_CONTEXT", "simplecov"))
|
76
|
+
end
|
77
|
+
|
68
78
|
def ignore_empty_groups(groups)
|
69
79
|
groups.select do |_name, group|
|
70
80
|
(group.covered_lines + group.missed_lines).positive?
|
@@ -98,7 +108,7 @@ module SimpleCov::Buildkite
|
|
98
108
|
|
99
109
|
metric += <<~METRIC_VALUE
|
100
110
|
|
101
|
-
**<span class="h2 regular">#{format_float(element.covered_percent)}</span>%**
|
111
|
+
**<span class="h2 regular">#{format_float(element.covered_percent)}</span>%**
|
102
112
|
#{format_line_count(element)}
|
103
113
|
|
104
114
|
METRIC_VALUE
|
metadata
CHANGED
@@ -1,15 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simplecov-buildkite
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
8
|
-
|
9
|
-
autorequire:
|
7
|
+
- Buildkite
|
8
|
+
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2024-01-10 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: simplecov
|
@@ -29,16 +28,16 @@ dependencies:
|
|
29
28
|
name: bundler
|
30
29
|
requirement: !ruby/object:Gem::Requirement
|
31
30
|
requirements:
|
32
|
-
- - "
|
31
|
+
- - ">="
|
33
32
|
- !ruby/object:Gem::Version
|
34
|
-
version: '
|
33
|
+
version: '0'
|
35
34
|
type: :development
|
36
35
|
prerelease: false
|
37
36
|
version_requirements: !ruby/object:Gem::Requirement
|
38
37
|
requirements:
|
39
|
-
- - "
|
38
|
+
- - ">="
|
40
39
|
- !ruby/object:Gem::Version
|
41
|
-
version: '
|
40
|
+
version: '0'
|
42
41
|
- !ruby/object:Gem::Dependency
|
43
42
|
name: rake
|
44
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -67,10 +66,9 @@ dependencies:
|
|
67
66
|
- - "~>"
|
68
67
|
- !ruby/object:Gem::Version
|
69
68
|
version: '3.0'
|
70
|
-
description:
|
69
|
+
description:
|
71
70
|
email:
|
72
|
-
-
|
73
|
-
- sj26@sj26.com
|
71
|
+
- support@buildkite.com
|
74
72
|
executables: []
|
75
73
|
extensions: []
|
76
74
|
extra_rdoc_files: []
|
@@ -89,7 +87,7 @@ licenses:
|
|
89
87
|
- MIT
|
90
88
|
metadata:
|
91
89
|
changelog_uri: https://github.com/ticky/simplecov-buildkite/blob/master/CHANGELOG.md
|
92
|
-
post_install_message:
|
90
|
+
post_install_message:
|
93
91
|
rdoc_options: []
|
94
92
|
require_paths:
|
95
93
|
- lib
|
@@ -104,8 +102,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
104
102
|
- !ruby/object:Gem::Version
|
105
103
|
version: '0'
|
106
104
|
requirements: []
|
107
|
-
rubygems_version: 3.
|
108
|
-
signing_key:
|
105
|
+
rubygems_version: 3.5.3
|
106
|
+
signing_key:
|
109
107
|
specification_version: 4
|
110
108
|
summary: Generate SimpleCov reports for your parallel Buildkite builds
|
111
109
|
test_files: []
|