File tree Expand file tree Collapse file tree 2 files changed +29
-3
lines changed Expand file tree Collapse file tree 2 files changed +29
-3
lines changed Original file line number Diff line number Diff line change @@ -6,9 +6,7 @@ services:
66 image : ghcr.io/diamondlightsource/numtracker:1.0.1
77 ports :
88 - " 8406:8000"
9- post_start :
10- - command : /app/numtracker client configure adsim --directory '/tmp/' --scan '{instrument}-{scan_number}' --detector '{instrument}-{scan_number}-{detector}' --number 43
11-
9+
1210 rabbitmq :
1311 image : docker.io/rabbitmq:4.0-management
1412 ports :
Original file line number Diff line number Diff line change 1818from blueapi .client .rest import UnknownPlan
1919from blueapi .config import (
2020 ApplicationConfig ,
21+ ConfigLoader ,
2122 OIDCConfig ,
2223 StompConfig ,
2324)
@@ -155,6 +156,33 @@ def clean_existing_tasks(client: BlueapiClient):
155156 yield
156157
157158
159+ @pytest .fixture (scope = "module" )
160+ def server_config () -> ApplicationConfig :
161+ loader = ConfigLoader (ApplicationConfig )
162+ loader .use_values_from_yaml (Path ("tests" , "system_tests" , "config.yaml" ))
163+ return loader .load ()
164+
165+
166+ @pytest .fixture (autouse = True , scope = "module" )
167+ def reset_numtracker (server_config : ApplicationConfig ):
168+ nt_url = server_config .numtracker .url # type: ignore - if numtracker is None we should fail
169+ requests .post (
170+ str (nt_url ),
171+ json = {
172+ "query" : """mutation {
173+ configure(instrument: "adsim",
174+ config: {directory: "/tmp/",
175+ scan: "{instrument}-{scan_number}",
176+ detector: "{instrument}-{scan_number}-{detector}",
177+ scanNumber: 43}) {
178+ scanTemplate
179+ }
180+ }"""
181+ },
182+ ).raise_for_status ()
183+ yield
184+
185+
158186@pytest .mark .xfail (reason = _REQUIRES_AUTH_MESSAGE )
159187def test_cannot_access_endpoints (
160188 client_without_auth : BlueapiClient , blueapi_client_get_methods : list [str ]
You can’t perform that action at this time.
0 commit comments