statsd_test_harness 0.2.2 → 0.2.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
  SHA1:
3
- metadata.gz: ca23a6863212eb3c4caf8448cc06eae8c46ac16b
4
- data.tar.gz: 9566f1806f64f3283f41524d74717668a54725db
3
+ metadata.gz: 9109392ba60668b412fc26444d2344b8e012e366
4
+ data.tar.gz: 24ca43e168532862ea83b65a5c18aaade195677f
5
5
  SHA512:
6
- metadata.gz: 3c99b633128b529ab869204e511b81841644d0b0c432c1ab058d6a06ed705964c51f2ff0f52c4e8390403fbbb1c27139e8c051e7e038948c29883fdec088ce8d
7
- data.tar.gz: 62f3d600b5ab4aa87d7064ac057ba335132da85db669b69994f743fa151d2c02486b7bf3570ed7c7876e7debdd793719067d0357e59562af3291d8fdb63cc504
6
+ metadata.gz: 6386b7e3a6e1694b084a2a21c617bec5d617ebb3a28b4c5dd208176e2421fc581c9d7961132fe3c0a9173536f02b2e5d3210d1c4d99d401d9547cd6f0b650b38
7
+ data.tar.gz: c85d40cf5e424350d48591e9c95dad2d15fb69d41b135274d80d6ffed69820003c82800665c2c061766472fe10382b171fe67a899ac968ab53aecf8a1d30dd18
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- statsd_test_harness (0.2.1)
4
+ statsd_test_harness (0.2.3)
5
5
  dotenv (~> 2.0)
6
6
  require_all (~> 1.3)
7
7
  statsd-ruby (~> 0.3.0)
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # StatsdTestHarness
2
2
 
3
- A test harness that captures output of various testing frameworks to post to statsd.
3
+ A test harness that captures output of various testing frameworks to post to a statsd server.
4
4
 
5
5
  ## Installation
6
6
 
@@ -29,17 +29,29 @@ Set the following environment variables for statsd integration:
29
29
 
30
30
  ## Usage
31
31
 
32
- To start a graphite/statsd docker file:
33
-
34
- docker run -d --name graphite --restart=always -p 80:80 -p 2003:2003 -p 8125:8125/udp hopsoft/graphite-statsd -e VIRTUAL_HOST=graphite.docker
35
-
36
32
  You must specify a config file at runtime:
37
33
 
38
34
  wrap run_suite --config path/to/config/file.rb
39
35
 
40
36
  For an example of what the config file should look like, refer to config/sample_config.rb
41
37
 
42
- In your config file, set the `ignore_return_value` flag to false if you don't want to report an unsuccessful test run (based on exit status).
38
+ To register a new test framework, add it to the `config.tools` array in your config file, e.g.
39
+
40
+ {
41
+ name: 'my_framework',
42
+ command: 'test',
43
+ label: 'my_framework',
44
+ options: '',
45
+ ignore_return_value: true
46
+ }
47
+
48
+ Set the `ignore_return_value` flag to false if you don't want to report an unsuccessful test run (based on exit status).
49
+
50
+ ## Development
51
+
52
+ To start a graphite/statsd docker container for testing purposes:
53
+
54
+ docker run -d --name graphite --restart=always -p 80:80 -p 2003:2003 -p 8125:8125/udp hopsoft/graphite-statsd -e VIRTUAL_HOST=graphite.docker
43
55
 
44
56
  ## Contributing
45
57
 
@@ -1,7 +1,7 @@
1
1
  require 'dotenv'
2
2
  Dotenv.load
3
3
 
4
- StatsdTess.configure do |config|
4
+ StatsdTestHarness.configure do |config|
5
5
  config.host = ENV['STATSD_HOST']
6
6
  config.port = ENV['STATSD_PORT']
7
7
  config.app_name = ENV['STATSD_APP_NAME']
@@ -11,7 +11,7 @@ StatsdTess.configure do |config|
11
11
  {
12
12
  name: 'rspec',
13
13
  command: 'rspec',
14
- options: '',
14
+ options: 'spec/models/conversation_spec.rb',
15
15
  ignore_return_value: true
16
16
  }
17
17
  ]
@@ -13,11 +13,10 @@ module StatsdTestHarness
13
13
  def run
14
14
  StatsdTestHarness.config.tools.each do |tool_harness|
15
15
  tool = Tool.new(tool_harness)
16
- puts "Executing #{tool.label} test suite for #{StatsdTestHarness.config.app_name}..."
17
- if duration = with_timing{tool.run}
18
- StatsdTestHarness::Client.new.post(duration, tool.name)
19
- puts "Test suite for #{tool.label} completed in #{duration} ms."
20
- end
16
+ puts "Executing #{tool.name} test suite for #{StatsdTestHarness.config.app_name}..."
17
+ duration = with_timing{tool.run}
18
+ StatsdTestHarness::Client.new.post(duration, tool.name)
19
+ puts "Test suite for #{tool.name} completed in #{duration} ms."
21
20
  end
22
21
  end
23
22
 
@@ -12,8 +12,12 @@ module StatsdTestHarness
12
12
  end
13
13
 
14
14
  def run
15
- output = `#{self.command} #{self.options}`
16
- puts output
15
+ cmd = open("| #{self.command} #{self.options}")
16
+ cmd.each_line do |io|
17
+ print io
18
+ end
19
+ cmd.close
20
+
17
21
  if $?.to_i > 0 && ! ignore_return_value
18
22
  raise "Test run returned non-zero status, results not submitted."
19
23
  end
@@ -1,3 +1,3 @@
1
1
  module StatsdTestHarness
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: statsd_test_harness
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - CoralineAda
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-12 00:00:00.000000000 Z
11
+ date: 2015-08-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor