-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1730 from buildtesters/specify_regex_type
add support for regular expression types (re.search, re.match, re.fullmatch) in status check and metrics definition
- Loading branch information
Showing
13 changed files
with
259 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
buildtest/schemas/examples/script.schema.json/invalid/invalid_re_value.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
buildspecs: | ||
invalid_re_value: | ||
type: script | ||
executor: generic.local.bash | ||
description: The "re" value is invalid | ||
run: echo "world" | ||
status: | ||
regex: | ||
stream: stdout | ||
exp: "world$" | ||
re: "search" |
1 change: 1 addition & 0 deletions
1
buildtest/schemas/examples/script.schema.json/valid/metrics_with_regex_type.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../../tutorials/metrics/metrics_with_regex_type.yml |
1 change: 1 addition & 0 deletions
1
buildtest/schemas/examples/script.schema.json/valid/specify_regex_type.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../../tutorials/test_status/specify_regex_type.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../tutorials/metrics/metrics_with_regex_type.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../tutorials/test_status/specify_regex_type.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
buildspecs: | ||
metric_regex_example_with_re: | ||
executor: generic.local.bash | ||
type: script | ||
description: capture metric with different regex types | ||
tags: tutorials | ||
run: | | ||
echo "HPCG result is VALID with a GFLOP/s rating of=63.6515" | ||
echo "HPCG result is INVALID with a GFLOP/s rating of=28.1215" > hpcg.txt | ||
metrics: | ||
hpcg_result: | ||
type: float | ||
regex: | ||
re: "re.search" | ||
exp: '(\d+\.\d+)$' | ||
stream: stdout | ||
hpcg_text: | ||
type: str | ||
regex: | ||
re: "re.match" | ||
exp: '^HPCG result is VALID' | ||
stream: stdout | ||
hpcg_file_text: | ||
type: str | ||
file_regex: | ||
re: "re.match" | ||
exp: '^HPCG result is INVALID' | ||
file: hpcg.txt | ||
hpcg_file_result: | ||
type: float | ||
file_regex: | ||
re: "re.search" | ||
exp: '(\d+\.\d+)$' | ||
file: hpcg.txt | ||
status: | ||
assert_eq: | ||
comparisons: | ||
- name: hpcg_text | ||
ref: "HPCG result is VALID" | ||
- name: hpcg_result | ||
ref: 63.6515 | ||
- name: hpcg_file_text | ||
ref: "HPCG result is INVALID" | ||
- name: hpcg_file_result | ||
ref: 28.1215 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
buildspecs: | ||
re.search.stdout: | ||
executor: generic.local.bash | ||
type: script | ||
description: Test re.search on stdout | ||
run: echo "This is a string" | ||
status: | ||
regex: | ||
stream: stdout | ||
exp: 'is' | ||
re: "re.search" | ||
|
||
re.match.stdout: | ||
executor: generic.local.bash | ||
type: script | ||
description: Test re.match on stdout | ||
run: echo "This is a string" | ||
status: | ||
regex: | ||
stream: stdout | ||
exp: 'is' | ||
re: "re.match" | ||
|
||
re.fullmatch.stdout: | ||
executor: generic.local.bash | ||
type: script | ||
description: Test re.fullmatch on stdout | ||
run: echo "This is a string" | ||
status: | ||
regex: | ||
stream: stdout | ||
exp: 'This is a string' | ||
re: "re.fullmatch" | ||
|
||
re.match_on_file_regex: | ||
executor: generic.local.bash | ||
type: script | ||
description: Test re.match on file regex | ||
run: | | ||
echo "This is a string" > file.txt | ||
echo "Hello World" > hello.txt | ||
status: | ||
file_regex: | ||
- file: file.txt | ||
exp: 'string' | ||
re: "re.search" | ||
- file: hello.txt | ||
exp: 'Hello' | ||
re: "re.match" | ||
- file: hello.txt | ||
exp: 'Hello World' | ||
re: "re.fullmatch" |