grntest 1.5.7 → 1.5.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: 29784781308745fb8cbb626e33012d1dfb25dfdbe7196c53079b57327478a4d2
4
- data.tar.gz: 970b7ea3558d9ad1febbdfa4b375f849b0dd10bb81c65b6651b6e210a91e6431
3
+ metadata.gz: 2209e3afe2a2ef0d25a9ad8e61e0ef36fad7b9faa7106b20d00511ad6f767a9e
4
+ data.tar.gz: dfe1b6a22dbae8d02ada396dc237e20f7384e94a52b5c37e35d8c2dbd01a90df
5
5
  SHA512:
6
- metadata.gz: 9752d6bcb935119c458d2911a7643620a6b3c5b4b9a2a8af772a5d8942e3a94fef6a51370772a317bbeaa47b202e35b3e47a5ed66e6b33c0e9870249e4ac3d8d
7
- data.tar.gz: 35d70626990bead81c6eccb5a15b21c4a00279484635f131d231e0d5f2242cf48ac220a4d72e9d61addce35d0e07c20073a2a0e3f6df08cdc48adfce351863f2
6
+ metadata.gz: 9e84e6673963cb2bf2de0cb5cbd21a9d64977924716c37102aea48415aab1ffcbfdde2f630030f3179828c9e0855da124ca226523c0a060dd92cfd04bb6880e1
7
+ data.tar.gz: 6f2c4f6730b26200e5fa8d39cb56d550dbe98407e5eb54f824e99f0dac9a84616da12fb1f4a32e799344d443d91fd297128e979a8c1caafa96d85a15fb7444ce
data/doc/text/news.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # News
2
2
 
3
+ ## 1.5.8: 2023-07-21
4
+
5
+ ### Improvements
6
+
7
+ * `--random-seed`: Added.
8
+
9
+ * xml: Accepted negative elapsed time.
10
+
11
+ * Added support for groonga-nginx.
12
+
3
13
  ## 1.5.7: 2023-03-08
4
14
 
5
15
  ### Improvements
@@ -767,7 +767,7 @@ module Grntest
767
767
  true
768
768
  when /\A[\w.\\-]+:\d+:\d+: /
769
769
  true
770
- when /\A(?:groonga|groonga-httpd)
770
+ when /\A(?:groonga|groonga-httpd|nginx)
771
771
  \((?:\+0x\h+|\w+\+0x\h+)?\)
772
772
  \s
773
773
  \[0x\h+\]\z/x
@@ -500,10 +500,13 @@ call (int)chdir("#{context.temporary_directory_path}")
500
500
  "-s",
501
501
  context.relative_db_path.to_s,
502
502
  ]
