drntest 1.1.1 → 1.1.2

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: 2b3b80ccd126e2d0a6a7ad3e382dba7b649e8bdd
4
- data.tar.gz: 357a79d56578bbcd180923738cb4347b939b1da7
3
+ metadata.gz: 6f726abaf99e69946e00326d0c793453418bab22
4
+ data.tar.gz: 06482427d09d7a13fc941195c563dcb53b1f0e72
5
5
  SHA512:
6
- metadata.gz: 6be667ad7d2f5cc435c094c598290e70f91711c846daa547fe68351972b2084aff707b0ad3558fa59dfe154f8a67d4442bf8f88b65391e07e45cc689bb273ccf
7
- data.tar.gz: 4e89a601e6f3f91a71eaeb488d0155fa8a27a07a2d7e4f9fdfe50e8aedec952914acce61ea8ada086c9458da253b89a0724d2a143d96e7dff7243fa55e56a42c
6
+ metadata.gz: 275fd9a91d5049eee3c5b3c7008b7a81e12dd1f9cb7336dc10dc991ecb262e43782c43aefb3daf5e9a2bf5c7d2ac29180a159b2fc4bbcd3e4f88f2cb72940f0f
7
+ data.tar.gz: 54f655562fb16f1ecfad673864ab9c04dc833664100dee4e12d9825c4dbcc1741ab318ed4db1a7c0c26852e468a2e27fb0400e45b40f1f77d554305e5f98dbf1
@@ -43,13 +43,32 @@ module Drntest
43
43
 
44
44
  private
45
45
  def prepare
46
- if catalog_file.exist?
47
- catalog_json = JSON.parse(catalog_file.read, :symbolize_names => true)
48
- zone = catalog_json[:zones].first
46
+ return unless catalog_file.exist?
47
+
48
+ catalog_json = JSON.parse(catalog_file.read)
49
+ case catalog_json["version"]
50
+ when 1
51
+ zone = catalog_json["zones"].first
49
52
  /\A([^:]+):(\d+)\/(.+)\z/ =~ zone
50
53
  @config.host = "localhost" # $1
51
54
  @config.port = $2.to_i
52
55
  @config.tag = $3
56
+ when 2
57
+ catch do |tag|
58
+ datasets = catalog_json["datasets"]
59
+ datasets.each do |name, dataset|
60
+ dataset["replicas"].each do |replica|
61
+ replica["slices"].each do |slice|
62
+ if /\A([^:]+):(\d+)\/([^.]+)/ =~ slice["volume"]["address"]
63
+ @config.host = "localhost" # $1
64
+ @config.port = $2.to_i
65
+ @config.tag = $3
66
+ throw(tag)
67
+ end
68
+ end
69
+ end
70
+ end
71
+ end
53
72
  end
54
73
  end
55
74
 
@@ -78,6 +78,7 @@ module Drntest
78
78
  end
79
79
 
80
80
  def normalize_groonga_command_header!(header)
81
+ return unless header.is_a?(Array)
81
82
  normalized_start_time = 0.0
82
83
  normalized_elapsed = 0.0
83
84
  header[1] = normalized_start_time if valid_start_time?(header[1])
@@ -52,15 +52,6 @@ module Drntest
52
52
  test_suites_result.test_results << test_runner.run
53
53
  end
54
54
 
55
- puts
56
- puts "==== Test Results ===="
57
- test_suites_result.test_results.each do |result|
58
- puts "%s: %s" % [
59
- result.name,
60
- result.status
61
- ]
62
- end
63
-
64
55
  puts
65
56
  puts "==== Summary ===="
66
57
  p test_suites_result.summary
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2013 Droonga Project
1
+ # Copyright (C) 2013-2014 Droonga Project
2
2
  #
3
3
  # This program is free software: you can redistribute it and/or modify
4
4
  # it under the terms of the GNU General Public License as published by
@@ -14,5 +14,5 @@
14
14
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
15
15
 
16
16
  module Drntest
17
- VERSION = "1.1.1"
17
+ VERSION = "1.1.2"
18
18
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: drntest
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Droonga Project
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-29 00:00:00.000000000 Z
11
+ date: 2014-02-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json