-
Notifications
You must be signed in to change notification settings - Fork 231
multiple: add _run function, use _run in _run_check for the mixin #237
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #237 +/- ##
========================================
+ Coverage 54.8% 54.9% +<.1%
========================================
Files 106 106
Lines 6267 6273 +6
========================================
+ Hits 3440 3447 +7
+ Misses 2827 2826 -1
Continue to review full report at Codecov.
|
2a60252 to
4bc771d
Compare
4bc771d to
e568fa0
Compare
| def run(self, cmd: str, *, step, timeout: int = 30): | ||
| return run(cmd, step=step, timeout=timeout) | ||
|
|
||
| @step(args=['cmd']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Steps on internal methods aren't really useful.
labgrid/driver/sshdriver.py
Outdated
| def run(self, cmd, codec="utf-8", decodeerrors="strict"): | ||
| return _run(cmd, codec=codec, decodererrors=decodeerrors) | ||
|
|
||
| @step(args=['cmd']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here as well.
|
Added a commit which removes the step decorators from _run functions. FWIW: there are more cases where we have step decorators on internal functions, but thats something for another PR. Edit: rebased on master |
e1c7233 to
c28fc9e
Compare
c28fc9e to
5675257
Compare
|
I updated this branch and fixed the conflicts. |
Commit 1deea1c introduced a bug where the internal _run_check function used the run function guarded by a check_active decorator. Use _run for the run_check function, refactor _run functions for drivers who did not have it and adjust the tests to mock the correct funtion. Fixes #230 Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de> Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
The _run functions are called through public functions which have a step decorator and just pass the arguments. Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de> Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
5675257 to
a3b02fd
Compare
|
I've reworked the patches a bit (fix infinite recursion, move steps instead of deleting) and added tests for run() in addition to run_check(). |
|
I just found the need to add |
|
@kjeldflarup Would having a run_bytes() which worked with bytes instead of strings help you? Then you could handle the decoding youself. |
|
@jluebbe We already have codecs on run. I just got the nice idea to use run_check as much as possible. |
|
I'd like to understand your usecase better: |
_run() methods are not called with step and step is not used anyway, so remove it. This fixes errors like: TypeError: _run() missing 1 required keyword-only argument: 'step' Issue introduced by PR labgrid-project#237. Signed-off-by: Bastian Stender <bst@pengutronix.de>
_run() methods are not called with step and step is not used anyway, so remove it. This fixes errors like: TypeError: _run() missing 1 required keyword-only argument: 'step' Issue introduced by PR #237. Signed-off-by: Bastian Stender <bst@pengutronix.de>
|
We had the issue before: #203, perhaps reopen. |
Commit 1deea1c introduced a bug where the
internal _run_check function used the run function guarded by a check_active
decorator. Use _run for the run_check function, refactor _run functions for
drivers who did not have it and adjust the tests to mock the correct funtion.
Fixes #230
Signed-off-by: Rouven Czerwinski r.czerwinski@pengutronix.de