grntest 1.3.3 → 1.3.4

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
  SHA256:
3
- metadata.gz: 2e1250a739ad90db6969395e873269deeb2a19b08c99c8dfc121a8ff803282bc
4
- data.tar.gz: d42dde8e1cfd602b07b3d6a86569c66609dbc9ea5d769f0d6c7dc9148c69ea3f
3
+ metadata.gz: 4e087007c74f9b61344ed535c71c018afa2ef0aa8bb10f6de910418b6ce1e794
4
+ data.tar.gz: de8df8defdb777227644bcd539aa5bfbd855962bec50a1baf7ec3bf58d5cf315
5
5
  SHA512:
6
- metadata.gz: c8210a78653d3aa6067e0c9577931b1398f61b120a42570be03aee42ea8b56a458e807dd92f381312fdced2773d53a82d20cb0f331322c1f88d1eb104c1d82d0
7
- data.tar.gz: d6eefca78c861859116fe65f9a87d17b2d573a8a9e22611b5290247be77223d2abffadb3faa3e74eff46b7ad27b46bab32a6f701afb2fc4ddba6be0fe45c4fdb
6
+ metadata.gz: 5c147cd30f72093e219d592a4db77f9f9675681987e1c3acb7561cf1c1a6cf8c41bf29fe008ab504505f4499c7c6643f7dbb5fabd7d37259f162f1748c891208
7
+ data.tar.gz: 5c39f666cd0dc957523404aa3cb294a82a3ead1af84c0e37f395dbb6933983bc3468fb02254663398fc1fd6f569132e90db7b11975036ede974ff60e4690d99e
@@ -1,5 +1,13 @@
1
1
  # News
2
2
 
3
+ ## 1.3.4: 2019-10-11
4
+
5
+ ### Improvements
6
+
7
+ * Added support for testing with installed Groonga.
8
+
9
+ * Added support for `send` operation in query log.
10
+
3
11
  ## 1.3.3: 2019-05-12
4
12
 
5
13
  ### Improvements
@@ -48,7 +48,7 @@ module Grntest
48
48
  @on_error = :default
49
49
  @abort_tag = nil
50
50
  @timeout = 0
51
- @read_timeout = 3
51
+ @read_timeout = 5
52
52
  @default_timeout = @timeout
53
53
  @default_read_timeout = @read_timeout
54
54
  @shutdown_wait_timeout = 5
@@ -430,7 +430,21 @@ module Grntest
430
430
  end
431
431
 
432
432
  def read_all_query_log
433
- read_all_readable_content(context.query_log, :first_timeout => 0)
433
+ content = read_all_readable_content(context.query_log,
434
+ first_timeout: 0)
435
+ lines = content.lines
436
+ unless lines.empty?
437
+ timeout = Time.now + @context.read_timeout
438
+ while Time.now < timeout
439
+ break if /rc=-?\d+$/.match?(lines.last)
440
+ additional_content = read_all_readable_content(context.query_log,
441
+ first_timeout: 0)
442
+ next if additional_content.empty?
443
+ content << additional_content
444
+ lines.concat(additional_content.lines)
445
+ end
446
+ end
447
+ content
434
448
  end
435
449
 
436
450
  def extract_important_messages(log)
@@ -590,8 +604,11 @@ module Grntest
590
604
  end
591
605
  statistic.each_operation do |operation|
592
606
  message = operation[:raw_message]
593
- if operation[:name] == "cache"
607
+ case operation[:name]
608
+ when "cache"
594
609
  message = message.gsub(/\(\d+\)/, "(0)")
610
+ when "send"
611
+ message = message.gsub(/\(\d+\)(?:: \d+\/\d+)?\z/, "(0)")
595
612
  end
596
613
  log_query("\#:#{relative_elapsed_time} #{message}")
597
614
  end
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2012-2016 Kouhei Sutou <kou@clear-code.com>
1
+ # Copyright (C) 2012-2019 Kouhei Sutou <kou@clear-code.com>
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
@@ -153,9 +153,9 @@ module Grntest
153
153
 
154
154
  def elapsed_time_status(elapsed_time)
155
155
  if long_elapsed_time?(elapsed_time)
156
- elapsed_time_status = :failure
156
+ :failure
157
157
  else
158
- elapsed_time_status = :not_checked
158
+ :not_checked
159
159
  end
160
160
  end
161
161
 
@@ -259,7 +259,7 @@ module Grntest
259
259
  gdb_command.puts(<<-COMMANDS)
260
260
  break main
261
261
  run
262
- call chdir("#{context.temporary_directory_path}")
262
+ call (int)chdir("#{context.temporary_directory_path}")
263
263
  COMMANDS
264
264
  end
265
265
  command_line << "--command=#{gdb_command_path}"
