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

Filling Minor Coverage Gaps #434

Merged
merged 4 commits into from
Jan 27, 2022
Merged

Filling Minor Coverage Gaps #434

merged 4 commits into from
Jan 27, 2022

Conversation

angrybayblade
Copy link
Contributor

Proposed changes

Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request.

Fixes

If it fixes a bug or resolves a feature request, be sure to link to that issue.

Types of changes

What types of changes does your code introduce?
Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

Put an x in the boxes that apply.

  • I have read the CONTRIBUTING doc
  • I am making a pull request against the develop branch (left side). Also you should start your branch off our develop.
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works

Further comments

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...

Comment on lines +443 to +444
if self.context.state.period.syncing_up: # pragma: nocover
# needs to be tested
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There seems to be a lack of understanding on my side but the generator created from async_act_wrapper seems to ignore the yield statements after except statement. It throws StopIteration after the code in the try block is executed. Don't confuse it with the StopIteraration exception thrown by generators inside the try block. What I mean is after the try/except block seems to be working as intended, but the generator should also be yielding after StopIteration has been handled since there are yield statements after the exception has been handled. I studied Marco's PR but it didn't get anywhere. I propose we skip this test for a while. Also, there seems to be a lot of issues with the test since the PR for sync mechanism and catchup test has been merged. I'll start digging a bit deep and see if I can figure out the issue.

Copy link
Contributor

Choose a reason for hiding this comment

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

Interesting. I also need to dig in there before commenting. @marcofavorito you should read this :)

@codecov
Copy link

codecov bot commented Jan 27, 2022

Codecov Report

Merging #434 (6c262f1) into main (d44d7e1) will increase coverage by 0.12%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #434      +/-   ##
==========================================
+ Coverage   99.86%   99.98%   +0.12%     
==========================================
  Files         142      142              
  Lines       11505    11491      -14     
==========================================
  Hits        11489    11489              
+ Misses         16        2      -14     
Flag Coverage Δ
unittests 99.98% <ø> (+0.12%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...lory/skills/abstract_round_abci/behaviour_utils.py 100.00% <ø> (+2.74%) ⬆️
...es/valory/skills/abstract_round_abci/behaviours.py 100.00% <ø> (+1.58%) ⬆️
packages/valory/skills/abstract_round_abci/base.py 100.00% <0.00%> (+0.12%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d44d7e1...6c262f1. Read the comment docs.

@@ -123,7 +123,7 @@ def _check_matching_round_consistency(
raise ABCIAppInternalError(
f"round {round_cls.round_id} is a final round it shouldn't have any matching behaviours."
)
continue
continue # pragma: nocover
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we not have a test for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There's seems to be an issue with covering continue statements with python. (nedbat/coveragepy#198, pytest-dev/pytest-cov#368). We have marked every continue statement with nocover tag throughout the code.

@@ -676,7 +677,7 @@ def _get_status(self) -> Generator[None, None, HttpMessage]:

def _has_synced_up(
self,
) -> Generator[None, None, bool]:
) -> Generator[None, None, bool]: # pragma: nocover
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we not test this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Writing a separating test for this method will be futile since this is a simple network call. This method will be tested automatically once we figure out a way to fix the issue that I mentioned above.

Copy link
Contributor

Choose a reason for hiding this comment

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

ok

Comment on lines +443 to +444
if self.context.state.period.syncing_up: # pragma: nocover
# needs to be tested
Copy link
Contributor

Choose a reason for hiding this comment

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

Interesting. I also need to dig in there before commenting. @marcofavorito you should read this :)

Copy link
Contributor

@DavidMinarsch DavidMinarsch left a comment

Choose a reason for hiding this comment

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

LGTM

@DavidMinarsch DavidMinarsch merged commit 2c69735 into main Jan 27, 2022
@DavidMinarsch DavidMinarsch deleted the fix/coverage-gap branch January 28, 2022 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants