grntest 1.4.3 → 1.4.8

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 84355faab0bb4ff5b7dbe5f1ef43a0ca2c93203fcd99b56282d0800a222a976e
4
- data.tar.gz: c289cb84bdf272373db014e586ecfcb1ea9d3961ea48e6f6958bc430e1f493ad
3
+ metadata.gz: 6573acc74d9d0be5726b91bf8e357ece4d5170dece4bfe9595ca86155f91c31b
4
+ data.tar.gz: 5d56939d8117fa73f7d5a3c9b8d52c34b270d15ee5a639debcbf250f43bdff9b
5
5
  SHA512:
6
- metadata.gz: d71f9f4c07114875886817223c31c10309cfea941aafcef780fc34d3366688cccf6df1c36287b1b9019faa9d2727f6918267fa2758e040673145e230faa88080
7
- data.tar.gz: 50627e7af040b161e34a6d2b756f4642940fb7b8a2fffbd0c1751d0fb9b240fa27a0c975ca6c57023f5a90c92616d7bb263497192d875040e17d68121da708ac
6
+ metadata.gz: 8a538e223a7a30328cf0e32a144567175542d6b46342065ac19ba58873133c1744553dd635d4258ae917770d0a345b0302f5888828aee64db18170689b21cb1a
7
+ data.tar.gz: 3170beeb6430e8b7ab1e065348e92498e6d7df0d7a974fb1ec7ad6304f6bf6662c7d44f2456f8e598a01501364355cfbcc0fef46e4f711ae553d2710c33bf177
@@ -1,5 +1,36 @@
1
1
  # News
2
2
 
3
+ ## 1.4.8: 2020-12-09
4
+
5
+ ### Fixes
6
+
7
+ * `require-apache-arrow`: Fixed inverted Apache Arrow version check condition.
8
+
9
+ ## 1.4.7: 2020-12-08
10
+
11
+ ### Improvements
12
+
13
+ * `require-apache-arrow`: Added support for version check of Apache
14
+ Arrow in Groonga.
15
+
16
+ ## 1.4.6: 2020-12-08
17
+
18
+ ### Improvements
19
+
20
+ * Added `require-feature` directive.
21
+
22
+ ## 1.4.5: 2020-11-11
23
+
24
+ ### Improvements
25
+
26
+ * Added `sleep-after-command` directive.
27
+
28
+ ## 1.4.4: 2020-07-18
29
+
30
+ ### Improvements
31
+
32
+ * Added support for detecting backtrace log for MinGW build.
33
+
3
34
  ## 1.4.3: 2020-05-31
4
35
 
5
36
  ### Improvements
@@ -44,6 +44,9 @@ module Grntest
44
44
  @context = context
45
45
  @custom_important_log_levels = []
46
46
  @ignore_log_patterns = {}
47
+ @sleep_after_command = nil
48
+ @raw_status_response = nil
49
+ @features = nil
47
50
  end
48
51
 
49
52
  def execute(script_path)
@@ -321,30 +324,48 @@ module Grntest
321
324
  parser << "#{expand_variables(groonga_command)}\n"
322
325
  end
323
326
 
324
- def execute_directive_require_input_type(parser, line, content, options)
327
+ def execute_directive_require_input_type(line, content, options)
325
328
  input_type, = options
326
329
  unless @context.input_type == input_type
327
330
  omit("require input type: #{input_type}")
328
331
  end
329
332
  end
330
333
 
331
- def execute_directive_require_testee(parser, line, content, options)
334
+ def execute_directive_require_testee(line, content, options)
332
335
  testee, = options
333
336
  unless @context.testee == testee
334
337
  omit("require testee: #{testee}")
335
338
  end
336
339
  end
337
340
 
338
- def execute_directive_require_interface(parser, line, content, options)
341
+ def execute_directive_require_interface(line, content, options)
339
342
  interface, = options
340
343
  unless @context.interface == interface
341
344
  omit("require interface: #{interface}")
342
345
  end
343
346
  end
344
347
 
345
- def execute_directive_require_apache_arrow(parser, line, content, options)
348
+ def status_response
349
+ @status_response ||= JSON.parse(@raw_status_response)[1]
350
+ end
351
+
352
+ def apache_arrow_version
353
+ (status_response["apache_arrow"] || {})["version"]
354
+ end
355
+
356
+ def execute_directive_require_apache_arrow(line, content, options)
357
+ version, = options
358
+ _apache_arrow_version = apache_arrow_version
359
+ if _apache_arrow_version.nil?
360
+ omit("require Apache Arrow support in Groonga")
361
+ end
346
362
  unless defined?(::Arrow)
347
- omit("require Apache Arrow")
363
+ omit("require Red Arrow in grntest")
364
+ end
365
+ return if version.nil?
366
+ if Gem::Version.new(version) > Gem::Version.new(_apache_arrow_version)
367
+ omit("require Apache Arrow #{version} in Groonga: " +
368
+ _apache_arrow_version)
348
369
  end
349
370
  end
350
371
 
@@ -364,17 +385,17 @@ module Grntest
364
385
  end
365
386
  end
366
387
 
