grntest 1.3.6 → 1.3.7

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: 4a454a43f204e50c72ce0470713ee3dbcdd7c3b0f210f8fc37eb8c858dc5794f
4
- data.tar.gz: 5f5a5dfdab82eefc86318b7a09e66c97979cb68fed0c498369117c0c98666a6a
3
+ metadata.gz: 3ba7e05aef3a6c662712ec931374dfb8889222eddc6716bc0c9efa0cf99cd882
4
+ data.tar.gz: 4d76ffcdfb0303b4935e06ac32001d07ed3ad2c6c12c66a886fcace730dd0255
5
5
  SHA512:
6
- metadata.gz: 707db0020a332057b06ce4822edb4fd1cac2226e88f23a642fd071e2bda2457747f54fd22b16198b629badaee7e865753d60d0c713f35c40b1b718f1248a8866
7
- data.tar.gz: 88653342fa0366047c2ecf080cc6d4bbab2f7c43186c9df4173fbeeb7814bf5a9143442ed1df7e4144674a2b0c977b109d0cfa2cf7927c20f489a74fc234370a
6
+ metadata.gz: e0f98a7f12095cd875f90ef991c1a22a5de95dd107d315f2175928fa0cfa7292da7578bd2ab6a8292c876073d62ef9cb571ab3d00908702ed4a60dd945fb5019
7
+ data.tar.gz: f4a82f9a8dd26a01d2a9c1f21f26a1a6d8d265f5722c149f271cb4ee9bf6fe2dcd7f1517a950e751ddee3222dddd8e475332b874750f7ba9e56923e5f4cd7b28
@@ -1,5 +1,13 @@
1
1
  # News
2
2
 
3
+ ## 1.3.7: 2020-03-26
4
+
5
+ ### Improvements
6
+
7
+ * Added `add-ignore-log-pattern` directive.
8
+
9
+ * Added `remove-ignore-log-pattern` directive.
10
+
3
11
  ## 1.3.6: 2020-03-26
4
12
 
5
13
  ### Improvements
@@ -43,6 +43,7 @@ module Grntest
43
43
  @long_read_timeout = default_long_read_timeout
44
44
  @context = context
45
45
  @custom_important_log_levels = []
46
+ @ignore_log_patterns = {}
46
47
  end
47
48
 
48
49
  def execute(script_path)
@@ -347,6 +348,32 @@ module Grntest
347
348
  end
348
349
  end
349
350
 
351
+ def compile_pattern(pattern)
352
+ case pattern
353
+ when /\A\/(.*)\/([ixm]*)?\z/
354
+ content = $1
355
+ options = $2
356
+ regexp_flags = 0
357
+ regexp_flags |= Regexp::IGNORECASE if options.include?("i")
358
+ regexp_flags |= Regexp::EXTENDED if options.include?("x")
359
+ regexp_flags |= Regexp::MULTILINE if options.include?("m")
360
+ Regexp.new(content, regexp_flags)
361
+ else
362
+ log_error("# error: invalid pattern: #{pattern}")
363
+ @context.error
364
+ end
365
+ end
366
+
367
+ def execute_directive_add_ignore_log_pattern(parser, line, content, options)
368
+ pattern = content.split(" ", 2)[1]
369
+ @ignore_log_patterns[pattern] = compile_pattern(pattern)
370
+ end
371
+
372
+ def execute_directive_remove_ignore_log_pattern(parser, line, content, options)
373
+ pattern = content.split(" ", 2)[1]
374
+ @ignore_log_patterns.delete(pattern)
375
+ end
376
+
350
377
  def execute_directive(parser, line, content)
351
378
  command, *options = Shellwords.split(content)
352
379
  case command
@@ -390,6 +417,10 @@ module Grntest
390
417
  execute_directive_require_interface(parser, line, content, options)
391
418
  when "require-apache-arrow"
392
419
  execute_directive_require_apache_arrow(parser, line, content, options)
420
+ when "add-ignore-log-pattern"
421
+ execute_directive_add_ignore_log_pattern(parser, line, content, options)
422
+ when "remove-ignore-log-pattern"
423
+ execute_directive_remove_ignore_log_pattern(parser, line, content, options)
393
424
  else
394
425
  log_input(line)
395
426
  log_error("#|e| unknown directive: <#{command}>")
@@ -503,6 +534,7 @@ module Grntest
503
534
  next if !in_crash and backtrace_log_message?(entry.message)
504
535
  end
505
536
  next if thread_log_message?(entry.message)
537
+ next if ignore_log_message?(entry.message)
506
538
  formatted_log_level = format_log_level(entry.log_level)
507
539
  important_messages << "\#|#{formatted_log_level}| #{entry.message}"
508
540
  end
@@ -592,6 +624,12 @@ module Grntest
592
624
  end
593
625
  end
594
626
 
627
+ def ignore_log_message?(message)
628
+ @ignore_log_patterns.any? do |_pattern, regexp|
629
+ regexp === message
630
+ end
631
+ end
632
+
595
633
  def error_response?(response, type)
596
634
  status = nil
597
635
  begin
@@ -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.6"
17
+ VERSION = "1.3.7"
18
18
  end
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.6
4
+ version: 1.3.7
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-03-25 00:00:00.000000000 Z
12
+ date: 2020-03-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: diff-lcs