Skip to content

Added coverage to --retry#1501

Merged
shahzebsiddiqui merged 8 commits intobuildtesters:develfrom
Mendi03:Salvador_patch
Jun 29, 2023
Merged

Added coverage to --retry#1501
shahzebsiddiqui merged 8 commits intobuildtesters:develfrom
Mendi03:Salvador_patch

Conversation

@Mendi03
Copy link
Collaborator

@Mendi03 Mendi03 commented Jun 28, 2023

Did the following to add coverage for --retry:

I did not rewrite lines 563-583 under buildtest/cli/build.py since it caused errors with test_build_limit.

This is the code I tried using:

# if (timeout) or (limit is not None) or (retry is not None):
#   list1 = [timeout, limit, retry]
#   for x in list1:
#       if not isinstance(x, int):
#           raise BuildTestError(f"{x} is not of type int")
#       if x <= 0:
#           raise BuildTestError(f"{x} must be greater than 0")

Mendi03 added 5 commits June 27, 2023 17:52
Changed multiple files so that method test_retry would run properly.
Small commit to ignore .idea file from pycharm and reformatted some code to fit the style
removed .idea and added it to the .gitignore
Removed the following comment from the build.py file:

# if (timeout) or (limit is not None) or (retry is not None):
        #   list1 = [timeout, limit, retry]
        #   for x in list1:
        #       if not isinstance(x, int):
        #           raise BuildTestError(f"{x} is not of type int")
        #       if x <= 0:
        #           raise BuildTestError(f"{x} must be greater than 0")
@codecov
Copy link

codecov bot commented Jun 28, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.25 🎉

Comparison is base (a86f14d) 76.20% compared to head (9e1a855) 76.46%.

❗ Current head 9e1a855 differs from pull request most recent head 566e2b8. Consider uploading reports for the commit 566e2b8 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##            devel    #1501      +/-   ##
==========================================
+ Coverage   76.20%   76.46%   +0.25%     
==========================================
  Files          57       57              
  Lines        6619     6614       -5     
==========================================
+ Hits         5044     5057      +13     
+ Misses       1575     1557      -18     
Impacted Files Coverage Δ
buildtest/executors/local.py 94.23% <ø> (+3.49%) ⬆️
buildtest/builders/base.py 84.19% <100.00%> (+3.08%) ⬆️
buildtest/cli/build.py 95.92% <100.00%> (-0.03%) ⬇️

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

Mendi03 added 2 commits June 29, 2023 11:03
Wrote a for loop under the _init__ method in buildtest class for better semantics
if not isinstance(field, int):
raise BuildTestError(f"{field} is not of type int")
if field <= 0:
raise BuildTestError("Limit must be greater than 0")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change Limit -> {field}

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching that! Should be fixed now.

@shahzebsiddiqui shahzebsiddiqui self-requested a review June 29, 2023 17:10
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.

thanks @Mendi03 this looks good and congrats on your 1st contribution!

@shahzebsiddiqui shahzebsiddiqui merged commit 51a2ae0 into buildtesters:devel Jun 29, 2023
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.

change url for stale issue add code coverage for retrying tests (buildtest build --retry)

2 participants