christiansandberg / canopen

CANopen for Python
http://canopen.readthedocs.io/
MIT License
446 stars 196 forks source link

Tests: improve coverage of NodeScanner #517

Closed erlend-aasland closed 3 months ago

codecov-commenter commented 4 months ago

:warning: Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 69.05%. Comparing base (a196e1e) to head (e6921a4).

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/christiansandberg/canopen/pull/517/graphs/tree.svg?width=650&height=150&src=pr&token=3wUNWZVohh&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Christian+Sandberg)](https://app.codecov.io/gh/christiansandberg/canopen/pull/517?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Christian+Sandberg) ```diff @@ Coverage Diff @@ ## master #517 +/- ## ========================================== + Coverage 68.86% 69.05% +0.19% ========================================== Files 26 26 Lines 3112 3112 Branches 526 526 ========================================== + Hits 2143 2149 +6 + Misses 831 825 -6 Partials 138 138 ``` [see 1 file with indirect coverage changes](https://app.codecov.io/gh/christiansandberg/canopen/pull/517/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Christian+Sandberg)
acolomb commented 3 months ago

Seems flaky... Maybe I shouldn't have written that no troubles are expected? It failed immediately when testing the merge commit on master.

@erlend-aasland could you please investigate?

erlend-aasland commented 3 months ago

Seems flaky... [..] could you please investigate?

Sure; I'll get to it in a day or two.

erlend-aasland commented 3 months ago

test_scanner_search assumes all packets arrive sequentially, however that does not seem to be guaranteed by python-can. There is no need to check the order of the packages; we only need to check that all of them are sent. I'll rewrite the test to drop the sequential aspect.