@@ -730,7 +730,7 @@ http {
730
730
  case content
731
731
  when /\A(.*: fopen: failed to open mruby script file: )<(.+?)>?\z/
732
732
  pre = $1
733
- path = $2
733
+ _path = $2
734
734
  "#{pre}<PATH>"
735
735
  else
736
736
  content
@@ -420,7 +420,14 @@ module Grntest
420
420
  unless groonga_path.absolute?
421
421
  groonga_path = Pathname(resolve_command_path(@groonga)).expand_path
422
422
  end
423
- groonga_path.parent.parent + "plugins"
423
+ base_dir = groonga_path.parent.parent
424
+ installed_plugins_dir = base_dir + "lib" + "groonga" + "plugins"
425
+ build_plugins_dir = base_dir + "plugins"
426
+ if installed_plugins_dir.exist?
427
+ installed_plugins_dir
428
+ else
429
+ build_plugins_dir
430
+ end
424
431
  end
425
432
 
426
433
  private
@@ -14,5 +14,5 @@
14
14
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
15
15
 
16
16
  module Grntest
17
- VERSION = "1.3.3"
17
+ VERSION = "1.3.4"
18
18
  end
@@ -22,21 +22,21 @@ class TestBaseExecutor < Test::Unit::TestCase
22
22
  end
23
23
 
24
24
  class TestErrorLogLevel < self
25
- data("emergency" => "E",
26
- "alert" => "A",
27
- "critical" => "C",
28
- "error" => "e",
29
- "warning" => "w")
25
+ data("emergency" => :emergency,
26
+ "alert" => :alert,
27
+ "critical" => :critical,
28
+ "error" => :error,
29
+ "warning" => :warning)
30
30
  def test_important_log_level(level)
31
31
  assert do
32
32
  @executor.send(:important_log_level?, level)
33
33
  end
34
34
  end
35
35
 
36
- data("notice" => "n",
37
- "info" => "i",
38
- "debug" => "d",
39
- "dump" => "-")
36
+ data("notice" => :notice,
37
+ "info" => :information,
38
+ "debug" => :debug,
39
+ "dump" => :dump)
40
40
  def test_not_important_log_level(level)
41
41
  assert do
42
42
  not @executor.send(:important_log_level?, level)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grntest
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.3
4
+ version: 1.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kouhei Sutou
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-05-11 00:00:00.000000000 Z
12
+ date: 2019-10-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: diff-lcs
@@ -222,7 +222,6 @@ files:
222
222
  - test/executors/test-base-executor.rb
223
223
  - test/executors/test-standard-io-executor.rb
224
224
  - test/run-test.rb
225
- - test/test-log-parser.rb
226
225
  homepage: https://github.com/groonga/grntest
227
226
  licenses:
228
227
  - GPL-3.0+
@@ -249,7 +248,6 @@ specification_version: 4
249
248
  summary: Grntest is a testing framework for Groonga. You can write a test for Groonga
250
249
  by writing Groonga commands and expected result.
251
250
  test_files:
252
- - test/test-log-parser.rb
253
251
  - test/run-test.rb
254
252
  - test/executors/test-base-executor.rb
255
253
  - test/executors/test-standard-io-executor.rb
@@ -1,77 +0,0 @@
1
- # Copyright (C) 2014 Kouhei Sutou <kou@clear-code.com>
2
- #
3
- # This program is free software: you can redistribute it and/or modify
4
- # it under the terms of the GNU General Public License as published by
5
- # the Free Software Foundation, either version 3 of the License, or
6
- # (at your option) any later version.
7
- #
8
- # This program is distributed in the hope that it will be useful,
9
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
10
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
- # GNU General Public License for more details.
12
- #
13
- # You should have received a copy of the GNU General Public License
14
- # along with this program. If not, see <http://www.gnu.org/licenses/>.
15
-
16
- require "grntest/log-parser"
17
-
18
- class TestLogParser < Test::Unit::TestCase
19
- def parse(log)
20
- parser = Grntest::LogParser.new
21
- entries = []
22
- parser.parse(log) do |entry|
23
- entries << entry.to_h
24
- end
25
- entries
26
- end
27
-
28
- sub_test_case("#parse") do
29
- def test_one_line
30
- log = "2014-09-27 17:31:53.046467|n| message"
31
- assert_equal([
32
- {
33
- :timestamp => "2014-09-27 17:31:53.046467",
34
- :log_level => "n",
35
- :message => "message",
36
- },
37
- ],
38
- parse(log))
39
- end
40
-
41
- def test_one_lines
42
- log = <<-LOG
43
- 2014-09-27 17:31:53.046467|n| notification message
44
- 2014-09-27 17:31:54.046467|W| warning message
45
- LOG
46
- assert_equal([
47
- {
48
- :timestamp => "2014-09-27 17:31:53.046467",
49
- :log_level => "n",
50
- :message => "notification message",
51
- },
52
- {
53
- :timestamp => "2014-09-27 17:31:54.046467",
54
- :log_level => "W",
55
- :message => "warning message",
56
- },
57
- ],
58
- parse(log))
59
- end
60
-
61
-
62
- def test_multi_line
63
- log = <<-LOG
64
- 2014-09-27 17:31:53.046467|n| multi
65
- line message
66
- LOG
67
- assert_equal([
68
- {
69
- :timestamp => "2014-09-27 17:31:53.046467",
70
- :log_level => "n",
71
- :message => "multi\nline message",
72
- },
73
- ],
74
- parse(log))
75
- end
76
- end
77
- end