Skip to content
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

Merged
merged 9 commits into from
Jul 7, 2023

Conversation

szuananwar
Copy link
Collaborator

No description provided.

@@ -0,0 +1 @@
/Users/anwar/Documents/GitHub/buildtest/tutorials/test_status/status_regex.yml
Copy link
Member

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

Copy link
Collaborator Author

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!

Comment on lines +23 to +44
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)$"
Copy link
Member

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.

Copy link
Member

@shahzebsiddiqui shahzebsiddiqui left a 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.

Copy link
Collaborator

@Mendi03 Mendi03 left a 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.

Comment on lines +143 to +151
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()
Copy link
Collaborator

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?

@shahzebsiddiqui shahzebsiddiqui marked this pull request as draft July 7, 2023 01:44
@shahzebsiddiqui shahzebsiddiqui marked this pull request as ready for review July 7, 2023 01:45
@codecov
Copy link

codecov bot commented Jul 7, 2023

Codecov Report

Patch coverage: 33.33% and project coverage change: +0.56 🎉

Comparison is base (bbd8a5a) 76.46% compared to head (ad2d294) 77.02%.

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     
Impacted Files Coverage Δ
buildtest/utils/file.py 88.31% <0.00%> (ø)
buildtest/cli/build.py 95.93% <100.00%> (+0.01%) ⬆️
buildtest/cli/report.py 89.89% <100.00%> (+4.26%) ⬆️

... and 3 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@shahzebsiddiqui shahzebsiddiqui merged commit d43316e into buildtesters:devel Jul 7, 2023
27 of 30 checks passed
@shahzebsiddiqui shahzebsiddiqui linked an issue Jul 10, 2023 that may be closed by this pull request
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add coverage for method regex_check
3 participants