-
Notifications
You must be signed in to change notification settings - Fork 15
Adds flags for ACU checking to hwp supervisor, along with tests #802
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
461566b to
0498c71
Compare
for more information, see https://pre-commit.ci
08854be to
cd0d427
Compare
d2ebe65 to
143e679
Compare
55a273f to
bce28e8
Compare
7feffe5 to
44196c0
Compare
aa77700 to
e355b34
Compare
363ea46 to
7aa2fcc
Compare
6837f47 to
100d412
Compare
1742336 to
85db2c5
Compare
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
|
@BrianJKoopman Ended up getting the tests to work properly! Turns out I missed a shutdown call for one of the device_emulators in the hwp emulator. Adding that makes tests clean up correctly, so I reverted the misc changes I made to test the github workflow. This contains the same update to the HWP supervisor as #805, so if you'd rather just review and merge this one we can close the other one. Thanks! |
BrianJKoopman
left a comment
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.
This is great, awesome to see all the tests come together for the supervisor agent. Mostly small documentation related comments. The SIGKILL workaround for getting the tests to run does mean code coverage doesn't get reported, which is unfortunate. It's makes it a bit challenging to understand what really gets tested.
and unblock parser from trying to grab data when acq is stopped
for more information, see https://pre-commit.ci
dc18f65 to
ffcf552
Compare
for more information, see https://pre-commit.ci
|
Hey Brian, this is now passing tests, having fixed issues with shutting down some agents with SIGINT, and is ready for another review. Thanks! |
BrianJKoopman
left a comment
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.
Thanks, this fixes the issue with SIGKILL in the supervisor tests, but the problem still remains in the PID agent tests when I run locally. Coverage goes from 0% to 95% on the agent if I change the SIGKILL on this line to a SIGINT:
| runner.proc.send_signal(signal.SIGKILL) |
Tests results running locally with that line sending SIGKILL vs sending SIGINT:
$ python3 -m pytest --cov --cov-report term integration/test_hwp_pid_agent_integration.py
================================================================ test session starts ================================================================
platform linux -- Python 3.11.9, pytest-8.3.3, pluggy-1.5.0
rootdir: /home/koopman/git/socs/tests
configfile: pytest.ini
plugins: order-1.3.0, dependency-0.6.0, cov-6.0.0, docker-3.1.1, twisted-1.14.3, anyio-4.4.0
collected 8 items
integration/test_hwp_pid_agent_integration.py ........ [100%]
---------- coverage: platform linux, python 3.11.9-final-0 -----------
Name Stmts Miss Cover
----------------------------------------------------------------------------------------------------
/home/koopman/git/socs/socs/agents/hwp_pid/agent.py 210 210 0%
/home/koopman/git/socs/socs/agents/hwp_pid/drivers/pid_controller.py 267 219 18%
$ python3 -m pytest --cov --cov-report term integration/test_hwp_pid_agent_integration.py
================================================================ test session starts ================================================================
platform linux -- Python 3.11.9, pytest-8.3.3, pluggy-1.5.0
rootdir: /home/koopman/git/socs/tests
configfile: pytest.ini
plugins: order-1.3.0, dependency-0.6.0, cov-6.0.0, docker-3.1.1, twisted-1.14.3, anyio-4.4.0
collected 8 items
integration/test_hwp_pid_agent_integration.py ........ [100%]
---------- coverage: platform linux, python 3.11.9-final-0 -----------
Name Stmts Miss Cover
----------------------------------------------------------------------------------------------------
/home/koopman/git/socs/socs/agents/hwp_pid/agent.py 210 11 95%
/home/koopman/git/socs/socs/agents/hwp_pid/drivers/pid_controller.py 267 69 74%
Is this SIGKILL required in the CI? Tests run fine on my system without it. Or is there a similar solution that would remove the need to send SIGKILL in those tests?
Also, please address or comment on the other comments I made in the last review.
for more information, see https://pre-commit.ci
|
Right, thanks for the reminder. I went through and addressed your previous comments, if you want to take another look! |
BrianJKoopman
left a comment
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.
Looks great, thanks for working through all the difficulties with the tests!
Description
Motivation and Context
This adds gripper-state monitoring to the HWP
monitorprocess, and adds the following flags to the HWP state which can be checked by the ACU:gripper_statewhich can be "cold", "warm", "ungripped", or "unknown"is_spinningbooleanHow Has This Been Tested?
Along with these changes, I am building out the HWP emulator into a set of integration tests that test the behavior of these flags and other operations.
This has been tested with HWP and ACU hardware on satp1.
Types of changes
Checklist: