statsd_test_harness 0.2.2 → 0.2.3
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/Gemfile.lock +1 -1
- data/README.md +18 -6
- data/config/sample_config.rb +2 -2
- data/lib/statsd_test_harness/processor.rb +4 -5
- data/lib/statsd_test_harness/tool.rb +6 -2
- data/lib/statsd_test_harness/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9109392ba60668b412fc26444d2344b8e012e366
|
4
|
+
data.tar.gz: 24ca43e168532862ea83b65a5c18aaade195677f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6386b7e3a6e1694b084a2a21c617bec5d617ebb3a28b4c5dd208176e2421fc581c9d7961132fe3c0a9173536f02b2e5d3210d1c4d99d401d9547cd6f0b650b38
|
7
|
+
data.tar.gz: c85d40cf5e424350d48591e9c95dad2d15fb69d41b135274d80d6ffed69820003c82800665c2c061766472fe10382b171fe67a899ac968ab53aecf8a1d30dd18
|
data/Gemfile.lock
CHANGED
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
|
-
|
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
|
|
data/config/sample_config.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'dotenv'
|
2
2
|
Dotenv.load
|
3
3
|
|
4
|
-
|
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.
|
17
|
-
|
18
|
-
|
19
|
-
|
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
|
-
|
16
|
-
|
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
|
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.
|
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-
|
11
|
+
date: 2015-08-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|