-
Couldn't load subscription status.
- Fork 0
Add system tests for default handling + ruff + pyright #135
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
base: master
Are you sure you want to change the base?
Add system tests for default handling + ruff + pyright #135
Conversation
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.
The tests are failing for me with errors like:
======================================================================
ERROR [91.215s]: test_WHEN_ioc_has_macros_THEN_defaults_handled_correctly_0___No_Vals_All_Default_True_True_True_ (test_blockserver.TestBlockserver.test_WHEN_ioc_has_macros_THEN_defaults_handled_correctly_0___No_Vals_All_Default_True_True_True_)
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\Instrument\Apps\Python3\Lib\site-packages\parameterized\parameterized.py", line 620, in standalone_func
return func(*(a + p.args), **p.kwargs, **kw)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "c:\Instrument\dev\system_tests\test_blockserver.py", line 479, in test_WHEN_ioc_has_macros_THEN_defaults_handled_correctly
macros_in_config = utilities.get_config_details()["iocs"][0]["macros"]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^
IndexError: list index out of range
======================================================================
ERROR [91.151s]: test_WHEN_ioc_has_macros_THEN_defaults_handled_correctly_1___No_Vals_No_Default_False_False_False_ (test_blockserver.TestBlockserver.test_WHEN_ioc_has_macros_THEN_defaults_handled_correctly_1___No_Vals_No_Default_False_False_False_)
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\Instrument\Apps\Python3\Lib\site-packages\parameterized\parameterized.py", line 620, in standalone_func
return func(*(a + p.args), **p.kwargs, **kw)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "c:\Instrument\dev\system_tests\test_blockserver.py", line 479, in test_WHEN_ioc_has_macros_THEN_defaults_handled_correctly
macros_in_config = utilities.get_config_details()["iocs"][0]["macros"]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^
IndexError: list index out of range
(this is after correcting the g.set_instrument from "" to None). Blockserver contains a few of these:
MAJOR: Odd-length string
which implies we're sending it the config in the wrong format (str instead of bytes?)
|
|
||
| def setUp(self) -> None: | ||
| g.set_instrument(None, import_instrument_init=False) | ||
| g.set_instrument("", import_instrument_init=False) |
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.
Is this right?
https://github.com/ISISComputingGroup/genie/blob/19cdfeedaf5ec9107f0328a69204b621858c859a/src/genie_python/genie_epics_api.py#L141 allows None (and checks against it...)
I think set_instrument might be type-hinted incorrectly.
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 also looked to just break the tests for me as it looked for a PV prefix of TE::...
Description of work
Add system test for the new macro default handling. Also ran ruff+pyright
Ticket
ISISComputingGroup/IBEX#8445
Acceptance criteria
System test passes and correctly tests default handling
Unit tests
Give an overview of unit tests you have added or modified, if applicable. The aim is provide information to help the reviewer
System tests
Mention any automated tests or manual tests that you have added or modified, if applicable. The aim is provide information to help the reviewer
Documentation
Highlight and provide a link to any additions or changes to the documentation, if applicable. The aim is provide information to help the reviewer
Code Review
Final Steps