grntest 1.4.1 → 1.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/doc/text/news.md +11 -0
- data/lib/grntest/execution-context.rb +15 -0
- data/lib/grntest/executors/base-executor.rb +21 -5
- data/lib/grntest/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 72bf123c2803dad061e343733c748d2c66ce4fb649e146cf089707b28bc24eb7
|
4
|
+
data.tar.gz: 808f8b5ede307bab1f5e3e933944e487113b8f22272fe6226d3411986e9a2eac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e39d5e003dd5ad5d48aa71b64b306c882413a27d873fb95c130cc00b5c4538271363f3a04cb44cfdd535a591c1c98479cc41a2558d5a0c7854bbb3793b6ce9b0
|
7
|
+
data.tar.gz: c39924d196aa19cbdf0db12a7660ac6ed7b545e78b6c6852261b9f178b4acc899ba3c8f9ee875042f2700849a2ef3b3db915d72805f5a47552d6c8d358e593c7
|
data/doc/text/news.md
CHANGED
@@ -1,5 +1,16 @@
|
|
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
|
+
|
3
14
|
## 1.4.1: 2020-05-30
|
4
15
|
|
5
16
|
### 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}>")
|
@@ -544,14 +559,15 @@ module Grntest
|
|
544
559
|
|
545
560
|
def normalize_log(entry)
|
546
561
|
case entry.message
|
547
|
-
when /\A(\[io\]\[(?:open|close)\]) <(.*?)>\z/
|
562
|
+
when /\A(\[io\]\[(?:open|close)\]) (.*?)<(.*?)>\z/
|
548
563
|
tag = $1
|
549
|
-
|
564
|
+
io_message = $2
|
565
|
+
path = $3
|
550
566
|
normalized_path = File.basename(path)
|
551
|
-
normalized_message = "#{tag} <#{normalized_path}>"
|
567
|
+
normalized_message = "#{tag} #{io_message}<#{normalized_path}>"
|
552
568
|
case entry.log_level
|
553
|
-
when :
|
554
|
-
normalized_log_level = :
|
569
|
+
when :information, :debug
|
570
|
+
normalized_log_level = :dump
|
555
571
|
else
|
556
572
|
normalized_log_level = entry.log_level
|
557
573
|
end
|
data/lib/grntest/version.rb
CHANGED