Conversation
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Multiple unresolved test correctness, reliability, collection, and Compose configuration issues remain.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 4
Open (5)
What changed in this PR
Adds an end-to-end smoke test for Relay, MWL, PACS, and upload services, with supporting Docker Compose defaults.
Changes:
- Adds Relay, C-FIND, C-STORE, and upload verification.
- Adds configurable gateway service environment variables.
| File | Review findings |
|---|---|
tests/smoke_test.py |
Moderate issues: invalid PACS storage API usage (4 votes), asynchronous upload race (2), unreliable host override (2), unresolved Docker storage path (1), unchecked Relay response (2), default pytest collection (1), and non-repeatable accession (1). Nit: import ordering (3). |
compose.yml |
Moderate issues: unsupported Linux host.docker.internal default (1 vote), unnecessary Relay secret exposure to PACS (1), and inconsistent configurable paths across services (1). |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
d6906ec to
e35d071
Compare
e35d071 to
02c122c
Compare
a636243 to
ec07761
Compare
ec07761 to
036596e
Compare
| COPY tests/smoke_test.py ./tests/smoke_test.py | ||
| COPY tests/integration/dicom_helpers.py ./tests/integration/dicom_helpers.py |
|
|
||
| load_dotenv() | ||
|
|
||
| if os.environ["ENVIRONMENT"] == "prod": |
| stored_image = storage.get_instance_by_accession(TEST_ACCESSION_NUMBER) | ||
| # We expect a FAILED upload as the smoke test action id won't match anything in Rubie | ||
| # or Rubie won't be available to receive the upload. | ||
| if stored_image["upload_status"] == "FAILED": | ||
| upload_attempted = True | ||
| break |
The smoke test can be run on the deployed gateway VM, machine or docker container.
036596e to
322a5c4
Compare
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Unresolved environment, dependency, execution-path, safety, timeout, and cleanup issues prevent reliable and safe smoke-test execution.
Review effort: Lite
Findings: 1
Open (6)
Case-sensitive production guard permits PROD · New Smoke test requires unset ENVIRONMENT variable · New Default MWL host incorrectly uses wildcard address · New Smoke timeout expires before uploader reaches FAILED state Missing ENVIRONMENT causes smoke module import failure Docker image omits pytest dependency
Resolved since last review (2)
|
|
||
| load_dotenv() | ||
|
|
||
| if os.environ["ENVIRONMENT"] == "prod": |
| - AZURE_RELAY_SHARED_ACCESS_KEY=${AZURE_RELAY_SHARED_ACCESS_KEY} | ||
| - CLOUD_API_ENDPOINT=${CLOUD_API_ENDPOINT:-http://host.docker.internal:8000/api/v1/dicom} | ||
| - CLOUD_API_TOKEN=${CLOUD_API_TOKEN:-testtoken} | ||
| - LOG_LEVEL=INFO |
|
|
||
| # 2. Connect to MWL and perform a C-FIND to retrieve the worklist item | ||
| def test_c_find_worklist_item(): | ||
| mwl_host = os.getenv("MWL_HOST", "0.0.0.0") |
| # We are connecting to a Relay Listener, so we need to use the "connect" action instead of "listen". | ||
| url = RelayURI().connection_url().replace("sb-hc-action=listen", "sb-hc-action=connect") | ||
| with connect(url, compression=None, open_timeout=30) as conn: | ||
| conn.send(json.dumps(payload)) |
There was a problem hiding this comment.
i don't think this will work on a deployed environment. the machine's managed identity won't have send permissions (presumably working locally because of SAS fallback). could grant hybrid connection-specific send permissions without causing major security issues? otherwise the start point for the smoke test would have to be C-FIND.
|
|
||
| load_dotenv() | ||
|
|
||
| if os.environ["ENVIRONMENT"] == "prod": |
There was a problem hiding this comment.
| if os.environ["ENVIRONMENT"] == "prod": | |
| if os.getenv("ENVIRONMENT", "").lower() == "prod": |
agree w copilot!
| "worklist_item": { | ||
| "participant": { | ||
| "nhs_number": TEST_PATIENT_ID, | ||
| "name": "SMITH^JANE", |
There was a problem hiding this comment.
shall we follow the "ZZTEST" pattern or at least something more obviously fake?



Description
A smoke test we can run against existing gateway services via an Azure connected machine run command:
Once #240 is merged the smoke test can also run in docker.
Jira link
https://nhsd-jira.digital.nhs.uk/browse/DTOSS-12894
Review notes
Review checklist