rspec_honeycomb_formatter 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 15eca023c29babb6b13ec87dac5c0276013251a079f2bdd459b1c9aaa45cddfb
4
- data.tar.gz: 1b3b44ecd7437411d4247bf0de972251054ff2d8ac5f556ddd549c9daf140026
3
+ metadata.gz: 3000213c71bcad9cc66828a8c2d33fe4eb4c56a2e2bcda42532f48f19ba52d79
4
+ data.tar.gz: 676ff241add28e74215fe45da3af3aea8548bf43e2a1e0d6ce2c484b22076c5c
5
5
  SHA512:
6
- metadata.gz: 8b424130f975bf124cc57e2e67e5c1d2745048372e25fcf712cdc18c83971568c6fbe388c42579ef5100b8e73c6c6e3e1f1050e618e2f05964ecb0987638730f
7
- data.tar.gz: c2859128a91a4f1c1676000d75821ae16c2b9daafc799badfa12257d24b7f952bc832b98ddcfbfce650bc862c7317adb74356a0c0c3eb6ae1fe969a2cccd6101
6
+ metadata.gz: 52757a1671f53829b6b9d507634ba0bdbfbc09cafe1a18451a4275f51802c0829ed3e50ca4054e171e1e98206f15e56aac9cf6d736fc5eb111ae5fb988d04b08
7
+ data.tar.gz: d332f0ca059be8b0d0cf086bd19c7ca319d005bc7ff51263ec7bfefde594a9563e9491a507af2e9e645e2118c811e732fc634029fcc37d8a1d23ffeff4e3401b
data/CHANGELOG.md ADDED
@@ -0,0 +1,30 @@
1
+ # Changelog
2
+
3
+ ## [Unreleased](https://github.com/puppetlabs/rspec_honeycomb_formatter/tree/HEAD)
4
+
5
+ [Full Changelog](https://github.com/puppetlabs/rspec_honeycomb_formatter/compare/v0.1.0...HEAD)
6
+
7
+ **Implemented enhancements:**
8
+
9
+ - \(IAC-373\) link spans to an existing trace using HTTP\_X\_HONEYCOMB\_TRACE [\#8](https://github.com/puppetlabs/rspec_honeycomb_formatter/pull/8) ([DavidS](https://github.com/DavidS))
10
+
11
+ ## [v0.1.0](https://github.com/puppetlabs/rspec_honeycomb_formatter/tree/v0.1.0) (2020-03-23)
12
+
13
+ [Full Changelog](https://github.com/puppetlabs/rspec_honeycomb_formatter/compare/d68415c9abe0d4eb9bb28e72fe4da740dc623112...v0.1.0)
14
+
15
+ **Implemented enhancements:**
16
+
17
+ - \(IAC-533\) Implement the rspec\_honeycomb\_formatter [\#3](https://github.com/puppetlabs/rspec_honeycomb_formatter/pull/3) ([DavidS](https://github.com/DavidS))
18
+
19
+ **Merged pull requests:**
20
+
21
+ - Bump honeycomb-beeline from 1.3.0 to 2.0.0 [\#7](https://github.com/puppetlabs/rspec_honeycomb_formatter/pull/7) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
22
+ - Bump rubocop from 0.80.0 to 0.80.1 [\#6](https://github.com/puppetlabs/rspec_honeycomb_formatter/pull/6) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
23
+ - Bump rubocop from 0.79.0 to 0.80.0 [\#5](https://github.com/puppetlabs/rspec_honeycomb_formatter/pull/5) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
24
+ - Bump rubocop-rspec from 1.38.0 to 1.38.1 [\#4](https://github.com/puppetlabs/rspec_honeycomb_formatter/pull/4) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
25
+ - Bump rake from 12.3.3 to 13.0.1 [\#2](https://github.com/puppetlabs/rspec_honeycomb_formatter/pull/2) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
26
+ - \(IAC-364\) Basic infrastructure [\#1](https://github.com/puppetlabs/rspec_honeycomb_formatter/pull/1) ([DavidS](https://github.com/DavidS))
27
+
28
+
29
+
30
+ \* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*
data/Gemfile CHANGED
@@ -9,3 +9,4 @@ gem 'rake', '~> 13.0'
9
9
  gem 'rspec', '~> 3.0'
10
10
  gem 'rubocop'
11
11
  gem 'rubocop-rspec'
12
+ gem 'github_changelog_generator'
data/Gemfile.lock CHANGED
@@ -1,23 +1,42 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rspec_honeycomb_formatter (0.1.0)
4
+ rspec_honeycomb_formatter (0.2.0)
5
5
  honeycomb-beeline
6
6
  rspec-core (~> 3.0)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
+ activesupport (6.0.2.2)
12
+ concurrent-ruby (~> 1.0, >= 1.0.2)
13
+ i18n (>= 0.7, < 2)
14
+ minitest (~> 5.1)
15
+ tzinfo (~> 1.1)
16
+ zeitwerk (~> 2.2)
11
17
  addressable (2.7.0)
12
18
  public_suffix (>= 2.0.2, < 5.0)
13
19
  ast (2.4.0)
20
+ concurrent-ruby (1.1.6)
14
21
  diff-lcs (1.3)
15
22
  domain_name (0.5.20190701)
16
23
  unf (>= 0.0.5, < 1.0.0)
24
+ faraday (0.17.3)
25
+ multipart-post (>= 1.2, < 3)
26
+ faraday-http-cache (2.0.0)
27
+ faraday (~> 0.8)
17
28
  ffi (1.12.2)
18
29
  ffi-compiler (1.0.1)
19
30
  ffi (>= 1.0.0)
20
31
  rake
32
+ github_changelog_generator (1.15.0)
33
+ activesupport
34
+ faraday-http-cache
35
+ multi_json
36
+ octokit (~> 4.6)
37
+ rainbow (>= 2.2.1)
38
+ rake (>= 10.0)
39
+ retriable (~> 3.0)
21
40
  honeycomb-beeline (2.0.0)
22
41
  libhoney (~> 1.14, >= 1.14.2)
23
42
  http (4.3.0)
@@ -30,16 +49,25 @@ GEM
30
49
  http-form_data (2.3.0)
31
50
  http-parser (1.2.1)
32
51
  ffi-compiler (>= 1.0, < 2.0)
52
+ i18n (1.8.2)
53
+ concurrent-ruby (~> 1.0)
33
54
  jaro_winkler (1.5.4)
34
55
  libhoney (1.14.4)
35
56
  addressable (~> 2.0)
36
57
  http (>= 2.0, < 5.0)
58
+ minitest (5.14.0)
59
+ multi_json (1.14.1)
60
+ multipart-post (2.1.1)
61
+ octokit (4.17.0)
62
+ faraday (>= 0.9)
63
+ sawyer (~> 0.8.0, >= 0.5.3)
37
64
  parallel (1.19.1)
38
- parser (2.7.0.4)
65
+ parser (2.7.0.5)
39
66
  ast (~> 2.4.0)
40
67
  public_suffix (4.0.3)
41
68
  rainbow (3.0.0)
42
69
  rake (13.0.1)
70
+ retriable (3.1.2)
43
71
  rexml (3.2.4)
44
72
  rspec (3.9.0)
45
73
  rspec-core (~> 3.9.0)
@@ -65,15 +93,23 @@ GEM
65
93
  rubocop-rspec (1.38.1)
66
94
  rubocop (>= 0.68.1)
67
95
  ruby-progressbar (1.10.1)
96
+ sawyer (0.8.2)
97
+ addressable (>= 2.3.5)
98
+ faraday (> 0.8, < 2.0)
99
+ thread_safe (0.3.6)
100
+ tzinfo (1.2.6)
101
+ thread_safe (~> 0.1)
68
102
  unf (0.1.4)
69
103
  unf_ext
70
104
  unf_ext (0.0.7.6)
71
105
  unicode-display_width (1.6.1)
106
+ zeitwerk (2.3.0)
72
107
 
73
108
  PLATFORMS
74
109
  ruby
75
110
 
76
111
  DEPENDENCIES
112
+ github_changelog_generator
77
113
  rake (~> 13.0)
78
114
  rspec (~> 3.0)
79
115
  rspec_honeycomb_formatter!
data/Rakefile CHANGED
@@ -1,9 +1,15 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'bundler/gem_tasks'
4
+ require 'github_changelog_generator/task'
4
5
  require 'rspec/core/rake_task'
5
6
  require 'rubocop/rake_task'
6
7
 
8
+ GitHubChangelogGenerator::RakeTask.new :changelog do |config|
9
+ config.user = 'puppetlabs'
10
+ config.project = 'rspec_honeycomb_formatter'
11
+ end
12
+
7
13
  RSpec::Core::RakeTask.new(:spec)
8
14
 
9
15
  RuboCop::RakeTask.new(:rubocop) do |task|
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class RSpecHoneycombFormatter
4
- VERSION = '0.1.0'
4
+ VERSION = '0.2.0'
5
5
  end
@@ -6,18 +6,21 @@ require 'honeycomb-beeline'
6
6
 
7
7
  Honeycomb.configure do |config|
8
8
  end
9
- process_span = Honeycomb.start_span(name: File.basename($PROGRAM_NAME))
10
- process_span.add_field('process.full_name', $PROGRAM_NAME)
11
- process_span.add_field('process.args', ARGV)
12
- at_exit do
13
- if $ERROR_INFO&.is_a?(SystemExit)
14
- process_span.add_field('process.exit_code', $ERROR_INFO.status)
15
- elsif $ERROR_INFO
16
- process_span.add_field('process.exit_code', $ERROR_INFO.class.name)
17
- else
18
- process_span.add_field('process.exit_code', 'unknown')
9
+ unless Honeycomb.current_span
10
+ process_span = Honeycomb.start_span(name: File.basename($PROGRAM_NAME), serialized_trace: ENV['HTTP_X_HONEYCOMB_TRACE'])
11
+ ENV['HTTP_X_HONEYCOMB_TRACE'] = process_span.to_trace_header unless ENV['HTTP_X_HONEYCOMB_TRACE']
12
+ Honeycomb.add_field_to_trace('process.full_name', $PROGRAM_NAME)
13
+ Honeycomb.add_field_to_trace('process.args', ARGV)
14
+ at_exit do
15
+ if $ERROR_INFO&.is_a?(SystemExit)
16
+ process_span.add_field('process.exit_code', $ERROR_INFO.status)
17
+ elsif $ERROR_INFO
18
+ process_span.add_field('process.exit_code', $ERROR_INFO.class.name)
19
+ else
20
+ process_span.add_field('process.exit_code', 'unknown')
21
+ end
22
+ process_span.send
19
23
  end
20
- process_span.send
21
24
  end
22
25
 
23
26
  # A custom formatter for RSpec that posts messages to https://honeycomb.io for analysis
@@ -32,7 +35,8 @@ class RSpecHoneycombFormatter
32
35
  end
33
36
 
34
37
  def start(notification)
35
- @start_span = Honeycomb.start_span(name: 'rspec')
38
+ @start_span = Honeycomb.start_span(name: 'rspec', serialized_trace: ENV['HTTP_X_HONEYCOMB_TRACE'])
39
+ ENV['HTTP_X_HONEYCOMB_TRACE'] = @start_span.to_trace_header unless ENV['HTTP_X_HONEYCOMB_TRACE']
36
40
  @start_span.add_field('rspec.example_count', notification.count)
37
41
  @start_span.add_field('rspec.load_time_ms', notification.load_time * 1000)
38
42
  end
@@ -49,6 +53,7 @@ class RSpecHoneycombFormatter
49
53
 
50
54
  def example_group_started(notification)
51
55
  @group_stack.push(group_span = Honeycomb.start_span(name: notification.group.description))
56
+ ENV['HTTP_X_HONEYCOMB_TRACE'] = group_span.to_trace_header unless ENV['HTTP_X_HONEYCOMB_TRACE']
52
57
  group_span.add_field('rspec.type', 'group')
53
58
  group_span.add_field('rspec.file_path', notification.group.file_path)
54
59
  group_span.add_field('rspec.location', notification.group.location)
@@ -61,6 +66,7 @@ class RSpecHoneycombFormatter
61
66
 
62
67
  def example_started(notification)
63
68
  @example_span = Honeycomb.start_span(name: 'unknown')
69
+ ENV['HTTP_X_HONEYCOMB_TRACE'] = @example_span.to_trace_header unless ENV['HTTP_X_HONEYCOMB_TRACE']
64
70
  @example_span.add_field('rspec.type', 'example')
65
71
  @example_span.add_field('rspec.file_path', notification.example.file_path)
66
72
  @example_span.add_field('rspec.location', notification.example.location)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec_honeycomb_formatter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Schmitt
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2020-03-23 00:00:00.000000000 Z
12
+ date: 2020-03-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: honeycomb-beeline
@@ -52,6 +52,7 @@ files:
52
52
  - ".rspec"
53
53
  - ".rubocop.yml"
54
54
  - ".travis.yml"
55
+ - CHANGELOG.md
55
56
  - Gemfile
56
57
  - Gemfile.lock
57
58
  - LICENSE