File tree Expand file tree Collapse file tree 3 files changed +51
-4
lines changed
Expand file tree Collapse file tree 3 files changed +51
-4
lines changed Original file line number Diff line number Diff line change 5757 run : |
5858 python .github/scripts/check_test_durations.py unit-report.json 1
5959
60+ - name : Checkout simulated devices
61+ uses : actions/checkout@v4
62+ with :
63+ repository : epics-containers/example-services
64+ path : example-services
65+
66+ - name : Run docker compose
67+ uses : hoverkraft-tech/compose-action@v2.2.0
68+ with :
69+ compose-file : " ./example-services/compose.yaml"
70+ services : |
71+ bl01t-di-cam-01
72+ bl01t-mo-sim-01
73+ ca-gateway
74+
6075 - name : Run system tests
6176 run : tox -e system-report
6277
Original file line number Diff line number Diff line change @@ -157,8 +157,8 @@ commands =
157157 type-checking: pyright src tests {posargs}
158158 pre-commit: pre-commit run --all-files --show-diff-on-failure {posargs}
159159 docs: sphinx-{posargs:build -E} -T docs build/html
160- unit-report: pytest -m 'not requires' - -cov=dodal --cov-report term --cov-report xml:unit_cov.xml --json-report --json-report-file=unit-report.json tests {posargs}
161- system-report: pytest -m 'not requires or requires(external="internet ")' --cov=dodal --cov-report term --cov-report xml:system_cov.xml --json-report --json-report-file=system-report.json system_tests {posargs}
160+ unit-report: pytest --cov=dodal --cov-report term --cov-report xml:unit_cov.xml --json-report --json-report-file=unit-report.json tests {posargs}
161+ system-report: pytest -m 'not requires(instrument="i04 ")' --cov=dodal --cov-report term --cov-report xml:system_cov.xml --json-report --json-report-file=system-report.json system_tests {posargs}
162162"""
163163
164164[tool .ruff ]
Original file line number Diff line number Diff line change 1+ import os
12from collections .abc import Generator
23from typing import cast
4+ from unittest .mock import patch
35
46import pytest
57from bluesky .run_engine import RunEngine
2022from dodal .devices .adsim import SimStage
2123from dodal .plans import count
2224
25+ """
26+ System tests that can be run against the containerised IOCs from epics-containers:
27+ https://github.com/epics-containers/example-services
28+
29+ Check out that repository and using docker or podman deploy the services in the compose
30+ file:
31+
32+ ```sh
33+ docker compose up -d
34+ ```
35+
36+ Run these system tests, with your EPICS environment configured to talk to the gateways:
37+ ```sh
38+ python -m pytest -m 'requires(instrument="adsim")'
39+ ```
40+
41+ """
42+
43+
44+ @pytest .fixture (scope = "module" , autouse = True )
45+ def with_env ():
46+ with patch .dict (
47+ os .environ ,
48+ {
49+ "EPICS_CA_NAME_SERVERS" : "127.0.0.1:5094" ,
50+ "EPICS_PVA_NAME_SERVERS" : "127.0.0.1:5095" ,
51+ "EPICS_CA_ADDR_LIST" : "127.0.0.1:5094" ,
52+ },
53+ clear = True ,
54+ ):
55+ yield
56+
2357
2458@pytest .fixture
2559def det (RE ) -> Generator [StandardDetector ]:
@@ -126,8 +160,6 @@ def test_plan_produces_expected_resources(
126160 assert resource .get ("mimetype" ) == "application/x-hdf5"
127161 assert resource .get ("parameters" ) == {
128162 "dataset" : "/entry/data/data" ,
129- "swmr" : False ,
130- "multiplier" : 1 ,
131163 "chunk_shape" : (1 , 1024 , 1024 ),
132164 }
133165
You can’t perform that action at this time.
0 commit comments