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 +4 -4
- data/README.md +3 -2
- data/lib/minitest/testmetrics_plugin.rb +5 -4
- data/testmetrics_minitest.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 10009e15675e7d25b2e890113447ef86dedbbe975045ffc41b74256f522eab3d
|
4
|
+
data.tar.gz: 559d298724cf102414ca29c4d9be00666ebe668551067e18042347a931f723d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
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 '
|
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'
|