Skip to content

Commit

Permalink
Fix CI (#147)
Browse files Browse the repository at this point in the history
* fix ci

* fix cwd
  • Loading branch information
t-young31 authored Oct 12, 2023
1 parent ebb9b28 commit f808da2
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 45 deletions.
21 changes: 6 additions & 15 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ x-proxy-common: &proxy-common
no_proxy: *no-proxy

x-build-args-common: &build-args-common
<<: *proxy-common
<<: [*proxy-common]

x-pixl-common-env: &pixl-common-env
ENV: ${ENV}
Expand Down Expand Up @@ -80,8 +80,7 @@ services:
args:
<<: *build-args-common
environment:
<<: *proxy-common
<<: *pixl-common-env
<<: [*proxy-common, *pixl-common-env]
AZURE_CLIENT_ID: ${HASHER_API_AZ_CLIENT_ID}
AZURE_CLIENT_SECRET: ${HASHER_API_AZ_CLIENT_PASSWORD}
AZURE_TENANT_ID: ${HASHER_API_AZ_TENANT_ID}
Expand Down Expand Up @@ -110,6 +109,7 @@ services:
<<: *build-args-common
command: /run/secrets
environment:
<<: [*proxy-common, *pixl-common-env]
ORTHANC_NAME: "PIXL: Anon"
ORTHANC_USERNAME: ${ORTHANC_ANON_USERNAME}
ORTHANC_PASSWORD: ${ORTHANC_ANON_PASSWORD}
Expand All @@ -131,8 +131,6 @@ services:
AZ_DICOM_TOKEN_REFRESH_SECS: "600"
TIME_OFFSET: "${STUDY_TIME_OFFSET}"
SALT_VALUE: ${SALT_VALUE}"
<<: *proxy-common
<<: *pixl-common-env
ports:
- "${ORTHANC_ANON_DICOM_PORT}:4242"
- "${ORTHANC_ANON_WEB_PORT}:8042"
Expand Down Expand Up @@ -161,6 +159,7 @@ services:
<<: *build-args-common
command: /run/secrets
environment:
<<: [*pixl-db, *proxy-common, *pixl-common-env]
ORTHANC_NAME: "PIXL: Raw"
ORTHANC_USERNAME: ${ORTHANC_RAW_USERNAME}
ORTHANC_PASSWORD: ${ORTHANC_RAW_PASSWORD}
Expand All @@ -175,9 +174,6 @@ services:
ORTHANC_ANON_AE_TITLE: ${ORTHANC_ANON_AE_TITLE}
ORTHANC_ANON_DICOM_PORT: "4242"
ORTHANC_ANON_HOSTNAME: "orthanc-anon"
<<: *pixl-db
<<: *proxy-common
<<: *pixl-common-env
ports:
- "${ORTHANC_RAW_DICOM_PORT}:4242"
- "${ORTHANC_RAW_WEB_PORT}:8042"
Expand Down Expand Up @@ -227,11 +223,7 @@ services:
args:
<<: *build-args-common
environment:
<<: *pixl-db
<<: *emap-db
<<: *proxy-common
<<: *pixl-common-env
<<: *pixl-rabbit-mq
<<: [*pixl-db, *emap-db, *proxy-common, *pixl-common-env, *pixl-rabbit-mq]
AZURE_CLIENT_ID: ${PIXL_EHR_API_AZ_CLIENT_ID}
AZURE_CLIENT_SECRET: ${PIXL_EHR_API_AZ_CLIENT_SECRET}
AZURE_TENANT_ID: ${PIXL_EHR_API_AZ_TENANT_ID}
Expand Down Expand Up @@ -273,8 +265,7 @@ services:
networks:
- pixl-net
environment:
<<: *pixl-rabbit-mq
<<: *proxy-common
<<: [*pixl-rabbit-mq, *proxy-common]
ORTHANC_RAW_USERNAME: ${ORTHANC_RAW_USERNAME}
ORTHANC_RAW_PASSWORD: ${ORTHANC_RAW_PASSWORD}
ORTHANC_RAW_AE_TITLE: ${ORTHANC_RAW_AE_TITLE}
Expand Down
12 changes: 6 additions & 6 deletions hasher/src/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
azure-identity==1.12.0
azure-keyvault==4.2.0
black==22.8.0
fastapi==0.85.2
fastapi==0.103.2
flake8==5.0.4
flake8-return==1.1.3
hypothesis==6.56.0
isort==5.10.1
environs==9.5.0
ipython==8.5.0
mypy==0.991
pytest==7.1.3
mypy==1.6.0
httpx==0.25.0
pytest==7.4.2
pytest-mock==3.8.2
requests==2.28.1
uvicorn==0.19.0
requests==2.31.0
uvicorn==0.23.2
2 changes: 1 addition & 1 deletion patient_queue/src/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ flake8==5.0.4
flake8-return==1.1.3
isort==5.10.1
environs==9.5.0
mypy==0.991
mypy==1.6.0
pytest==7.1.3
pytest-asyncio==0.20.2
python-decouple==3.6
4 changes: 3 additions & 1 deletion pixl_ehr/src/pixl_ehr/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ async def update_tb_refresh_rate(item: TokenRefreshUpdate) -> str:


@app.get(
"/token-bucket-refresh-rate", summary="Get the refresh rate in items per second"
"/token-bucket-refresh-rate",
summary="Get the refresh rate in items per second",
response_model=TokenRefreshUpdate,
)
async def get_tb_refresh_rate() -> BaseModel:
return TokenRefreshUpdate(rate=state.token_bucket.rate)
Expand Down
9 changes: 2 additions & 7 deletions pixl_ehr/src/pixl_ehr/tests/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,10 @@
"""
from fastapi.testclient import TestClient
from pixl_ehr.main import AppState, app, state
from requests import Response

client = TestClient(app)


def _is_error(response: Response) -> bool:
return bool(400 <= int(response.status_code) < 450)


def test_heartbeat_response_is_200() -> None:
response = client.get("/heart-beat")
assert response.status_code == 200
Expand All @@ -37,13 +32,13 @@ def test_initial_state_has_no_token() -> None:
def test_updating_the_token_refresh_rate_to_negative_fails() -> None:

response = client.post("/token-bucket-refresh-rate", json={"rate": -1})
assert _is_error(response)
assert response.is_error


def test_updating_the_token_refresh_rate_to_string_fails() -> None:

response = client.post("/token-bucket-refresh-rate", json={"rate": "a string"})
assert _is_error(response)
assert response.is_error


def test_updating_the_token_refresh_rate_updates_state() -> None:
Expand Down
18 changes: 9 additions & 9 deletions pixl_ehr/src/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
black==22.8.0
fastapi==0.103.2
flake8==5.0.4
flake8-return==1.1.3
hypothesis==6.56.0
isort==5.10.1
environs==9.5.0
mypy==0.991
pytest==7.1.3
click==8.1.3
coloredlogs==15.0.1
fastapi==0.85.2
pydantic==1.9.2
uvicorn==0.19.0
requests==2.28.1
types-requests==2.28.*
mypy==1.6.0
httpx==0.25.0
pytest==7.4.2
requests==2.31.0
uvicorn==0.23.2
pydantic==1.10.13
types-requests==2.31.0
psycopg2-binary==2.9.5
azure-identity==1.12.0
azure-storage-blob==12.14.1
Expand Down
3 changes: 2 additions & 1 deletion pixl_pacs/src/pixl_pacs/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ async def update_tb_refresh_rate(item: TokenRefreshUpdate) -> str:


@app.get(
"/token-bucket-refresh-rate", summary="Get the refresh rate in items per second"
"/token-bucket-refresh-rate", summary="Get the refresh rate in items per second",
response_model=TokenRefreshUpdate,
)
async def get_tb_refresh_rate() -> BaseModel:
return TokenRefreshUpdate(rate=state.token_bucket.rate)
4 changes: 2 additions & 2 deletions pixl_rd/src/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ flake8==5.0.4
flake8-return==1.1.3
isort==5.10.1
environs==9.5.0
mypy==0.991
pytest==7.1.3
mypy==1.6.0
pytest==7.4.2
presidio-analyzer==2.2.29
presidio-anonymizer==2.2.29
python-decouple==3.6
3 changes: 2 additions & 1 deletion test/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ services:
context: ..
dockerfile: test/Dockerfile.fake_emap_star
args:
N_TABLE_ROWS: 1
N_TABLE_ROWS: 2
INFORMDB_PAT: ${INFORMDB_PAT}
environment:
POSTGRES_USER: ${EMAP_UDS_USER}
POSTGRES_PASSWORD: ${EMAP_UDS_PASSWORD}
Expand Down
4 changes: 2 additions & 2 deletions token_buffer/src/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ black==22.8.0
flake8==5.0.4
flake8-return==1.1.3
isort==5.10.1
mypy==0.991
pytest==7.1.3
mypy==1.6.0
pytest==7.4.2
token-bucket==0.3.0
python-decouple==3.6

0 comments on commit f808da2

Please sign in to comment.