grntest 1.4.4 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9733d4f25a25296b60589e7c0328872954955799278fa0194a82c279c92c5f84
4
- data.tar.gz: 653013c00c4f38eb2c9d41edf5963fd4ccafe6a491672e5afd6d4b4b7b8dad15
3
+ metadata.gz: 3903fe505e64094eb8951ddcca8e346e328da5a71c11eb2b9d30cca76618377a
4
+ data.tar.gz: f3dd540ee69267c74c6af70275f5a9630b9454bae75dce1ab6b8bf335efd80eb
5
5
  SHA512:
6
- metadata.gz: f395c3c2eb4949842e4eefcf933ca13a71662d3b7f192e33441a91c8b69bc7a9edad21602743cb069f7247c4675ec0fc3baa738a70211bbe8963fb594f853d95
7
- data.tar.gz: 6075f8e1009aff8baf34824cb125468b45809ea8465077e27d7d80b10864a5ebe8790abda81336a2da220840583c97f53e417e9f7139da718bd2706140860ded
6
+ metadata.gz: bec42dc8095c0f04ad0b3fb9c269e021b9986cf9a9cb606c37e39359a13f3fd0e63c5eaffb75d7881c62adc389be9ab8ff266005407377af604aadf6531fbc7c
7
+ data.tar.gz: 30c5648429bf14591dd25ee5eca20228303423db9e925204fdbedc4abafaf1d623237ed0d339f7120a76ab7c5ddd9bb9568d4b943ec4b6586ecc454656b460db
@@ -1,5 +1,11 @@
1
1
  # News
2
2
 
3
+ ## 1.4.5: 2020-11-11
4
+
5
+ ### Improvements
6
+
7
+ * Added `sleep-after-command` directive.
8
+
3
9
  ## 1.4.4: 2020-07-18
4
10
 
5
11
  ### Improvements
@@ -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(parser, line, content, options)
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(parser, line, content, options)
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(parser, line, content, options)
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(parser, line, content, options)
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,17 +365,17 @@ module Grntest
364
365
  end
365
366
  end
366
367
 
367
- def execute_directive_add_ignore_log_pattern(parser, line, content, options)
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(parser, line, content, options)
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
 
377
- def execute_directive_require_platform(parser, line, content, options)
378
+ def execute_directive_require_platform(line, content, options)
378
379
  platform, = options
379
380
  if platform.start_with?("!")
380
381
  if @context.platform == platform[1..-1]
@@ -387,6 +388,15 @@ module Grntest
387
388
  end
388
389
  end
389
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
+
390
400
  def execute_directive(parser, line, content)
391
401
  command, *options = Shellwords.split(content)
392
402
  case command
@@ -423,19 +433,21 @@ module Grntest
423
433
  when "eval"
424
434
  execute_directive_eval(parser, line, content, options)
425
435
  when "require-input-type"
426
- execute_directive_require_input_type(parser, line, content, options)
436
+ execute_directive_require_input_type(line, content, options)
427
437
  when "require-testee"
428
- execute_directive_require_testee(parser, line, content, options)
438
+ execute_directive_require_testee(line, content, options)
429
439
  when "require-interface"
430
- execute_directive_require_interface(parser, line, content, options)
440
+ execute_directive_require_interface(line, content, options)
431
441
  when "require-apache-arrow"
432
- execute_directive_require_apache_arrow(parser, line, content, options)
442
+ execute_directive_require_apache_arrow(line, content, options)
433
443
  when "add-ignore-log-pattern"
434
- execute_directive_add_ignore_log_pattern(parser, line, content, options)
444
+ execute_directive_add_ignore_log_pattern(line, content, options)
435
445
  when "remove-ignore-log-pattern"
436
- execute_directive_remove_ignore_log_pattern(parser, line, content, options)
446
+ execute_directive_remove_ignore_log_pattern(line, content, options)
437
447
  when "require-platform"
438
- execute_directive_require_platform(parser, line, content, options)
448
+ execute_directive_require_platform(line, content, options)
449
+ when "sleep-after-command"
450
+ execute_directive_sleep_after_command(line, content, options)
439
451
  else
440
452
  log_input(line)
441
453
  log_error("#|e| unknown directive: <#{command}>")
@@ -501,6 +513,7 @@ module Grntest
501
513
  else
502
514
  type = @output_type
503
515
  log_output(response)
516
+ sleep(@sleep_after_command) if @sleep_after_command
504
517
  log_error(extract_important_messages(read_all_log))
505
518
  log_query_log_content(read_all_query_log)
506
519
 
@@ -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.4"
17
+ VERSION = "1.4.5"
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.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-07-17 00:00:00.000000000 Z
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.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