ISISComputingGroup / ISISComputingGroup/IBEX

System Test to Test for Single Eurotherm: Test all Ten Channels for a Single Eurotherm

Open
#7,055 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
6
Forks
2
Avg merge
16h 40m
Merged PRs (30d)
2

Description

## Where?
_Where is the issue likely to be (be as specific as possible e.g. filepaths)_
- [EPICS-IOC_Test_Framework](https://github.com/ISISComputingGroup/EPICS-IOC_Test_Framework) `EPICS-IOC_Test_Framework\tests\eurotherm.py`
- [WIKI](https://github.com/ISISComputingGroup/IBEX/wiki/Eurotherms)
- [Eurotherm IOC](https://github.com/ISISComputingGroup/EPICS-ioc/tree/master/EUROTHRM)

## How?
_How did the issue come about/known cause of issue if any?
Currently only one channel is tested for the Eurotherm IOC. Ideally, although all channels should have the same behaviour and an assumption "could" be made that a system test for one channel passing means the same test will pass for all channels, we should test all channels for absolute certainty. The only means of doing this currently is to manually change the address in `EPICS-IOC_Test_Framework\tests\eurotherm.py` and run all tests. The process to do this is described in the `README.md` in the [Eurotherm IOC repository](https://github.com/ISISComputingGroup/EPICS-ioc/tree/master/EUROTHRM).

This issue's purpose is to create a system test which checks all channels are accessible. Below is an basic example of a system test which could be extended upon to enable this. Please note that the below example does not work as the macro for the address is not correctly reset or initialised to allow for all addresses to pass.

```python
@parameterized.expand([("1", 1), ("2", 2), , ("3", 3), , ("4", 4), , ("5", 5), , ("6", 6), , ("7", 7), ("8", 8), ("9", 9), ("10", 10)])
def test_given_sp_WHEN_sp_read_rbv_temperature_for_given_channel_THEN_rbv_is_same_as_sp_on_channel_(self, _, channel_int):
with self._ioc.start_with_macros({
"ADDR_1": "", # reset ADDR_1 to empty str
f"ADDR": f"A0{channel_int}",
f"ADDR_{channel_int}": 1
}, pv_to_wait_for=f"A0{channel_int}:CURRENT_TEMP"):
expected_temperature = 10.0
self.ca.assert_setting_setpoint_sets_readback(expected_temperature, "SP:RBV", "SP")
```

If following the above example for a system test using `self._ioc.start_with_macros()` when working on this issue, you will also need to add an ioc launcher class which uses the `ProcServLauncher` to the IOC variable:

```python
IOCS = [
{
"name": DEVICE,
"directory": get_default_ioc_dir("EUROTHRM"),
"ioc_launcher_class": ProcServLauncher, # Needed for using `self._ioc.start_with_macros()` in system tests
"macros": {
"ADDR": ADDRESS,
"ADDR_1": ADDR_1,
"ADDR_2": "",
"ADDR_3": "",
"ADDR_4": "",
"ADDR_5": "",
"ADDR_6": "",
"ADDR_7": "",
"ADDR_8": "",
"ADDR_9": "",
"ADDR_10": ""
},
"emulator": EMULATOR_DEVICE,
},
]
```

## Acceptance criteria
- [ ] A system test exists to test all channels for a single eurotherm to ensure all channels can be communicated with.
- [ ] README.md in the [Eurotherm IOC repository](https://github.com/ISISComputingGroup/EPICS-ioc/tree/master/EUROTHRM) has been updated where necessary to reflect changes.
- [ ] The [wiki page](https://github.com/ISISComputingGroup/IBEX/wiki/Eurotherms) has been updated where necessary to reflect changes.

## How to Test
_verbose instructions for reviewer to test changes
(**Add before making a PR**)_
- From an EPICS terminal, run the eurotherm system test and ensure that all 10 channels are tested.
- Ensure the test is well written and checks that a pv is accessible from all channels.
- Check that any additional documentation such as the README.md in the [Eurotherm IOC repo](https://github.com/ISISComputingGroup/EPICS-ioc/tree/master/EUROTHRM) and the [wiki pages](https://github.com/ISISComputingGroup/IBEX/wiki/Eurotherms) have been updated where necessary.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.