mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-03-25 09:28:27 +00:00
[TEST] Replace folded blocks with literal blocks
The regex tests are formatted with blocks for readability. Previously, they were formatted using folded style blocks (e.g. using `>`). Folded blocks convert newlines into spaces. This is problematic for our regex, since comments can only be terminated with a newline. Effectively, anything after a comment will be commented out, making many of the regex "silently pass". This commit replaces them with scalar-style blocks (e.g. using `|`), which treats newlines as significant, and thus correctly terminates comments inside the regex. Also fixes a regex test (`cat.thread_pool/10_basic.yaml`) that started to fail after the block was fixed. The test was missing a `\s+` before the closing newline.
This commit is contained in:
parent
48930c2950
commit
f4c5cde8af
12
rest-api-spec/test/cat.aliases/10_basic.yaml
Normal file → Executable file
12
rest-api-spec/test/cat.aliases/10_basic.yaml
Normal file → Executable file
@ -5,7 +5,7 @@
|
||||
help: true
|
||||
|
||||
- match:
|
||||
$body: >
|
||||
$body: |
|
||||
/^ alias .+ \n
|
||||
index .+ \n
|
||||
filter .+ \n
|
||||
@ -20,7 +20,7 @@
|
||||
cat.aliases: {}
|
||||
|
||||
- match:
|
||||
$body: >
|
||||
$body: |
|
||||
/^
|
||||
$/
|
||||
|
||||
@ -40,7 +40,7 @@
|
||||
cat.aliases: {}
|
||||
|
||||
- match:
|
||||
$body: >
|
||||
$body: |
|
||||
/^
|
||||
test_alias \s+
|
||||
test \s+
|
||||
@ -70,7 +70,7 @@
|
||||
cat.aliases: {}
|
||||
|
||||
- match:
|
||||
$body: >
|
||||
$body: |
|
||||
/^
|
||||
test_alias \s+
|
||||
test \s+
|
||||
@ -137,7 +137,7 @@
|
||||
v: true
|
||||
|
||||
- match:
|
||||
$body: >
|
||||
$body: |
|
||||
/^ alias \s+
|
||||
index \s+
|
||||
filter \s+
|
||||
@ -177,7 +177,7 @@
|
||||
h: [index, alias]
|
||||
v: true
|
||||
- match:
|
||||
$body: >
|
||||
$body: |
|
||||
/^
|
||||
index \s+ alias \s+ \n
|
||||
test \s+ test_1 \s+ \n
|
||||
|
18
rest-api-spec/test/cat.allocation/10_basic.yaml
Normal file → Executable file
18
rest-api-spec/test/cat.allocation/10_basic.yaml
Normal file → Executable file
@ -5,7 +5,7 @@
|
||||
help: true
|
||||
|
||||
- match:
|
||||
$body: >
|
||||
$body: |
|
||||
/^ shards .+ \n
|
||||
disk.used .+ \n
|
||||
disk.avail .+ \n
|
||||
@ -23,7 +23,7 @@
|
||||
cat.allocation: {}
|
||||
|
||||
- match:
|
||||
$body: >
|
||||
$body: |
|
||||
/^
|
||||
( 0 \s+
|
||||
\d+(\.\d+)?[kmgt]?b \s+
|
||||
@ -53,7 +53,7 @@
|
||||
cat.allocation: {}
|
||||
|
||||
- match:
|
||||
$body: >
|
||||
$body: |
|
||||
/^
|
||||
( \d+ \s+
|
||||
\d+(\.\d+)?[kmgt]?b \s+
|
||||
@ -80,7 +80,7 @@
|
||||
node_id: _master
|
||||
|
||||
- match:
|
||||
$body: >
|
||||
$body: |
|
||||
/^
|
||||
( 0 \s+
|
||||
\d+(\.\d+)?[kmgt]?b \s+
|
||||
@ -99,7 +99,7 @@
|
||||
node_id: non_existent
|
||||
|
||||
- match:
|
||||
$body: >
|
||||
$body: |
|
||||
/^
|
||||
$/
|
||||
|
||||
@ -111,7 +111,7 @@
|
||||
v: true
|
||||
- match:
|
||||
|
||||
$body: >
|
||||
$body: |
|
||||
/^ shards \s+
|
||||
disk.used \s+
|
||||
disk.avail \s+
|
||||
@ -142,7 +142,7 @@
|
||||
h: [disk.percent, node]
|
||||
|
||||
- match:
|
||||
$body: >
|
||||
$body: |
|
||||
/^
|
||||
( \d* \s+
|
||||
\w.*
|
||||
@ -156,7 +156,7 @@
|
||||
v: true
|
||||
|
||||
- match:
|
||||
$body: >
|
||||
$body: |
|
||||
/^
|
||||
disk.percent \s+
|
||||
node \s+
|
||||
@ -178,7 +178,7 @@
|
||||
bytes: g
|
||||
|
||||
- match:
|
||||
$body: >
|
||||
$body: |
|
||||
/^
|
||||
( 0 \s+
|
||||
\d+ \s+
|
||||
|
12
rest-api-spec/test/cat.count/10_basic.yaml
Normal file → Executable file
12
rest-api-spec/test/cat.count/10_basic.yaml
Normal file → Executable file
@ -5,7 +5,7 @@
|
||||
help: true
|
||||
|
||||
- match:
|
||||
$body: >
|
||||
$body: |
|
||||
/^ epoch .+ \n
|
||||
timestamp .+ \n
|
||||
count .+ \n $/
|
||||
@ -17,7 +17,7 @@
|
||||
cat.count: {}
|
||||
|
||||
- match:
|
||||
$body: >
|
||||
$body: |
|
||||
/# epoch timestamp count
|
||||
^ \d+ \s \d{2}:\d{2}:\d{2} \s 0 \s $/
|
||||
|
||||
@ -33,7 +33,7 @@
|
||||
cat.count: {}
|
||||
|
||||
- match:
|
||||
$body: >
|
||||
$body: |
|
||||
/# epoch timestamp count
|
||||
^ \d+ \s \d{2}:\d{2}:\d{2} \s 1 \s $/
|
||||
|
||||
@ -50,7 +50,7 @@
|
||||
h: count
|
||||
|
||||
- match:
|
||||
$body: >
|
||||
$body: |
|
||||
/# count
|
||||
^ 2 \s $/
|
||||
|
||||
@ -60,7 +60,7 @@
|
||||
index: index1
|
||||
|
||||
- match:
|
||||
$body: >
|
||||
$body: |
|
||||
/# epoch timestamp count
|
||||
^ \d+ \s \d{2}:\d{2}:\d{2} \s 1 \s $/
|
||||
|
||||
@ -70,7 +70,7 @@
|
||||
v: true
|
||||
|
||||
- match:
|
||||
$body: >
|
||||
$body: |
|
||||
/^ epoch \s+ timestamp \s+ count \s+ \n
|
||||
\d+ \s+ \d{2}:\d{2}:\d{2} \s+ \d+ \s+ \n $/
|
||||
|
||||
|
4
rest-api-spec/test/cat.recovery/10_basic.yaml
Normal file → Executable file
4
rest-api-spec/test/cat.recovery/10_basic.yaml
Normal file → Executable file
@ -5,7 +5,7 @@
|
||||
cat.recovery: {}
|
||||
|
||||
- match:
|
||||
$body: >
|
||||
$body: |
|
||||
/^$/
|
||||
|
||||
- do:
|
||||
@ -21,7 +21,7 @@
|
||||
- do:
|
||||
cat.recovery: {}
|
||||
- match:
|
||||
$body: >
|
||||
$body: |
|
||||
/^(index1 \s+ \d+ \s+ \d+ \s+
|
||||
(gateway|replica|snapshot|relocating) \s+
|
||||
(init|index|start|translog|finalize|done) \s+
|
||||
|
8
rest-api-spec/test/cat.shards/10_basic.yaml
Normal file → Executable file
8
rest-api-spec/test/cat.shards/10_basic.yaml
Normal file → Executable file
@ -5,7 +5,7 @@
|
||||
cat.shards: {}
|
||||
|
||||
- match:
|
||||
$body: >
|
||||
$body: |
|
||||
/^$/
|
||||
|
||||
- do:
|
||||
@ -22,7 +22,7 @@
|
||||
cat.shards: {}
|
||||
|
||||
- match:
|
||||
$body: >
|
||||
$body: |
|
||||
/^(index1 \s+ \d \s+ (p|r) \s+ ((STARTED|INITIALIZING) \s+ (\d \s+ (\d+|\d+[.]\d+)(kb|b) \s+)? \d{1,3}.\d{1,3}.\d{1,3}.\d{1,3} \s+ .+|UNASSIGNED \s+) \n?){10}$/
|
||||
|
||||
- do:
|
||||
@ -39,12 +39,12 @@
|
||||
- do:
|
||||
cat.shards: {}
|
||||
- match:
|
||||
$body: >
|
||||
$body: |
|
||||
/^(index(1|2) \s+ \d \s+ (p|r) \s+ ((STARTED|INITIALIZING) \s+ (\d \s+ (\d+|\d+[.]\d+)(kb|b) \s+)? \d{1,3}.\d{1,3}.\d{1,3}.\d{1,3} \s+ .+|UNASSIGNED \s+) \n?){15}$/
|
||||
|
||||
- do:
|
||||
cat.shards:
|
||||
index: index2
|
||||
- match:
|
||||
$body: >
|
||||
$body: |
|
||||
/^(index2 \s+ \d \s+ (p|r) \s+ ((STARTED|INITIALIZING) \s+ (\d \s+ (\d+|\d+[.]\d+)(kb|b) \s+)? \d{1,3}.\d{1,3}.\d{1,3}.\d{1,3} \s+ .+|UNASSIGNED \s+) \n?){5}$/
|
||||
|
38
rest-api-spec/test/cat.thread_pool/10_basic.yaml
Normal file → Executable file
38
rest-api-spec/test/cat.thread_pool/10_basic.yaml
Normal file → Executable file
@ -5,7 +5,7 @@
|
||||
cat.thread_pool: {}
|
||||
|
||||
- match:
|
||||
$body: >
|
||||
$body: |
|
||||
/ #host ip bulk.active bulk.queue bulk.rejected index.active index.queue index.rejected search.active search.queue search.rejected
|
||||
^ (\S+ \s+ (\d{1,3}\.){3}\d{1,3} \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d+ \s+ \n)+ $/
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
v: true
|
||||
|
||||
- match:
|
||||
$body: >
|
||||
$body: |
|
||||
/^ host \s+ ip \s+ bulk.active \s+ bulk.queue \s+ bulk.rejected \s+ index.active \s+ index.queue \s+ index.rejected \s+ search.active \s+ search.queue \s+ search.rejected \s+ \n
|
||||
(\S+ \s+ (\d{1,3}\.){3}\d{1,3} \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d+ \s+ \n)+ $/
|
||||
|
||||
@ -23,9 +23,9 @@
|
||||
h: pid,id,h,i,po
|
||||
|
||||
- match:
|
||||
$body: >
|
||||
$body: |
|
||||
/ #pid id host ip port
|
||||
^ (\d+ \s+ \S{4} \s+ \S+ \s+ (\d{1,3}\.){3}\d{1,3} \s+ \d{4} \n)+ $/
|
||||
^ (\d+ \s+ \S{4} \s+ \S+ \s+ (\d{1,3}\.){3}\d{1,3} \s+ \d{4} \s+ \n)+ $/
|
||||
|
||||
- do:
|
||||
cat.thread_pool:
|
||||
@ -34,7 +34,7 @@
|
||||
full_id: true
|
||||
|
||||
- match:
|
||||
$body: >
|
||||
$body: |
|
||||
/^ id \s+ ba \s+ fa \s+ gea \s+ ga \s+ ia \s+ maa \s+ ma \s+ oa \s+ pa \s+ \n
|
||||
(\S+ \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d+ \s+ \n)+ $/
|
||||
|
||||
@ -44,7 +44,7 @@
|
||||
v: true
|
||||
|
||||
- match:
|
||||
$body: >
|
||||
$body: |
|
||||
/^ id \s+ bulk.type \s+ bulk.active \s+ bulk.size \s+ bulk.queue \s+ bulk.queueSize \s+ bulk.rejected \s+ bulk.largest \s+ bulk.completed \s+ bulk.min \s+ bulk.max \s+ bulk.keepAlive \s+ \n
|
||||
(\S+ \s+ (cached|fixed|scaling)? \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d* \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d* \s+ \d* \s+ \S* \s+ \n)+ $/
|
||||
|
||||
@ -54,7 +54,7 @@
|
||||
v: true
|
||||
|
||||
- match:
|
||||
$body: >
|
||||
$body: |
|
||||
/^ id \s+ flush.type \s+ flush.active \s+ flush.size \s+ flush.queue \s+ flush.queueSize \s+ flush.rejected \s+ flush.largest \s+ flush.completed \s+ flush.min \s+ flush.max \s+ flush.keepAlive \s+ \n
|
||||
(\S+ \s+ (cached|fixed|scaling)? \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d* \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d* \s+ \d* \s+ \S* \s+ \n)+ $/
|
||||
|
||||
@ -64,7 +64,7 @@
|
||||
v: true
|
||||
|
||||
- match:
|
||||
$body: >
|
||||
$body: |
|
||||
/^ id \s+ generic.type \s+ generic.active \s+ generic.size \s+ generic.queue \s+ generic.queueSize \s+ generic.rejected \s+ generic.largest \s+ generic.completed \s+ generic.min \s+ generic.max \s+ generic.keepAlive \s+ \n
|
||||
(\S+ \s+ (cached|fixed|scaling)? \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d* \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d* \s+ \d* \s+ \S* \s+ \n)+ $/
|
||||
|
||||
@ -74,7 +74,7 @@
|
||||
v: true
|
||||
|
||||
- match:
|
||||
$body: >
|
||||
$body: |
|
||||
/^ id \s+ get.type \s+ get.active \s+ get.size \s+ get.queue \s+ get.queueSize \s+ get.rejected \s+ get.largest \s+ get.completed \s+ get.min \s+ get.max \s+ get.keepAlive \s+ \n
|
||||
(\S+ \s+ (cached|fixed|scaling)? \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d* \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d* \s+ \d* \s+ \S* \s+ \n)+ $/
|
||||
|
||||
@ -84,7 +84,7 @@
|
||||
v: true
|
||||
|
||||
- match:
|
||||
$body: >
|
||||
$body: |
|
||||
/^ id \s+ index.type \s+ index.active \s+ index.size \s+ index.queue \s+ index.queueSize \s+ index.rejected \s+ index.largest \s+ index.completed \s+ index.min \s+ index.max \s+ index.keepAlive \s+ \n
|
||||
(\S+ \s+ (cached|fixed|scaling)? \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d* \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d* \s+ \d* \s+ \S* \s+ \n)+ $/
|
||||
|
||||
@ -94,7 +94,7 @@
|
||||
v: true
|
||||
|
||||
- match:
|
||||
$body: >
|
||||
$body: |
|
||||
/^ id \s+ management.type \s+ management.active \s+ management.size \s+ management.queue \s+ management.queueSize \s+ management.rejected \s+ management.largest \s+ management.completed \s+ management.min \s+ management.max \s+ management.keepAlive \s+ \n
|
||||
(\S+ \s+ (cached|fixed|scaling)? \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d* \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d* \s+ \d* \s+ \S* \s+ \n)+ $/
|
||||
|
||||
@ -104,7 +104,7 @@
|
||||
v: true
|
||||
|
||||
- match:
|
||||
$body: >
|
||||
$body: |
|
||||
/^ id \s+ merge.type \s+ merge.active \s+ merge.size \s+ merge.queue \s+ merge.queueSize \s+ merge.rejected \s+ merge.largest \s+ merge.completed \s+ merge.min \s+ merge.max \s+ merge.keepAlive \s+ \n
|
||||
(\S+ \s+ (cached|fixed|scaling)? \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d* \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d* \s+ \d* \s+ \S* \s+ \n)+ $/
|
||||
|
||||
@ -114,7 +114,7 @@
|
||||
v: true
|
||||
|
||||
- match:
|
||||
$body: >
|
||||
$body: |
|
||||
/^ id \s+ optimize.type \s+ optimize.active \s+ optimize.size \s+ optimize.queue \s+ optimize.queueSize \s+ optimize.rejected \s+ optimize.largest \s+ optimize.completed \s+ optimize.min \s+ optimize.max \s+ optimize.keepAlive \s+ \n
|
||||
(\S+ \s+ (cached|fixed|scaling)? \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d* \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d* \s+ \d* \s+ \S* \s+ \n)+ $/
|
||||
|
||||
@ -124,7 +124,7 @@
|
||||
v: true
|
||||
|
||||
- match:
|
||||
$body: >
|
||||
$body: |
|
||||
/^ id \s+ percolate.type \s+ percolate.active \s+ percolate.size \s+ percolate.queue \s+ percolate.queueSize \s+ percolate.rejected \s+ percolate.largest \s+ percolate.completed \s+ percolate.min \s+ percolate.max \s+ percolate.keepAlive \s+ \n
|
||||
(\S+ \s+ (cached|fixed|scaling)? \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d* \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d* \s+ \d* \s+ \S* \s+ \n)+ $/
|
||||
|
||||
@ -134,7 +134,7 @@
|
||||
v: true
|
||||
|
||||
- match:
|
||||
$body: >
|
||||
$body: |
|
||||
/^ id \s+ refresh.type \s+ refresh.active \s+ refresh.size \s+ refresh.queue \s+ refresh.queueSize \s+ refresh.rejected \s+ refresh.largest \s+ refresh.completed \s+ refresh.min \s+ refresh.max \s+ refresh.keepAlive \s+ \n
|
||||
(\S+ \s+ (cached|fixed|scaling)? \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d* \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d* \s+ \d* \s+ \S* \s+ \n)+ $/
|
||||
|
||||
@ -144,7 +144,7 @@
|
||||
v: true
|
||||
|
||||
- match:
|
||||
$body: >
|
||||
$body: |
|
||||
/^ id \s+ search.type \s+ search.active \s+ search.size \s+ search.queue \s+ search.queueSize \s+ search.rejected \s+ search.largest \s+ search.completed \s+ search.min \s+ search.max \s+ search.keepAlive \s+ \n
|
||||
(\S+ \s+ (cached|fixed|scaling)? \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d* \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d* \s+ \d* \s+ \S* \s+ \n)+ $/
|
||||
|
||||
@ -154,7 +154,7 @@
|
||||
v: true
|
||||
|
||||
- match:
|
||||
$body: >
|
||||
$body: |
|
||||
/^ id \s+ snapshot.type \s+ snapshot.active \s+ snapshot.size \s+ snapshot.queue \s+ snapshot.queueSize \s+ snapshot.rejected \s+ snapshot.largest \s+ snapshot.completed \s+ snapshot.min \s+ snapshot.max \s+ snapshot.keepAlive \s+ \n
|
||||
(\S+ \s+ (cached|fixed|scaling)? \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d* \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d* \s+ \d* \s+ \S* \s+ \n)+ $/
|
||||
|
||||
@ -164,7 +164,7 @@
|
||||
v: true
|
||||
|
||||
- match:
|
||||
$body: >
|
||||
$body: |
|
||||
/^ id \s+ suggest.type \s+ suggest.active \s+ suggest.size \s+ suggest.queue \s+ suggest.queueSize \s+ suggest.rejected \s+ suggest.largest \s+ suggest.completed \s+ suggest.min \s+ suggest.max \s+ suggest.keepAlive \s+ \n
|
||||
(\S+ \s+ (cached|fixed|scaling)? \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d* \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d* \s+ \d* \s+ \S* \s+ \n)+ $/
|
||||
|
||||
@ -174,6 +174,6 @@
|
||||
v: true
|
||||
|
||||
- match:
|
||||
$body: >
|
||||
$body: |
|
||||
/^ id \s+ warmer.type \s+ warmer.active \s+ warmer.size \s+ warmer.queue \s+ warmer.queueSize \s+ warmer.rejected \s+ warmer.largest \s+ warmer.completed \s+ warmer.min \s+ warmer.max \s+ warmer.keepAlive \s+ \n
|
||||
(\S+ \s+ (cached|fixed|scaling)? \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d* \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d* \s+ \d* \s+ \S* \s+ \n)+ $/
|
||||
|
Loading…
x
Reference in New Issue
Block a user