grntest 1.4.0 → 1.4.5
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/doc/text/news.md +35 -0
- data/lib/grntest/execution-context.rb +15 -0
- data/lib/grntest/executors/base-executor.rb +46 -14
- data/lib/grntest/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3903fe505e64094eb8951ddcca8e346e328da5a71c11eb2b9d30cca76618377a
|
4
|
+
data.tar.gz: f3dd540ee69267c74c6af70275f5a9630b9454bae75dce1ab6b8bf335efd80eb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bec42dc8095c0f04ad0b3fb9c269e021b9986cf9a9cb606c37e39359a13f3fd0e63c5eaffb75d7881c62adc389be9ab8ff266005407377af604aadf6531fbc7c
|
7
|
+
data.tar.gz: 30c5648429bf14591dd25ee5eca20228303423db9e925204fdbedc4abafaf1d623237ed0d339f7120a76ab7c5ddd9bb9568d4b943ec4b6586ecc454656b460db
|
data/doc/text/news.md
CHANGED
@@ -1,5 +1,40 @@
|
|
1
1
|
# News
|
2
2
|
|
3
|
+
## 1.4.5: 2020-11-11
|
4
|
+
|
5
|
+
### Improvements
|
6
|
+
|
7
|
+
* Added `sleep-after-command` directive.
|
8
|
+
|
9
|
+
## 1.4.4: 2020-07-18
|
10
|
+
|
11
|
+
### Improvements
|
12
|
+
|
13
|
+
* Added support for detecting backtrace log for MinGW build.
|
14
|
+
|
15
|
+
## 1.4.3: 2020-05-31
|
16
|
+
|
17
|
+
### Improvements
|
18
|
+
|
19
|
+
* Removed log normalization.
|
20
|
+
|
21
|
+
## 1.4.2: 2020-05-30
|
22
|
+
|
23
|
+
### Improvements
|
24
|
+
|
25
|
+
* Removed log level normalization.
|
26
|
+
|
27
|
+
* Added `require-platform` directive.
|
28
|
+
|
29
|
+
* Added support for normalizing IO open/close log message with
|
30
|
+
additional message.
|
31
|
+
|
32
|
+
## 1.4.1: 2020-05-30
|
33
|
+
|
34
|
+
### Improvements
|
35
|
+
|
36
|
+
* Added support for normalizing IO open/close log message.
|
37
|
+
|
3
38
|
## 1.4.0: 2020-05-16
|
4
39
|
|
5
40
|
### Improvements
|
@@ -37,6 +37,7 @@ module Grntest
|
|
37
37
|
attr_writer :suppress_backtrace
|
38
38
|
attr_writer :collect_query_log
|
39
39
|
attr_writer :debug
|
40
|
+
attr_accessor :platform
|
40
41
|
def initialize
|
41
42
|
@logging = true
|
42
43
|
@base_directory = Pathname(".")
|
@@ -66,6 +67,7 @@ module Grntest
|
|
66
67
|
@suppress_backtrace = true
|
67
68
|
@collect_query_log = false
|
68
69
|
@debug = false
|
70
|
+
@platform = guess_platform
|
69
71
|
end
|
70
72
|
|
71
73
|
def logging?
|
@@ -173,5 +175,18 @@ module Grntest
|
|
173
175
|
"so"
|
174
176
|
end
|
175
177
|
end
|
178
|
+
|
179
|
+
def guess_platform
|
180
|
+
case RUBY_PLATFORM
|
181
|
+
when /mingw|mswin/
|
182
|
+
"windows"
|
183
|
+
when /darwin/
|
184
|
+
"macos"
|
185
|
+
when /linux/
|
186
|
+
"linux"
|
187
|
+
else
|
188
|
+
"unknown"
|
189
|
+
end
|
190
|
+
end
|
176
191
|
end
|
177
192
|
end
|
@@ -44,6 +44,7 @@ module Grntest
|
|
44
44
|
@context = context
|
45
45
|
@custom_important_log_levels = []
|
46
46
|
@ignore_log_patterns = {}
|
47
|
+
@sleep_after_command = nil
|
47
48
|
end
|
48
49
|
|
49
50
|
def execute(script_path)
|
@@ -321,28 +322,28 @@ module Grntest
|
|
321
322
|
parser << "#{expand_variables(groonga_command)}\n"
|
322
323
|
end
|
323
324
|
|
324
|
-
def execute_directive_require_input_type(
|
325
|
+
def execute_directive_require_input_type(line, content, options)
|
325
326
|
input_type, = options
|
326
327
|
unless @context.input_type == input_type
|
327
328
|
omit("require input type: #{input_type}")
|
328
329
|
end
|
329
330
|
end
|
330
331
|
|
331
|
-
def execute_directive_require_testee(
|
332
|
+
def execute_directive_require_testee(line, content, options)
|
332
333
|
testee, = options
|
333
334
|
unless @context.testee == testee
|
334
335
|
omit("require testee: #{testee}")
|
335
336
|
end
|
336
337
|
end
|
337
338
|
|
338
|
-
def execute_directive_require_interface(
|
339
|
+
def execute_directive_require_interface(line, content, options)
|
339
340
|
interface, = options
|
340
341
|
unless @context.interface == interface
|
341
342
|
omit("require interface: #{interface}")
|
342
343
|
end
|
343
344
|
end
|
344
345
|
|
345
|
-
def execute_directive_require_apache_arrow(
|
346
|
+
def execute_directive_require_apache_arrow(line, content, options)
|
346
347
|
unless defined?(::Arrow)
|
347
348
|
omit("require Apache Arrow")
|
348
349
|
end
|
@@ -364,16 +365,38 @@ module Grntest
|
|
364
365
|
end
|
365
366
|
end
|
366
367
|
|
367
|
-
def execute_directive_add_ignore_log_pattern(
|
368
|
+
def execute_directive_add_ignore_log_pattern(line, content, options)
|
368
369
|
pattern = content.split(" ", 2)[1]
|
369
370
|
@ignore_log_patterns[pattern] = compile_pattern(pattern)
|
370
371
|
end
|
371
372
|
|
372
|
-
def execute_directive_remove_ignore_log_pattern(
|
373
|
+
def execute_directive_remove_ignore_log_pattern(line, content, options)
|
373
374
|
pattern = content.split(" ", 2)[1]
|
374
375
|
@ignore_log_patterns.delete(pattern)
|
375
376
|
end
|
376
377
|
|
378
|
+
def execute_directive_require_platform(line, content, options)
|
379
|
+
platform, = options
|
380
|
+
if platform.start_with?("!")
|
381
|
+
if @context.platform == platform[1..-1]
|
382
|
+
omit("require platform: #{platform} (#{@context.platform})")
|
383
|
+
end
|
384
|
+
else
|
385
|
+
if @context.platform != platform
|
386
|
+
omit("require platform: #{platform} (#{@context.platform})")
|
387
|
+
end
|
388
|
+
end
|
389
|
+
end
|
390
|
+
|
391
|
+
def execute_directive_sleep_after_command(line, content, options)
|
392
|
+
if options[0]
|
393
|
+
time = options[0].to_f
|
394
|
+
else
|
395
|
+
time = nil
|
396
|
+
end
|
397
|
+
@sleep_after_command = time
|
398
|
+
end
|
399
|
+
|
377
400
|
def execute_directive(parser, line, content)
|
378
401
|
command, *options = Shellwords.split(content)
|
379
402
|
case command
|
@@ -410,17 +433,21 @@ module Grntest
|
|
410
433
|
when "eval"
|
411
434
|
execute_directive_eval(parser, line, content, options)
|
412
435
|
when "require-input-type"
|
413
|
-
execute_directive_require_input_type(
|
436
|
+
execute_directive_require_input_type(line, content, options)
|
414
437
|
when "require-testee"
|
415
|
-
execute_directive_require_testee(
|
438
|
+
execute_directive_require_testee(line, content, options)
|
416
439
|
when "require-interface"
|
417
|
-
execute_directive_require_interface(
|
440
|
+
execute_directive_require_interface(line, content, options)
|
418
441
|
when "require-apache-arrow"
|
419
|
-
execute_directive_require_apache_arrow(
|
442
|
+
execute_directive_require_apache_arrow(line, content, options)
|
420
443
|
when "add-ignore-log-pattern"
|
421
|
-
execute_directive_add_ignore_log_pattern(
|
444
|
+
execute_directive_add_ignore_log_pattern(line, content, options)
|
422
445
|
when "remove-ignore-log-pattern"
|
423
|
-
execute_directive_remove_ignore_log_pattern(
|
446
|
+
execute_directive_remove_ignore_log_pattern(line, content, options)
|
447
|
+
when "require-platform"
|
448
|
+
execute_directive_require_platform(line, content, options)
|
449
|
+
when "sleep-after-command"
|
450
|
+
execute_directive_sleep_after_command(line, content, options)
|
424
451
|
else
|
425
452
|
log_input(line)
|
426
453
|
log_error("#|e| unknown directive: <#{command}>")
|
@@ -486,6 +513,7 @@ module Grntest
|
|
486
513
|
else
|
487
514
|
type = @output_type
|
488
515
|
log_output(response)
|
516
|
+
sleep(@sleep_after_command) if @sleep_after_command
|
489
517
|
log_error(extract_important_messages(read_all_log))
|
490
518
|
log_query_log_content(read_all_query_log)
|
491
519
|
|
@@ -535,8 +563,10 @@ module Grntest
|
|
535
563
|
end
|
536
564
|
next if thread_log_message?(entry.message)
|
537
565
|
next if ignore_log_message?(entry.message)
|
538
|
-
|
539
|
-
|
566
|
+
log_level = entry.log_level
|
567
|
+
formatted_log_level = format_log_level(log_level)
|
568
|
+
message = entry.message
|
569
|
+
important_messages << "\#|#{formatted_log_level}| #{message}"
|
540
570
|
end
|
541
571
|
important_messages.join("\n")
|
542
572
|
end
|
@@ -604,6 +634,8 @@ module Grntest
|
|
604
634
|
true
|
605
635
|
when /\A\(unknown\):\d+:\d+: /
|
606
636
|
true
|
637
|
+
when /\A[\w.\\-]+:\d+:\d+: /
|
638
|
+
true
|
607
639
|
when /\A(?:groonga|groonga-httpd)
|
608
640
|
\((?:\+0x\h+|\w+\+0x\h+)?\)
|
609
641
|
\s
|
data/lib/grntest/version.rb
CHANGED
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.4.
|
4
|
+
version: 1.4.5
|
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: 2020-
|
12
|
+
date: 2020-11-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: diff-lcs
|
@@ -270,7 +270,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
270
270
|
- !ruby/object:Gem::Version
|
271
271
|
version: '0'
|
272
272
|
requirements: []
|
273
|
-
rubygems_version: 3.2.0.
|
273
|
+
rubygems_version: 3.2.0.rc.2
|
274
274
|
signing_key:
|
275
275
|
specification_version: 4
|
276
276
|
summary: Grntest is a testing framework for Groonga. You can write a test for Groonga
|