grntest 1.3.7 → 1.4.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
  SHA256:
3
- metadata.gz: 3ba7e05aef3a6c662712ec931374dfb8889222eddc6716bc0c9efa0cf99cd882
4
- data.tar.gz: 4d76ffcdfb0303b4935e06ac32001d07ed3ad2c6c12c66a886fcace730dd0255
3
+ metadata.gz: 72bf123c2803dad061e343733c748d2c66ce4fb649e146cf089707b28bc24eb7
4
+ data.tar.gz: 808f8b5ede307bab1f5e3e933944e487113b8f22272fe6226d3411986e9a2eac
5
5
  SHA512:
6
- metadata.gz: e0f98a7f12095cd875f90ef991c1a22a5de95dd107d315f2175928fa0cfa7292da7578bd2ab6a8292c876073d62ef9cb571ab3d00908702ed4a60dd945fb5019
7
- data.tar.gz: f4a82f9a8dd26a01d2a9c1f21f26a1a6d8d265f5722c149f271cb4ee9bf6fe2dcd7f1517a950e751ddee3222dddd8e475332b874750f7ba9e56923e5f4cd7b28
6
+ metadata.gz: e39d5e003dd5ad5d48aa71b64b306c882413a27d873fb95c130cc00b5c4538271363f3a04cb44cfdd535a591c1c98479cc41a2558d5a0c7854bbb3793b6ce9b0
7
+ data.tar.gz: c39924d196aa19cbdf0db12a7660ac6ed7b545e78b6c6852261b9f178b4acc899ba3c8f9ee875042f2700849a2ef3b3db915d72805f5a47552d6c8d358e593c7
@@ -1,5 +1,46 @@
1
1
  # News
2
2
 
3
+ ## 1.4.2: 2020-05-30
4
+
5
+ ### Improvements
6
+
7
+ * Removed log level normalization.
8
+
9
+ * Added `require-platform` directive.
10
+
11
+ * Added support for normalizing IO open/close log message with
12
+ additional message.
13
+
14
+ ## 1.4.1: 2020-05-30
15
+
16
+ ### Improvements
17
+
18
+ * Added support for normalizing IO open/close log message.
19
+
20
+ ## 1.4.0: 2020-05-16
21
+
22
+ ### Improvements
23
+
24
+ * Added support for normalizing mruby's syntax error message.
25
+
26
+ ## 1.3.9: 2020-05-09
27
+
28
+ ### Improvements
29
+
30
+ * Added `progress` reporter.
31
+
32
+ * Suppressed Apache Arrow related reports from Valgrind.
33
+
34
+ * Improved backtrace detection.
35
+
36
+ ## 1.3.8: 2020-04-23
37
+
38
+ ### Improvements
39
+
40
+ * Improved static port detection.
41
+
42
+ * Improved backtrace detection.
43
+
3
44
  ## 1.3.7: 2020-03-26
4
45
 
5
46
  ### 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
@@ -374,6 +374,19 @@ module Grntest
374
374
  @ignore_log_patterns.delete(pattern)
375
375
  end
376
376
 
377
+ def execute_directive_require_platform(parser, line, content, options)
378
+ platform, = options
379
+ if platform.start_with?("!")
380
+ if @context.platform == platform[1..-1]
381
+ omit("require platform: #{platform} (#{@context.platform})")
382
+ end
383
+ else
384
+ if @context.platform != platform
385
+ omit("require platform: #{platform} (#{@context.platform})")
386
+ end
387
+ end
388
+ end
389
+
377
390
  def execute_directive(parser, line, content)
378
391
  command, *options = Shellwords.split(content)
379
392
  case command
@@ -421,6 +434,8 @@ module Grntest
421
434
  execute_directive_add_ignore_log_pattern(parser, line, content, options)
422
435
  when "remove-ignore-log-pattern"
423
436
  execute_directive_remove_ignore_log_pattern(parser, line, content, options)