503
- when "groonga-httpd"
504
- command_line = command_command_line(@tester.groonga_httpd, context,
503
+ when "groonga-httpd", "groonga-nginx"
504
+ command_line = command_command_line(@tester.groonga_httpd,
505
+ context,
505
506
  spawn_options)
506
- config_file_path = create_config_file(context, host, port,
507
+ config_file_path = create_config_file(context,
508
+ host,
509
+ port,
507
510
  pid_file_path)
508
511
  command_line += [
509
512
  "-c", config_file_path.to_s,
@@ -517,6 +520,11 @@ call (int)chdir("#{context.temporary_directory_path}")
517
520
  config_file_path =
518
521
  context.temporary_directory_path + "groonga-httpd.conf"
519
522
  config_file_path.open("w") do |config_file|
523
+ if @tester.ngx_http_groonga_module_so
524
+ config_file.puts(<<-LOAD_MODULE)
525
+ load_module #{@tester.ngx_http_groonga_module_so};
526
+ LOAD_MODULE
527
+ end
520
528
  config_file.puts(<<-GLOBAL)
521
529
  daemon off;
522
530
  master_process off;
@@ -725,7 +733,7 @@ http {
725
733
 
726
734
  def normalize_output_xml(content, options)
727
735
  content.sub(/^<RESULT .+?>/) do |result|
728
- result.gsub(/( (?:UP|ELAPSED))="\d+\.\d+(?:e[+-]?\d+)?"/, '\1="0.0"')
736
+ result.gsub(/( (?:UP|ELAPSED))="-?\d+\.\d+(?:e[+-]?\d+)?"/, '\1="0.0"')
729
737
  end
730
738
  end
731
739
 
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2012-2022 Sutou Kouhei <kou@clear-code.com>
1
+ # Copyright (C) 2012-2023 Sutou Kouhei <kou@clear-code.com>
2
2
  #
3
3
  # This program is free software: you can redistribute it and/or modify
4
4
  # it under the terms of the GNU General Public License as published by
@@ -38,6 +38,7 @@ module Grntest
38
38
  parser = OptionParser.new
39
39
  parser.banner += " TEST_FILE_OR_DIRECTORY..."
40
40
 
41
+ custom_groonga_httpd = false
41
42
  parser.on("--groonga=COMMAND",
42
43
  "Use COMMAND as groonga command",
43
44
  "(#{tester.groonga})") do |command|
@@ -48,6 +49,13 @@ module Grntest
48
49
  "Use COMMAND as groonga-httpd command for groonga-httpd tests",
49
50
  "(#{tester.groonga_httpd})") do |command|
50
51
  tester.groonga_httpd = normalize_command(command)
52
+ custom_groonga_httpd = true
53
+ end
54
+
55
+ parser.on("--ngx-http-groonga-module-so=PATH",
56
+ "Use PATH as ngx_http_groonga_module.so for groonga-nginx tests",
57
+ "(#{tester.ngx_http_groonga_module_so})") do |path|
58
+ tester.ngx_http_groonga_module_so = path
51
59
  end
52
60
 
53
61
  parser.on("--groonga-suggest-create-dataset=COMMAND",
@@ -101,15 +109,19 @@ module Grntest
101
109
  tester.output_type = type
102
110
  end
103
111
 
104
- available_testees = ["groonga", "groonga-httpd"]
112
+ available_testees = ["groonga", "groonga-httpd", "groonga-nginx"]
105
113
  available_testee_labels = available_testees.join(", ")
106
114
  parser.on("--testee=TESTEE", available_testees,
107
115
  "Test against TESTEE",
108
116
  "[#{available_testee_labels}]",
109
117
  "(#{tester.testee})") do |testee|
110
118
  tester.testee = testee
111
- if tester.testee == "groonga-httpd"
119
+ case tester.testee
120
+ when "groonga-httpd"
121
+ tester.interface = "http"
122
+ when "groonga-nginx"
112
123
  tester.interface = "http"
124
+ tester.groonga_httpd = "nginx" unless custom_groonga_httpd
113
125
  end
114
126
  end
115
127
 
@@ -281,6 +293,11 @@ module Grntest
281
293
  tester.shutdown_wait_timeout = timeout
282
294
  end
283
295
 
296
+ parser.on("--random-seed=SEED", Integer,
297
+ "Seed for random numbers") do |seed|
298
+ srand(seed)
299
+ end
300
+
284
301
  parser.on("--version",
285
302
  "Show version and exit") do
286
303
  puts(VERSION)
@@ -317,6 +334,7 @@ module Grntest
317
334
 
318
335
  attr_accessor :groonga
319
336
  attr_accessor :groonga_httpd
337
+ attr_accessor :ngx_http_groonga_module_so
320
338
  attr_accessor :groonga_suggest_create_dataset
321
339
  attr_accessor :groonga_synonym_generate
322
340
  attr_accessor :interface
@@ -346,6 +364,7 @@ module Grntest
346
364
  def initialize
347
365
  @groonga = "groonga"
348
366
  @groonga_httpd = "groonga-httpd"
367
+ @ngx_http_groonga_module_so = nil
349
368
  @groonga_suggest_create_dataset = "groonga-suggest-create-dataset"
350
369
  unless command_exist?(@groonga_suggest_create_dataset)
351
370
  @groonga_suggest_create_dataset = nil
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2012-2022 Sutou Kouhei <kou@clear-code.com>
1
+ # Copyright (C) 2012-2023 Sutou Kouhei <kou@clear-code.com>
2
2
  #
3
3
  # This program is free software: you can redistribute it and/or modify
4
4
  # it under the terms of the GNU General Public License as published by
@@ -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.5.7"
17
+ VERSION = "1.5.8"
18
18
  end
@@ -93,31 +93,29 @@ module Grntest
93
93
 
94
94
  @result.measure do
95
95
  @reporter.on_worker_start(self)
96
- catch do |tag|
97
- loop do
98
- suite_name, test_script_path, test_name = queue.pop
99
- break if test_script_path.nil?
100
-
101
- unless @suite_name == suite_name
102
- @reporter.on_suite_finish(self) if @suite_name
103
- @suite_name = suite_name
104
- @reporter.on_suite_start(self)
105
- end
106
-
107
- unless run_test(test_script_path, test_name)
108
- succeeded = false
109
- end
110
-
111
- break if interruptted?
112
-
113
- if @tester.stop_on_failure? and @test_suites_result.have_failure?
114
- break
115
- end
96
+ loop do
97
+ suite_name, test_script_path, test_name = queue.pop
98
+ break if test_script_path.nil?
99
+
100
+ unless @suite_name == suite_name
101
+ @reporter.on_suite_finish(self) if @suite_name
102
+ @suite_name = suite_name
103
+ @reporter.on_suite_start(self)
104
+ end
105
+
106
+ unless run_test(test_script_path, test_name)
107
+ succeeded = false
108
+ end
109
+
110
+ break if interruptted?
111
+
112
+ if @tester.stop_on_failure? and @test_suites_result.have_failure?
113
+ break
116
114
  end
117
- @status = "finished"
118
- @reporter.on_suite_finish(@suite_name) if @suite_name
119
- @suite_name = nil
120
115
  end
116
+ @status = "finished"
117
+ @reporter.on_suite_finish(@suite_name) if @suite_name
118
+ @suite_name = nil
121
119
  end
122
120
  @reporter.on_worker_finish(self)
123
121
 
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.5.7
4
+ version: 1.5.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: 2023-03-08 00:00:00.000000000 Z
12
+ date: 2023-07-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: diff-lcs