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

AEA-684 p2p_stub connection refactoring and tests #1435

Merged
merged 2 commits into from
Jun 30, 2020

Conversation

solarw
Copy link
Contributor

@solarw solarw commented Jun 30, 2020

Proposed changes

small async improvements and tests

Fixes

Types of changes

  • 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

  • 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
  • I have checked that code coverage does not decrease.
  • I have checked that the documentation about the aea cli tool works
  • I have added necessary documentation (if appropriate)
  • Any dependent changes have been merged and published in downstream modules

Comment on lines -83 to -85
if not target_file.is_file():
target_file.touch()
logger.warn("file {} doesn't exist, creating it ...".format(target_file))
Copy link
Contributor

Choose a reason for hiding this comment

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

Why removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

file created on open(, "ab") if it can not be created at this point touch will fail as well, check is_file quite useless, cause if it's non file object it will fail on open

envelope = make_test_envelope(to_="con2")
await self.connection1.send(envelope)

await asyncio.wait_for(self.connection2.receive(), timeout=5)
Copy link
Contributor

Choose a reason for hiding this comment

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

Add some assertions on envelope content?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

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, some minor commentd

@DavidMinarsch DavidMinarsch changed the title p2p_stub connection refactoring and tests AEA-684 p2p_stub connection refactoring and tests Jun 30, 2020
@codecov-commenter
Copy link

codecov-commenter commented Jun 30, 2020

Codecov Report

Merging #1435 into develop will decrease coverage by 2.91%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #1435      +/-   ##
===========================================
- Coverage    91.37%   88.46%   -2.92%     
===========================================
  Files          217      217              
  Lines        15251    15254       +3     
===========================================
- Hits         13936    13494     -442     
- Misses        1315     1760     +445     
Flag Coverage Δ
#unittests 88.46% <100.00%> (-2.92%) ⬇️
Impacted Files Coverage Δ
aea/connections/stub/connection.py 100.00% <100.00%> (ø)
...ackages/fetchai/connections/p2p_stub/connection.py 100.00% <100.00%> (+54.05%) ⬆️
...kages/fetchai/connections/p2p_libp2p/connection.py 18.80% <0.00%> (-64.63%) ⬇️
...etchai/connections/p2p_libp2p_client/connection.py 23.57% <0.00%> (-60.12%) ⬇️
aea/cli/run.py 50.00% <0.00%> (-50.00%) ⬇️
aea/test_tools/generic.py 54.05% <0.00%> (-45.95%) ⬇️
aea/helpers/file_lock.py 66.66% <0.00%> (-29.17%) ⬇️
aea/cli/interact.py 77.14% <0.00%> (-22.86%) ⬇️
aea/helpers/exec_timeout.py 80.00% <0.00%> (-20.00%) ⬇️
aea/cli/utils/click_utils.py 81.03% <0.00%> (-18.97%) ⬇️
... and 17 more

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 1a853a8...279aea9. Read the comment docs.

@solarw solarw force-pushed the feature/p2p_stub_connection branch from d35c515 to ca8a8d3 Compare June 30, 2020 07:51
@solarw solarw force-pushed the feature/p2p_stub_connection branch from c94f210 to 279aea9 Compare June 30, 2020 09:02
@DavidMinarsch DavidMinarsch merged commit 03bc1a7 into develop Jun 30, 2020
@DavidMinarsch DavidMinarsch deleted the feature/p2p_stub_connection branch June 30, 2020 11:03
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.

3 participants