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 No newline at end of file | |||
There was a problem hiding this comment.
this symbolic link looks hardcoded to your filesystem this wont work. Please use relative paths
There was a problem hiding this comment.
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.
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.
shahzebsiddiqui
left a comment
There was a problem hiding this comment.
This look better but a few more changes are needed in order to merge this. Please see my comments.
Mendi03
left a comment
There was a problem hiding this comment.
@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.
@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.