Repository navigation
Description
Feature: dt4acc integration tests for the EPICS twin on the FODO lattice
Description, motivation and use case
The dt4acc integration workflow only exercises the Tango twin today. It starts the dt4acc-soleil-twin image with tango-db-embedded, then runs tests/integration/test_dt4acc_twin_smoke.py against the FODO 1 GeV 6D lattice with the tango-pyaml and pyaml-cs-oa (Tango) backends. EPICS support in pyAML (through pyaml-cs-oa) has no end-to-end coverage against a running control system.
The same image now ships an EPICS twin (epics-embedded / epics-twin commands, no database to bootstrap), and pyaml-test-lattice 0.4.0 provides matching FODO fixtures:
dt4acc/fodo_1gev_6d_dt4acc_epics.json: generic EPICS catalog for the twin (32 quadrupoles, 32 sextupoles, 32 steerers)pyaml/epics/pyaml-cs-oa/fodo_1gev_6d_pyaml-epics.yaml: pyAML configuration usingpyaml_cs_oa.dynamic_catalogwithbackend: Epics(quadrupoles, sextupoles, CFM correctors, BPMs, RF plant, tune monitor)
Use case: catch regressions in pyAML or pyaml-cs-oa that break EPICS live access, the same way the Tango smoke tests do.
Proposed solution
- Twin startup: extend
tests/integration/start_dt4acc_twin.shwith an EPICS mode (epics-embedded,--accelerator-setup-file,--lattice-file,--prefix). Readiness is theEPICS IOC ready: prefix=...log line instead of the Tango calculation heartbeat. - Tests: add
tests/integration/test_dt4acc_epics_twin_smoke.py, loadingfodo_1gev_6d_pyaml-epics.yamlwith the lattice override already used for Tango, and checking that:- the accelerator instantiates and
liveis available - QF_001 strength and the RF frequency read back finite and positive
- every declared magnet and CFM strength reads back finite
- BPM positions read back finite
- the accelerator instantiates and
- Workflow: add an
epicsjob to.github/workflows/dt4acc-integration.yml, reusing the image pull and installingophyd-async[ca, pva]. - Dependencies: raise
pyaml-test-latticeto>=0.4.0in thetestextra, since the EPICS fixtures do not exist before.
Points to settle during implementation:
- PV prefix: the twin defaults to
DT4ACC_PREFIX, then the current user name, while the pyAML EPICS configuration declares no prefix. Either start the twin with an explicit empty prefix, or set a fixed prefix on both sides (twin--prefixandprefixof thepyaml_cs_oacontrol system). - Channel Access discovery on the runner: check whether
EPICS_CA_ADDR_LIST=127.0.0.1/EPICS_CA_AUTO_ADDR_LIST=NO(and the PVA equivalents) are needed.
Describe alternatives you've considered
- Parametrize the existing
test_dt4acc_twin_smoke.pyby control system instead of adding a file. It avoids duplicating helpers, but the Tango tests read Tango device names directly (AN01-AR/EM-QP/QF.01/magnetic_strength), so most tests would need per-backend branches. - Run the Tango and EPICS twins in the same job. It saves one image pull, but doubles startup time and memory on a single runner, and a failure in one twin would hide the other result. Separate jobs are preferred.
Example
FODO_1GEV_6D_EPICS_CONFIG_KEY = "pyaml/epics/pyaml-cs-oa/fodo_1gev_6d_pyaml-epics.yaml"
def test_dt4acc_epics_twin_reads_all_declared_magnetic_strengths():
accelerator = _build_accelerator(FODO_1GEV_6D_EPICS_CONFIG_KEY)
magnets = accelerator.live.magnets.get()
for magnet in magnets:
assert np.isfinite(float(magnet.strength.get()))bash tests/integration/start_dt4acc_twin.sh --mode epics \
--accelerator-setup-file "$ACCEL_SETUP_FILE" \
--lattice-file "$LATTICE_FILE" \
--prefix "" \
--sif dt4acc-soleil-twin.sif --detachAdditional context
- The tests are marked
@pytest.mark.integrationand skipped unlessPYAML_DT4ACC_INTEGRATION=1, like the Tango ones. - Locally, the Tango twin started all 83 servers at once and saturated its embedded database on an 8 GB WSL machine.
DT4ACC_TANGO_START_BATCH_SIZE=10avoided it. The EPICS twin has no database, so it should not hit this.
Checklist
- I've assigned this issue to a project
- I've @-mentioned relevant people
Activity