437
+ when "require-platform"
438
+ execute_directive_require_platform(parser, line, content, options)
424
439
  else
425
440
  log_input(line)
426
441
  log_error("#|e| unknown directive: <#{command}>")
@@ -535,12 +550,33 @@ module Grntest
535
550
  end
536
551
  next if thread_log_message?(entry.message)
537
552
  next if ignore_log_message?(entry.message)
538
- formatted_log_level = format_log_level(entry.log_level)
539
- important_messages << "\#|#{formatted_log_level}| #{entry.message}"
553
+ log_level, message = normalize_log(entry)
554
+ formatted_log_level = format_log_level(log_level)
555
+ important_messages << "\#|#{formatted_log_level}| #{message}"
540
556
  end
541
557
  important_messages.join("\n")
542
558
  end
543
559
 
560
+ def normalize_log(entry)
561
+ case entry.message
562
+ when /\A(\[io\]\[(?:open|close)\]) (.*?)<(.*?)>\z/
563
+ tag = $1
564
+ io_message = $2
565
+ path = $3
566
+ normalized_path = File.basename(path)
567
+ normalized_message = "#{tag} #{io_message}<#{normalized_path}>"
568
+ case entry.log_level
569
+ when :information, :debug
570
+ normalized_log_level = :dump
571
+ else
572
+ normalized_log_level = entry.log_level
573
+ end
574
+ [normalized_log_level, normalized_message]
575
+ else
576
+ [entry.log_level, entry.message]
577
+ end
578
+ end
579
+
544
580
  def read_all_readable_content(output, options={})
545
581
  content = ""
546
582
  first_timeout = options[:first_timeout] || @context.read_timeout
@@ -602,7 +638,16 @@ module Grntest
602
638
  true
603
639
  when /\A[a-zA-Z]:[\/\\]/
604
640
  true
605
- when /\Agroonga\(\) \[0x[\da-f]+\]\z/
641
+ when /\A\(unknown\):\d+:\d+: /
642
+ true
643
+ when /\A(?:groonga|groonga-httpd)
644
+ \((?:\+0x\h+|\w+\+0x\h+)?\)
645
+ \s
646
+ \[0x\h+\]\z/x
647
+ # groonga() [0x564caf2bfc12]
648
+ # groonga(+0xbd1aa) [0x564caf2bfc12]
649
+ # groonga-httpd(+0xbd1aa) [0x564caf2bfc12]
650
+ # groonga-httpd(ngx_http_core_run_phases+0x25) [0x564caf2bfc12]
606
651
  true
607
652
  when /\A\d+\s+(?:lib\S+\.dylib|\S+\.so|groonga|nginx|\?\?\?)\s+
608
653
  0x[\da-f]+\s
@@ -1,6 +1,4 @@
1
- # -*- coding: utf-8 -*-
2
- #
3
- # Copyright (C) 2012-2015 Kouhei Sutou <kou@clear-code.com>
1
+ # Copyright (C) 2012-2020 Sutou Kouhei <kou@clear-code.com>
4
2
  #
5
3
  # This program is free software: you can redistribute it and/or modify
6
4
  # it under the terms of the GNU General Public License as published by
@@ -19,6 +17,7 @@ require "grntest/reporters/mark-reporter"
19
17
  require "grntest/reporters/buffered-mark-reporter"
20
18
  require "grntest/reporters/stream-reporter"
21
19
  require "grntest/reporters/inplace-reporter"
20
+ require "grntest/reporters/progress-reporter"
22
21
 
23
22
  module Grntest
24
23
  module Reporters
@@ -33,6 +32,8 @@ module Grntest
33
32
  StreamReporter.new(tester)
34
33
  when :inplace
35
34
  InplaceReporter.new(tester)
35
+ when :progress
36
+ ProgressReporter.new(tester)
36
37
  end
37
38
  end
38
39
  end
