kapnismology 2.0.3 → 2.1.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
  SHA1:
3
- metadata.gz: 890f01127c9c0359c7f97dad35f98e13fd5de682
4
- data.tar.gz: 49ec395511015f659342068f96065a754d949445
3
+ metadata.gz: 4fb05baaf32255a8696ec983d04eca2bef595783
4
+ data.tar.gz: 97121d40d30b1b23aba809308ea362dc4b3596ba
5
5
  SHA512:
6
- metadata.gz: 469480f38bffa63661970259cdfca560920ad00d77b22236bbe6da4399b3fca0ae1663712302674dc4abeadd374009ec8fd9e5471c7da1165fa772b98c92404c
7
- data.tar.gz: 6ae0dc39dd74c2f1b2e5a01aa46d8258977683b0289c3f2c676ea1acaf471899815835914fdd25257f4ea25e105e0529610f537066a6f2db39918e734bdc2808
6
+ metadata.gz: ed406d08a7fe4cef98a03a4e5688a74881e923fcc39b4e8927c51d3e15fa12beaff52b4ee971aba3044bb2ce5ab27633c73e3068dc0450d8f8094f6c24344fef
7
+ data.tar.gz: ef19bb1558bf9c336571584a0a3ab06733e92aac779b22ea689e4d37946a851dc98f3ff2bf2117ecc86328b27f5720bc77fae83fb3cb6bd8f780b0e700f37185
data/README.md CHANGED
@@ -34,6 +34,7 @@ Sample:
34
34
  "passed": false,
35
35
  "count": 2,
36
36
  "trace_id": "d93abb9f-e0a2-467b-902f-b78069167e8f",
37
+ "codebase_revision": "7beb617",
37
38
  "items": [
38
39
  {
39
40
  "name": "database_smoke_test",
@@ -36,9 +36,11 @@ module Kapnismology
36
36
  },
37
37
  passed: evaluations.passed?,
38
38
  count: items.size,
39
- trace_id: Object.const_defined?(:Trace) ? Trace.id.trace_id.to_s : nil,
39
+ trace_id: ApplicationInformation.new.trace_id,
40
+ codebase_revision: ApplicationInformation.new.codebase_revision,
40
41
  items: items
41
42
  }
42
43
  end
43
44
  end
45
+
44
46
  end
data/lib/kapnismology.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  # Engines blow up when being autoloaded by Rails and at the same time loaded by other gems
2
2
  require 'kapnismology/engine' unless defined?(Kapnismology::Engine)
3
+ require 'kapnismology/application_information'
3
4
  require 'kapnismology/result'
4
5
  require 'kapnismology/evaluation'
5
6
  require 'kapnismology/evaluation_collection'
@@ -0,0 +1,22 @@
1
+ module Kapnismology
2
+ # This class provides information about the running environment the smoketest is being
3
+ # executed under.
4
+ class ApplicationInformation
5
+ INFO_UNKNOWN = ''
6
+
7
+ def trace_id
8
+ Object.const_defined?(:Trace) ? Trace.id.trace_id.to_s : INFO_UNKNOWN
9
+ end
10
+
11
+ def codebase_revision
12
+ latest_commit_info.split(/\s/).first || INFO_UNKNOWN
13
+ rescue Errno::ENOENT, StandardError
14
+ INFO_UNKNOWN
15
+ end
16
+
17
+ private
18
+ def latest_commit_info
19
+ `git show HEAD --abbrev-commit --oneline`
20
+ end
21
+ end
22
+ end
@@ -2,6 +2,7 @@ require 'kapnismology/terminal'
2
2
  module Kapnismology
3
3
  class RakeTask
4
4
  def output(allowed_tags = [SmokeTest::RUNTIME_TAG], blacklist = [])
5
+ puts "Running smoke test for codebase revision #{ApplicationInformation.new.codebase_revision}"
5
6
  evaluations = SmokeTestCollection.evaluations(allowed_tags, blacklist)
6
7
  puts
7
8
  puts
@@ -1,3 +1,3 @@
1
1
  module Kapnismology
2
- VERSION = '2.0.3'.freeze
2
+ VERSION = '2.1.0'.freeze
3
3
  end
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.0.3
4
+ version: 2.1.0
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-08-12 00:00:00.000000000 Z
11
+ date: 2016-08-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -148,6 +148,7 @@ files:
148
148
  - app/controllers/kapnismology/smoke_tests_controller.rb
149
149
  - config/routes.rb
150
150
  - lib/kapnismology.rb
151
+ - lib/kapnismology/application_information.rb
151
152
  - lib/kapnismology/engine.rb
152
153
  - lib/kapnismology/evaluation.rb
153
154
  - lib/kapnismology/evaluation_collection.rb