testmetrics_minitest 1.0.2 → 1.0.3

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: 2da6647ab30704ebb72795402b32417f0bbd75457d88f7d94744dd97edd16058
4
- data.tar.gz: 5987ac4fa20077b567fa129d62084ff94837b04050cd7aed1f84899dcef21875
3
+ metadata.gz: 10009e15675e7d25b2e890113447ef86dedbbe975045ffc41b74256f522eab3d
4
+ data.tar.gz: 559d298724cf102414ca29c4d9be00666ebe668551067e18042347a931f723d3
5
5
  SHA512:
6
- metadata.gz: ae71a5f00425abea509c0d004e10ae0494c1da8d77b7d76f331ea74cee8d8552bee504732e4d25578a9e1aa92f09385f7a9307686ff0012bc7283406b11d43c6
7
- data.tar.gz: bf1e12d2495d28bcacec9a84bd0d7b380492216eb010ed9f804df82f334c32b880fa2d92b18cb38396c905a6539926ceee68f1e81c08ddbba055e4ee7b46779e
6
+ metadata.gz: 116d595f7a36835f1311252a7bf1075fe39300e23cb51f2b55f2824bd9336844cf057b8e5796d8400c8e54d732d796315653039dcf67befa8844aa83e1e9c771
7
+ data.tar.gz: be6121a2451aa9244b887a7360a0bdf6bbd55a06e0673bae6388a24fbb4563722a6d242cbd9fcdee56fceba7e56d262ca0c211a32aef09337c25d87789f18c20
data/README.md CHANGED
@@ -18,13 +18,14 @@ end
18
18
  Then, right after your call to `require 'minitest'`, add
19
19
  `require 'minitest/testmetrics'` to enable the Testmetrics reporter.
20
20
 
21
+ See [here](https://github.com/devonestes/sinatra/commit/6b5229d79f01c8f5ffb3ae2263c62b70d19da024) for a diff showing
22
+ exactly what was needed to add Testmetrics to Sinatra - it's just 3 lines!
23
+
21
24
  In order for the metrics to be sent to Testmetrics, you must have your
22
25
  Testmetrics Project Key set in the `TESTMETRICS_PROJECT_KEY` environment
23
26
  variable in your CI environment. If this environment variable isn't set, the
24
27
  collected metrics for your CI run will be discarded.
25
28
 
26
- This key should be kept private and not exposed to the public.
27
-
28
29
  ## License
29
30
 
30
31
  `testmetrics_minitest` is offered under the MIT license. For the full license
@@ -69,7 +69,6 @@ module Minitest
69
69
  end
70
70
 
71
71
  testmetrics_results[:total_run_time] = total_time
72
- puts "\nSending results to Testmetrics server..."
73
72
  post_results(testmetrics_results) unless testmetrics_results[:key] == 'Unknown'
74
73
  end
75
74
 
@@ -79,7 +78,7 @@ module Minitest
79
78
  TRAVIS_EVENT_TYPE
80
79
  CIRCLE_BRANCH
81
80
  CI_COMMIT_REF_NAME
82
- BRANCH_NAME
81
+ SEMAPHORE_GIT_BRANCH
83
82
  ].freeze
84
83
  def git_branch
85
84
  correct_var = correct_var(BRANCH_VARS)
@@ -100,7 +99,7 @@ module Minitest
100
99
  end
101
100
  end
102
101
 
103
- SHA_VARS = %w[TRAVIS_COMMIT CIRCLE_SHA1 CI_COMMIT_SHA REVISION].freeze
102
+ SHA_VARS = %w[TRAVIS_COMMIT CIRCLE_SHA1 CI_COMMIT_SHA SEMAPHORE_GIT_SHA].freeze
104
103
  def git_sha
105
104
  correct_var = correct_var(SHA_VARS)
106
105
  correct_var.nil? ? 'Unknown' : ENV[correct_var]
@@ -111,7 +110,7 @@ module Minitest
111
110
  when 'TRAVIS_COMMIT' then 'Travis CI'
112
111
  when 'CIRCLE_SHA1' then 'Circle CI'
113
112
  when 'CI_COMMIT_SHA' then 'Gitlab CI'
114
- when 'REVISION' then 'Semaphore CI'
113
+ when 'SEMAPHORE_GIT_SHA' then 'Semaphore CI'
115
114
  else 'Unknown'
116
115
  end
117
116
  end
@@ -121,6 +120,8 @@ module Minitest
121
120
  end
122
121
 
123
122
  def post_results(results)
123
+ puts "\nSending results to Testmetrics server..."
124
+
124
125
  Faraday.post do |req|
125
126
  req.url 'https://www.testmetrics.app/results'
126
127
  req.headers['Content-Type'] = 'application/json'
@@ -3,7 +3,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
3
 
4
4
  Gem::Specification.new do |spec|
5
5
  spec.name = 'testmetrics_minitest'
6
- spec.version = '1.0.2'
6
+ spec.version = '1.0.3'
7
7
  spec.authors = ['Devon Estes']
8
8
  spec.email = ['devon.c.estes@gmail.com']
9
9
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: testmetrics_minitest
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Devon Estes