Skip to content

Conversation

@LowriJenkins
Copy link
Contributor

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

  • Is the code of an acceptable quality?
  • Do the changes function as described and is it robust?
  • Have the changes been documented in the release notes?

Final Steps

  • Reviewer has moved the release notes entry for this ticket in the "Changes merged into master" section

Copy link
Member

@Tom-Willemsen Tom-Willemsen left a 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)
Copy link
Member

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.

Copy link
Member

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::...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants