build_metrics_logger 0.0.12 → 0.0.13

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/build_metrics_logger.rb +5 -12
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e603a1321cff3bfa3aa3b40658b355e07bd8f1f6
4
- data.tar.gz: ea50792508f1c00f0914fbeeb93f4463e09ccd93
3
+ metadata.gz: 1889f5e530180cd1d423f9a7a4e141d4af271d55
4
+ data.tar.gz: 0efe259fc5d5160a2a56109b16b31cbc9959b5ac
5
5
  SHA512:
6
- metadata.gz: 8d22d0c1344a590fd5993c4ebbe9a150d2b5131155d17806033f34a18ea39401d0ac6ba25a71f0db5367d98dcf13f01b20ad56e784a0fb383e467153d8f8731e
7
- data.tar.gz: fbffcd11b456e183bd0156a6805613f99736a92c3a1e4deb2b716aed0ed21863e46659e0fe083a0465b3d5b03d97ee16779bd8c432c42730dc89f2aed24d9c30
6
+ metadata.gz: d3ec8e5e981fba709303a9fb87cb4da304d5d30ee2b68c6fc16eaf78d7199bfbb969d9ae644fec84ca67d0dbc72f63eca57ef1add0c0a02b7308a38d6603acad
7
+ data.tar.gz: eecc979901f08c2683433bf708342c2edb638a8494ece9c567fad00385eaa7a0b42c389cee42147dcb072fb2725c0372961335b4293e967dd593677e6b0d3f18
@@ -2,11 +2,8 @@ require 'httparty'
2
2
 
3
3
  class BuildMetricsLogger
4
4
  def initialize(token = nil)
5
- puts "Listener Initialized"
6
5
  @token = token
7
6
  @build_id = ENV.fetch('BUILD_METRICS_LOGGER_ID')
8
- puts "Token: #{@token}"
9
- puts "ID: #{@build_id}"
10
7
  end
11
8
 
12
9
  def start(notification)
@@ -31,7 +28,7 @@ class BuildMetricsLogger
31
28
  end
32
29
 
33
30
  def example_finished(notification)
34
- if notification.example.metadata[:e2e] == true #&& ENV.fetch('IS_LOCAL', 'true') == 'false'
31
+ if notification.example.metadata[:e2e] == true && ENV.fetch('IS_LOCAL', 'true') == 'false'
35
32
  id = notification.example.id.to_s
36
33
  description = notification.example.full_description.to_s
37
34
  location = notification.example.location.to_s
@@ -47,7 +44,7 @@ class BuildMetricsLogger
47
44
  end
48
45
 
49
46
  def suite_finished(notification)
50
- if notification.examples[0].metadata[:e2e] == true #&& ENV.fetch('IS_LOCAL', 'true') == 'false'
47
+ if notification.examples[0].metadata[:e2e] == true && ENV.fetch('IS_LOCAL', 'true') == 'false'
51
48
  time = notification.duration
52
49
  passed = notification.failure_count == 0 ? true : false
53
50
  build_data = {time: time, passed: passed}
@@ -66,7 +63,7 @@ class BuildMetricsLogger
66
63
  end
67
64
 
68
65
  def log_example_result(data)
69
- response = HTTParty.post(example_result_url,
66
+ HTTParty.post(example_result_url,
70
67
  headers: {
71
68
  "Authorization" => "Bearer #{@token}"
72
69
  },
@@ -78,22 +75,18 @@ class BuildMetricsLogger
78
75
  runtime: data[:time]
79
76
  }
80
77
  )
81
-
82
- puts response
83
78
  end
84
79
 
85
80
  def log_build_result(data)
86
- response = HTTParty.post(build_result_url,
81
+ HTTParty.post(build_result_url,
87
82
  headers: {
88
83
  "Authorization" => "Bearer #{@token}"
89
84
  },
90
85
  body: {
91
86
  passed: data[:passed],
92
- time: data[:time],
87
+ runtime: data[:time],
93
88
  build: @build_id
94
89
  }
95
90
  )
96
-
97
- puts response
98
91
  end
99
92
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: build_metrics_logger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.12
4
+ version: 0.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Nelson