kapnismology 2.2.0 → 2.2.1
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/app/controllers/kapnismology/smoke_tests_controller.rb +2 -26
- data/lib/kapnismology.rb +1 -0
- data/lib/kapnismology/evaluation.rb +1 -1
- data/lib/kapnismology/evaluation_collection.rb +2 -2
- data/lib/kapnismology/smoke_test_response.rb +31 -0
- data/lib/kapnismology/version.rb +1 -1
- metadata +17 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 51c9bd5b25a2eff1be770baeb7ca2046f757e589
|
4
|
+
data.tar.gz: 8d7d741333c07ec96c7dee8b88ccede3ce5c10f5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6fa2922b7ec761a04001292743ce4695a8cba5d504c55936a4c28a026fe7ebddd12cbfe8b4fe3f15bb27c5cec8336058a0d9f54431b7afcf6669bb378d8d2a51
|
7
|
+
data.tar.gz: 5ee7a610033ee55a7a3d025331baeba88bb93fbb059d03ed01c0e59b44ff7853087ccb236a03a2f3abdbac23b7349087be0bccc66ff9fbbba036c268129e90db
|
@@ -2,11 +2,10 @@ module Kapnismology
|
|
2
2
|
# This is called when the user goes to the /smoke_test URL. This calls all the
|
3
3
|
# smoke tests registered in the application and gather the results
|
4
4
|
class SmokeTestsController < ApplicationController
|
5
|
-
PROFILE_URL = 'http://tbd.mdsol.com'.freeze
|
6
5
|
|
7
6
|
def index
|
8
|
-
|
9
|
-
render json:
|
7
|
+
response = SmokeTestResponse.new(SmokeTestCollection.evaluations(allowed_tags, blacklist))
|
8
|
+
render json: response.render(request.original_url), status: response.status
|
10
9
|
end
|
11
10
|
|
12
11
|
private
|
@@ -18,29 +17,6 @@ module Kapnismology
|
|
18
17
|
def blacklist
|
19
18
|
params[:skip].to_s.split(',')
|
20
19
|
end
|
21
|
-
|
22
|
-
def status(evaluations)
|
23
|
-
if evaluations.passed?
|
24
|
-
:ok
|
25
|
-
else
|
26
|
-
:service_unavailable
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
def results(evaluations)
|
31
|
-
items = evaluations.as_json.select { |e| e.has_key?(:passed) }
|
32
|
-
{
|
33
|
-
_links: {
|
34
|
-
self: CGI.unescape(request.original_url),
|
35
|
-
profile: PROFILE_URL
|
36
|
-
},
|
37
|
-
passed: evaluations.passed?,
|
38
|
-
count: items.size,
|
39
|
-
trace_id: ApplicationInformation.new.trace_id,
|
40
|
-
codebase_revision: ApplicationInformation.new.codebase_revision,
|
41
|
-
items: items
|
42
|
-
}
|
43
|
-
end
|
44
20
|
end
|
45
21
|
|
46
22
|
end
|
data/lib/kapnismology.rb
CHANGED
@@ -0,0 +1,31 @@
|
|
1
|
+
module Kapnismology
|
2
|
+
# A summary of a run containing smoke test evaluations
|
3
|
+
class SmokeTestResponse
|
4
|
+
|
5
|
+
PROFILE_URL = 'http://tbd.mdsol.com'.freeze
|
6
|
+
|
7
|
+
def initialize(evaluations)
|
8
|
+
@evaluations = evaluations
|
9
|
+
end
|
10
|
+
|
11
|
+
def status
|
12
|
+
@evaluations.passed? ? 200 : 503
|
13
|
+
end
|
14
|
+
|
15
|
+
def render(request_url)
|
16
|
+
items = @evaluations.to_hash.select { |e| e.has_key?(:passed) }
|
17
|
+
{
|
18
|
+
_links: {
|
19
|
+
self: CGI.unescape(request_url),
|
20
|
+
profile: PROFILE_URL
|
21
|
+
},
|
22
|
+
passed: @evaluations.passed?,
|
23
|
+
count: items.size,
|
24
|
+
trace_id: ApplicationInformation.new.trace_id,
|
25
|
+
codebase_revision: ApplicationInformation.new.codebase_revision,
|
26
|
+
items: items
|
27
|
+
}.to_json
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
end
|
data/lib/kapnismology/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kapnismology
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jordi Polo Carres
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-09-
|
11
|
+
date: 2016-09-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '3.4'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec-json_expectations
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1.4'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.4'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: byebug
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -157,6 +171,7 @@ files:
|
|
157
171
|
- lib/kapnismology/smoke_test.rb
|
158
172
|
- lib/kapnismology/smoke_test_collection.rb
|
159
173
|
- lib/kapnismology/smoke_test_failed.rb
|
174
|
+
- lib/kapnismology/smoke_test_response.rb
|
160
175
|
- lib/kapnismology/spec_helper.rb
|
161
176
|
- lib/kapnismology/terminal.rb
|
162
177
|
- lib/kapnismology/version.rb
|