Adjusted documentation
This commit is contained in:
20
README.md
20
README.md
@@ -18,10 +18,11 @@ The general architecture of the framework is as follows:
|
||||
sinqMotor-based MasterMACS driver https://gitea.psi.ch/lin-epics-modules/mastermacs
|
||||
Individual motors at the test instrument are then set up as subfolders of their
|
||||
respective driver type.
|
||||
- `common.py` contains classes representing the motors. They are used to initialize
|
||||
the individual motors within the `tests` directory.
|
||||
- `setup` contains classes representing the motors and the EPICS communication interface.
|
||||
The classes are used to initialize the individual motors within the `tests` directory.
|
||||
- `config.yaml` is the test configuration (see [Configuration](#configuration))
|
||||
- `maketestenv` can be used to create a Python virtual environment for running the tests.
|
||||
- `runtests` is a parallelizing `pytest` wrapper. See section for more information [Parallelizing tests over motors](#parallelizing-tests-over-motors).
|
||||
|
||||
## Configuration
|
||||
|
||||
@@ -36,7 +37,7 @@ identifier of the records created by the motor drivers.
|
||||
|
||||
It is recommended to start the IOC via `ioc/startioc`:
|
||||
|
||||
```console
|
||||
```bash
|
||||
ioc/startioc.py
|
||||
```
|
||||
|
||||
@@ -50,30 +51,29 @@ in turn imports `ioc/config.cmd` to get the current configuration.
|
||||
Running tests requires the following three steps:
|
||||
- Starting the IOC via `ioc/startioc.py` (see [Configuration](#starting-the-ioc))
|
||||
- Creating (if not done previously) and activating a suitable virtual environment:
|
||||
```console
|
||||
bash
|
||||
```bash
|
||||
./maketestenv
|
||||
source testenv/bin/activate
|
||||
```
|
||||
- Running the desired test(s) via pytest. For example:
|
||||
```console
|
||||
```bash
|
||||
pytest tests/sinqMotor/turboPmac/
|
||||
```
|
||||
This runs all Turbo PMAC tests within the directory.
|
||||
|
||||
To run a specific test file:
|
||||
```console
|
||||
```bash
|
||||
pytest tests/sinqMotor/turboPmac/lin1/test_common.py
|
||||
```
|
||||
|
||||
And to run a specific test "test_something" within this file:
|
||||
```console
|
||||
```bash
|
||||
pytest tests/sinqMotor/turboPmac/lin1/test_common.py -k 'test_something'
|
||||
```
|
||||
|
||||
Pytest normally suppresses stdout (which is where Pythons `print` writes by default).
|
||||
To show it, use the `-s` flag:
|
||||
```console
|
||||
```bash
|
||||
pytest -s tests/sinqMotor/turboPmac/lin1/test_common.py -k 'test_something'
|
||||
```
|
||||
|
||||
@@ -107,7 +107,7 @@ source testenv/bin/activate
|
||||
|
||||
### EPICS integration
|
||||
|
||||
The EPICS integration is currently done via caproto. This module is taken from NICOS (https://github.com/mlz-ictrl/nicos/blob/master/nicos/devices/epics/pva/caproto.py)
|
||||
The EPICS integration is currently done via `setup/caproto.py`. This module is taken from NICOS (https://github.com/mlz-ictrl/nicos/blob/master/nicos/devices/epics/pva/caproto.py)
|
||||
and has been slightly modified (mainly removal of NICOS-specific decorators and the conversion of the EPICS to the NICOS status). The docstring of the `setup.classes.Motor`
|
||||
class contains further information.
|
||||
|
||||
|
||||
2
runtests
2
runtests
@@ -65,7 +65,7 @@ except IocNotRunning:
|
||||
except IocNotRunning:
|
||||
pass
|
||||
check_ioc_running()
|
||||
print(f'Started IOC successfully (process ID {p.pid})! It will automatically terminate after all tests are done.')
|
||||
print(f'Started IOC successfully (process ID {p.pid}). It will automatically terminate after all tests are done.')
|
||||
|
||||
# Run each enabled folder's relevant tests in parallel
|
||||
processes = []
|
||||
|
||||
Reference in New Issue
Block a user