367
- def execute_directive_add_ignore_log_pattern(parser, line, content, options)
388
+ def execute_directive_add_ignore_log_pattern(line, content, options)
368
389
  pattern = content.split(" ", 2)[1]
369
390
  @ignore_log_patterns[pattern] = compile_pattern(pattern)
370
391
  end
371
392
 
372
- def execute_directive_remove_ignore_log_pattern(parser, line, content, options)
393
+ def execute_directive_remove_ignore_log_pattern(line, content, options)
373
394
  pattern = content.split(" ", 2)[1]
374
395
  @ignore_log_patterns.delete(pattern)
375
396
  end
376
397
 
377
- def execute_directive_require_platform(parser, line, content, options)
398
+ def execute_directive_require_platform(line, content, options)
378
399
  platform, = options
379
400
  if platform.start_with?("!")
380
401
  if @context.platform == platform[1..-1]
@@ -387,6 +408,42 @@ module Grntest
387
408
  end
388
409
  end
389
410
 
411
+ def execute_directive_sleep_after_command(line, content, options)
412
+ if options[0]
413
+ time = options[0].to_f
414
+ else
415
+ time = nil
416
+ end
417
+ @sleep_after_command = time
418
+ end
419
+
420
+ def features
421
+ return @features if @features
422
+ @features = []
423
+ status_response["features"].each do |name, available|
424
+ @features << name if available
425
+ end
426
+ @features.sort!
427
+ @features
428
+ end
429
+
430
+ def formatted_features
431
+ features.join(", ")
432
+ end
433
+
434
+ def execute_directive_require_feature(line, content, options)
435
+ feature, = options
436
+ if feature.start_with?("!")
437
+ if features.include?(feature[1..-1])
438
+ omit("require feature: #{feature} (#{formatted_features})")
439
+ end
440
+ else
441
+ unless features.include?(feature)
442
+ omit("require feature: #{feature} (#{formatted_features})")
443
+ end
444
+ end
445
+ end
446
+
390
447
  def execute_directive(parser, line, content)
391
448
  command, *options = Shellwords.split(content)
392
449
  case command
@@ -423,19 +480,23 @@ module Grntest
423
480
  when "eval"
424
481
  execute_directive_eval(parser, line, content, options)
425
482
  when "require-input-type"
426
- execute_directive_require_input_type(parser, line, content, options)
483
+ execute_directive_require_input_type(line, content, options)
427
484
  when "require-testee"
428
- execute_directive_require_testee(parser, line, content, options)
485
+ execute_directive_require_testee(line, content, options)
429
486
  when "require-interface"
430
- execute_directive_require_interface(parser, line, content, options)
487
+ execute_directive_require_interface(line, content, options)
431
488
  when "require-apache-arrow"
432
- execute_directive_require_apache_arrow(parser, line, content, options)
489
+ execute_directive_require_apache_arrow(line, content, options)
433
490
  when "add-ignore-log-pattern"
434
- execute_directive_add_ignore_log_pattern(parser, line, content, options)
491
+ execute_directive_add_ignore_log_pattern(line, content, options)
435
492
  when "remove-ignore-log-pattern"
436
- execute_directive_remove_ignore_log_pattern(parser, line, content, options)
493
+ execute_directive_remove_ignore_log_pattern(line, content, options)
437
494
  when "require-platform"
438
- execute_directive_require_platform(parser, line, content, options)
495
+ execute_directive_require_platform(line, content, options)
496
+ when "sleep-after-command"
497
+ execute_directive_sleep_after_command(line, content, options)
498
+ when "require-feature"
499
+ execute_directive_require_feature(line, content, options)
439
500
  else
440
501
  log_input(line)
441
502
  log_error("#|e| unknown directive: <#{command}>")
@@ -501,6 +562,7 @@ module Grntest
501
562
  else
502
563
  type = @output_type
503
564
  log_output(response)
565
+ sleep(@sleep_after_command) if @sleep_after_command
504
566
  log_error(extract_important_messages(read_all_log))
505
567
  log_query_log_content(read_all_query_log)
506
568
 
@@ -621,6 +683,8 @@ module Grntest
621
683
  true
622
684
  when /\A\(unknown\):\d+:\d+: /
623
685
  true
686
+ when /\A[\w.\\-]+:\d+:\d+: /
687
+ true
624
688
  when /\A(?:groonga|groonga-httpd)
625
689
  \((?:\+0x\h+|\w+\+0x\h+)?\)
626
690
  \s
@@ -61,7 +61,7 @@ module Grntest
61
61
  def ensure_groonga_ready
62
62
  n_retried = 0
63
63
  begin
64
- send_command(command("status"))
64
+ @raw_status_response = send_command(command("status"))
65
65
  rescue Error
66
66
  n_retried += 1
67
67
  sleep(0.1)
@@ -44,7 +44,7 @@ module Grntest
44
44
  def ensure_groonga_ready
45
45
  @input.print("status\n")
46
46
  @input.flush
47
- @output.gets
47
+ @raw_status_response = @output.gets
48
48
  end
49
49
 
50
50
  def create_sub_executor(context)
@@ -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.4.3"
17
+ VERSION = "1.4.8"
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.4.3
4
+ version: 1.4.8
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-05-30 00:00:00.000000000 Z
12
+ date: 2020-12-08 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.pre1
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