-
-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add coverage to regex_check method #1507
Add coverage to regex_check method #1507
Conversation
…ethod test_regex is in tests/builder/test_builders.py regex_check method is in buildesystem/checks.py
tests/builders/status_regex.yml
Outdated
@@ -0,0 +1 @@ | |||
/Users/anwar/Documents/GitHub/buildtest/tutorials/test_status/status_regex.yml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this symbolic link looks hardcoded to your filesystem this wont work. Please use relative paths
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this symbolic link looks hardcoded to your filesystem this wont work. Please use relative paths
Done, thanks!
status_regex_stderr_pass: | ||
executor: generic.local.bash | ||
type: script | ||
tags: [ system ] | ||
description: Pass test based on regular expression | ||
run: echo "PASS" | ||
status: | ||
regex: | ||
stream: stderr | ||
exp: "^(PASS)$" | ||
|
||
status_regex_stderr_fail: | ||
executor: generic.local.bash | ||
type: script | ||
tags: [ system ] | ||
description: Pass test based on regular expression | ||
run: echo "FAIL" | ||
status: | ||
regex: | ||
stream: stderr | ||
exp: "^(123FAIL)$" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since you added 2 more tests here you will want to update the documentation in particular https://buildtest.readthedocs.io/en/devel/buildspecs/buildspec_overview.html#passing-test-based-on-regular-expression page where you should update the paragraph to explain what this test is doing. You should emphasize the important lines.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This look better but a few more changes are needed in order to merge this. Please see my comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shahzebsiddiqui Please see my comment.
def test_regex_check(): | ||
"""This test buildspec using status check with 'status_regex'""" | ||
cmd = BuildTest( | ||
buildspecs=[ | ||
os.path.join(here, "status_regex.yml")], | ||
buildtest_system=system, | ||
configuration=config, | ||
) | ||
cmd.build() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shahzebsiddiqui When I tried running coverage, I see the error There are no config files to process.
. This might be because on my side it says that the symbolic link is invalid. However, @szuananwar says that the symbolic link works on her side and the regresion test works properly. Is there a reason why it works for her but not during the regresion test by github?
…ildspecs/buildspec_overview.html#passing-test-based-on-regular-expression to include error file pass and fail state and important lines has been emphasized.
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## devel #1507 +/- ##
==========================================
+ Coverage 76.46% 77.02% +0.56%
==========================================
Files 57 57
Lines 6614 6615 +1
==========================================
+ Hits 5057 5095 +38
+ Misses 1557 1520 -37
☔ View full report in Codecov by Sentry. |
No description provided.