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

Basic CAN Transport Interface for python-can #229

Merged
merged 44 commits into from
Oct 23, 2023

Conversation

mdabrowski1990
Copy link
Owner

Description

#22

  • adjusted API of Transport Interfaces (changed methods exposed for sending and receiving packets)
  • provided basic implementation for python-can - CAN packets can be send and receiving using both synchronous and asynchronous implemtnation
  • created system tests for python-can Transport Interface (hardware supported by python-can package is required to perform them)

How Has This Been Tested?

  • 100% coverage with unit tests
  • integration tests
  • system tests with real hardware for key functions (send and receive packet)

Process

I know the process and did my best to follow it

mdabrowski1990 and others added 29 commits February 6, 2022 10:03
Adjust Transport Interface API to asynchronous/synchronous implementation.
Add notes what has to be done by each method.
just a few minor changes
Add performance tests for transmission queue.
…interface

# Conflicts:
#	uds/transport_interface/transmission_queue.py
Notifier + Listener example :D
Simplify the task and get rid of unnecessary implementation.
Rework Transport Interface API according to current needs.
Temporary version
minor upgrade for static code analysis
save changes
Rework abstract classes and get rid of LGTM errors suppression (no longer in use).
Change dictionaries used by addressing information classes to always contain every attribute - to make it compatible and easily replaced by other addressing information types.
Adjust code and tests for CanSegmenter class.
Move to pytest>=7.0.0
Implemented sync send_packet method in transport_interface, but that causes problems with async_implementation (both Async and Sync Queue don't like each other).
I need to either switch to only async methods or find a way to have both queues types.
…ving packets

- examples
- remade Abstract Transport Interface
- raw code with TODOs for python-can Transport Interface
Make n_ar and n_as measurements
Add tests for python-can transport interface with Kvaser.
- add timeout tests (sort of performance test on receive_packet method)
- update CI file so only software tests are automatically executed (no system tests in cloud testing)
add system tests for transport interface + figure out notifiers problem
Figured out that timeout tests causes problems, still trying to figure out the root cause.
Update system tests.
TODO: refactor code and add some test.

Seems like we have got it and soon task would be clsoed.
Final version of system tests:
- testing scope cover
- procedures provided
Adjust python-can transport interface implementation to pass all test cases (both software and system).
Add unit tests to reach 100% branch coverage.
@mdabrowski1990 mdabrowski1990 added the implementation Changes to code label Oct 19, 2023
@mdabrowski1990 mdabrowski1990 added the CAN Related to CAN specific implementation label Oct 19, 2023
@mdabrowski1990 mdabrowski1990 self-assigned this Oct 19, 2023
@codecov
Copy link

codecov bot commented Oct 19, 2023

Codecov Report

Merging #229 (3d5c6c7) into main (c79d1d3) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##              main      #229   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           42        39    -3     
  Lines         2493      2434   -59     
=========================================
- Hits          2493      2434   -59     
Flag Coverage Δ
integration-tests 88.66% <71.29%> (+2.82%) ⬆️
unit-tests 100.00% <100.00%> (ø)

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

Files Coverage Δ
uds/can/__init__.py 100.00% <100.00%> (ø)
uds/can/abstract_addressing_information.py 100.00% <100.00%> (ø)
uds/can/addressing_information.py 100.00% <100.00%> (ø)
uds/can/extended_addressing_information.py 100.00% <100.00%> (ø)
uds/can/mixed_addressing_information.py 100.00% <100.00%> (ø)
uds/can/normal_addressing_information.py 100.00% <100.00%> (ø)
uds/message/nrc.py 100.00% <ø> (ø)
uds/message/service_identifiers.py 100.00% <100.00%> (ø)
uds/packet/__init__.py 100.00% <100.00%> (ø)
uds/packet/can_packet.py 100.00% <100.00%> (ø)
... and 7 more

@mdabrowski1990 mdabrowski1990 linked an issue Oct 19, 2023 that may be closed by this pull request
@mdabrowski1990 mdabrowski1990 changed the title Python can transport interface Basic CAN Transport Interface for python-can Oct 19, 2023
minor formatting adjustment for consitency reasons
Update actions
Fix a few things during self-reviewing the code
Copy link
Owner Author

@mdabrowski1990 mdabrowski1990 left a comment

Choose a reason for hiding this comment

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

Seems fine for me ;)

@mdabrowski1990 mdabrowski1990 merged commit 2a9597b into main Oct 23, 2023
46 checks passed
@mdabrowski1990 mdabrowski1990 deleted the python-can-transport-interface branch October 23, 2023 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CAN Related to CAN specific implementation implementation Changes to code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Introduce basic Transport Interface for python-can
2 participants