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 +4 -4
- data/doc/text/news.md +8 -0
- data/lib/grntest/execution-context.rb +1 -1
- data/lib/grntest/executors/base-executor.rb +19 -2
- data/lib/grntest/reporters/base-reporter.rb +3 -3
- data/lib/grntest/test-runner.rb +2 -2
- data/lib/grntest/tester.rb +8 -1
- data/lib/grntest/version.rb +1 -1
- data/test/executors/test-base-executor.rb +9 -9
- metadata +2 -4
- data/test/test-log-parser.rb +0 -77
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4e087007c74f9b61344ed535c71c018afa2ef0aa8bb10f6de910418b6ce1e794
|
4
|
+
data.tar.gz: de8df8defdb777227644bcd539aa5bfbd855962bec50a1baf7ec3bf58d5cf315
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5c147cd30f72093e219d592a4db77f9f9675681987e1c3acb7561cf1c1a6cf8c41bf29fe008ab504505f4499c7c6643f7dbb5fabd7d37259f162f1748c891208
|
7
|
+
data.tar.gz: 5c39f666cd0dc957523404aa3cb294a82a3ead1af84c0e37f395dbb6933983bc3468fb02254663398fc1fd6f569132e90db7b11975036ede974ff60e4690d99e
|
data/doc/text/news.md
CHANGED
@@ -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,
|
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
|
-
|
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-
|
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
|
-
|
156
|
+
:failure
|
157
157
|
else
|
158
|
-
|
158
|
+
:not_checked
|
159
159
|
end
|
160
160
|
end
|
161
161
|
|
data/lib/grntest/test-runner.rb
CHANGED
@@ -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
|
-
|
733
|
+
_path = $2
|
734
734
|
"#{pre}<PATH>"
|
735
735
|
else
|
736
736
|
content
|
data/lib/grntest/tester.rb
CHANGED
@@ -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
|
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
|
data/lib/grntest/version.rb
CHANGED
@@ -22,21 +22,21 @@ class TestBaseExecutor < Test::Unit::TestCase
|
|
22
22
|
end
|
23
23
|
|
24
24
|
class TestErrorLogLevel < self
|
25
|
-
data("emergency" =>
|
26
|
-
"alert" =>
|
27
|
-
"critical" =>
|
28
|
-
"error" =>
|
29
|
-
"warning" =>
|
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" =>
|
37
|
-
"info" =>
|
38
|
-
"debug" =>
|
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.
|
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-
|
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
|
data/test/test-log-parser.rb
DELETED
@@ -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
|