@@ -0,0 +1,37 @@
1
+ # Copyright (C) 2020 Sutou Kouhei <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/reporters/inplace-reporter"
17
+
18
+ module Grntest
19
+ module Reporters
20
+ class ProgressReporter < InplaceReporter
21
+ private
22
+ def draw_statistics_header_line
23
+ puts(statistics_header)
24
+ end
25
+
26
+ def draw_status_line(worker)
27
+ end
28
+
29
+ def draw_test_line(worker)
30
+ end
31
+
32
+ def n_worker_lines
33
+ 0
34
+ end
35
+ end
36
+ end
37
+ end
@@ -297,6 +297,30 @@ call (int)chdir("#{context.temporary_directory_path}")
297
297
  match-leak-kinds: reachable
298
298
  ...
299
299
  fun:_dl_catch_error
300
+ }
301
+ {
302
+ _dl_init
303
+ Memcheck:Leak
304
+ match-leak-kinds: reachable
305
+ ...
306
+ fun:_dl_init
307
+ ...
308
+ }
309
+ {
310
+ _Z41__static_initialization_and_destruction_0ii
311
+ Memcheck:Leak
312
+ match-leak-kinds: reachable
313
+ ...
314
+ fun:_Z41__static_initialization_and_destruction_0ii
315
+ ...
316
+ }
317
+ {
318
+ je_arrow_private_je_background_thread_create
319
+ Memcheck:Leak
320
+ match-leak-kinds: possible
321
+ ...
322
+ fun:je_arrow_private_je_background_thread_create
323
+ ...
300
324
  }
301
325
  SUPPRESSIONS
302
326
  end
@@ -344,10 +368,10 @@ call (int)chdir("#{context.temporary_directory_path}")
344
368
  static_port = 50041 + @worker.id
345
369
  10.times do
346
370
  begin
347
- TCPSocket.new(host, static_port)
371
+ TCPServer.open(host, static_port) do |server|
372
+ return static_port
373
+ end
348
374
  rescue SystemCallError
349
- return static_port
350
- else
351
375
  sleep(0.1)
352
376
  end
353
377
  end
@@ -787,6 +811,8 @@ http {
787
811
  pre = $1
788
812
  _path = $2
789
813
  "#{pre}<PATH>"
814
+ when /\A(line \d+:\d+: syntax error), unexpected .*\z/
815
+ $1
790
816
  else
791
817
  content
792
818
  end
@@ -137,7 +137,13 @@ module Grntest
137
137
  diff_option_is_specified = true
138
138
  end
139
139
 
140
- available_reporters = [:mark, :"buffered-mark", :stream, :inplace]
140
+ available_reporters = [
141
+ :mark,
142
+ :"buffered-mark",
143
+ :stream,
144
+ :inplace,
145
+ :progress,
146
+ ]
141
147
  available_reporter_labels = available_reporters.join(", ")
142
148
  parser.on("--reporter=REPORTER", available_reporters,
143
149
  "Report test result by REPORTER",
@@ -371,7 +377,7 @@ module Grntest
371
377
  if @n_workers == 1
372
378
  :mark
373
379
  else
374
- :inplace
380
+ :progress
375
381
  end
376
382
  else
377
383
  @reporter
@@ -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.7"
17
+ VERSION = "1.4.2"
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.7
4
+ version: 1.4.2
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-26 00:00:00.000000000 Z
12
+ date: 2020-05-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: diff-lcs
@@ -238,6 +238,7 @@ files:
238
238
  - lib/grntest/reporters/buffered-mark-reporter.rb
239
239
  - lib/grntest/reporters/inplace-reporter.rb
240
240
  - lib/grntest/reporters/mark-reporter.rb
241
+ - lib/grntest/reporters/progress-reporter.rb
241
242
  - lib/grntest/reporters/stream-reporter.rb
242
243
  - lib/grntest/response-parser.rb
243
244
  - lib/grntest/template-evaluator.rb