Skip to content

Commit e94cff8

Browse files
committed
Merge branch 'VED-81-Number-Update' into VED-480-Number-Update-terraform
2 parents b978130 + 207e3b5 commit e94cff8

File tree

72 files changed

+3627
-2475
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+3627
-2475
lines changed

.github/workflows/sonarcloud.yml

Lines changed: 4 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,11 @@ jobs:
2222
fetch-depth: 0
2323

2424
- name: Install poetry
25-
run: pip install poetry==1.8.4
25+
run: pip install poetry==2.1.2
2626

2727
- uses: actions/setup-python@v5
2828
with:
29-
python-version: |
30-
3.10
31-
3.11
29+
python-version: 3.11
3230
cache: 'poetry'
3331
- name: Debug shared folder
3432
run: |
@@ -49,7 +47,6 @@ jobs:
4947
id: filenameprocessor
5048
continue-on-error: true
5149
run: |
52-
poetry env use 3.11
5350
poetry install
5451
poetry run coverage run -m unittest discover || echo "filenameprocessor tests failed" >> ../failed_tests.txt
5552
poetry run coverage xml -o ../filenameprocessor-coverage.xml
@@ -59,7 +56,6 @@ jobs:
5956
id: recordprocessor
6057
continue-on-error: true
6158
run: |
62-
poetry env use 3.11
6359
poetry install
6460
poetry run coverage run -m unittest discover || echo "recordprocessor tests failed" >> ../failed_tests.txt
6561
poetry run coverage xml -o ../recordprocessor-coverage.xml
@@ -72,7 +68,6 @@ jobs:
7268
PYTHONPATH: ${{ github.workspace }}/backend/src:${{ github.workspace }}/backend/tests
7369
continue-on-error: true
7470
run: |
75-
poetry env use 3.11
7671
poetry install
7772
poetry run coverage run -m unittest discover -s "./tests" -p "*batch*.py" || echo "recordforwarder tests failed" >> ../failed_tests.txt
7873
poetry run coverage xml -o ../recordforwarder-coverage.xml
@@ -82,7 +77,6 @@ jobs:
8277
id: acklambda
8378
continue-on-error: true
8479
run: |
85-
poetry env use 3.10
8680
poetry install
8781
poetry run coverage run -m unittest discover || echo "ack-lambda tests failed" >> ../failed_tests.txt
8882
poetry run coverage xml -o ../ack-lambda-coverage.xml
@@ -94,10 +88,10 @@ jobs:
9488
PYTHONPATH: delta_backend/src:delta_backend/tests
9589
continue-on-error: true
9690
run: |
97-
poetry env use 3.11
9891
poetry install
9992
poetry run coverage run -m unittest discover || echo "delta tests failed" >> ../failed_tests.txt
10093
poetry run coverage xml -o ../delta-coverage.xml
94+
cat ../delta-coverage.xml
10195
10296
- name: Run unittest with coverage-fhir-api
10397
working-directory: backend
@@ -106,7 +100,6 @@ jobs:
106100
id: fhirapi
107101
continue-on-error: true
108102
run: |
109-
poetry env use 3.11
110103
poetry install
111104
poetry run coverage run -m unittest discover || echo "fhir-api tests failed" >> ../failed_tests.txt
112105
poetry run coverage xml -o ../backend-coverage.xml
@@ -116,7 +109,6 @@ jobs:
116109
id: meshprocessor
117110
continue-on-error: true
118111
run: |
119-
poetry env use 3.10
120112
poetry install
121113
poetry run coverage run -m unittest discover || echo "mesh_processor tests failed" >> ../failed_tests.txt
122114
poetry run coverage xml -o ../mesh_processor-coverage.xml
@@ -128,7 +120,6 @@ jobs:
128120
PYTHONPATH: ${{ github.workspace }}/redis_sync/src:${{ github.workspace }}/redis_sync/tests
129121
continue-on-error: true
130122
run: |
131-
poetry env use 3.11
132123
poetry install
133124
poetry run coverage run -m unittest discover || echo "redis_sync tests failed" >> ../failed_tests.txt
134125
poetry run coverage xml -o ../redis_sync-coverage.xml
@@ -140,18 +131,10 @@ jobs:
140131
PYTHONPATH: ${{ env.SHARED_PATH }}
141132
continue-on-error: true
142133
run: |
143-
echo "shared coverage - Current directory: $(pwd)"
144134
poetry env use 3.11
145135
poetry install
146-
poetry run coverage run -m unittest discover || echo "shared tests failed" >> ../../failed_tests.txt
136+
poetry run coverage run --source=src -m unittest discover -s tests -p "test_*.py" -v || echo "shared tests failed" >> ../../failed_tests.txt
147137
poetry run coverage xml -o ../../shared-coverage.xml
148-
ls ../../shared-coverage.xml
149-
# show director of ../.. as absolute path
150-
echo "Parent directory of shared-coverage.xml: $(pwd)/../../"
151-
#check files created
152-
if [ ! -f ../../shared-coverage.xml ]; then
153-
echo "shared-coverage.xml not found"
154-
fi
155138
156139
- name: Run unittest with id_sync
157140
working-directory: lambdas/id_sync
@@ -160,22 +143,14 @@ jobs:
160143
PYTHONPATH: ${{ env.LAMBDA_PATH }}/id_sync/src:${{ env.LAMBDA_PATH }}/id_sync/tests:${{ env.SHARED_PATH }}
161144
continue-on-error: true
162145
run: |
163-
echo "id_sync coverage - Current directory: $(pwd)"
164146
poetry env use 3.11
165147
poetry install
166148
poetry run coverage run -m unittest discover || echo "id_sync tests failed" >> ../../failed_tests.txt
167149
poetry run coverage xml -o ../../id_sync-coverage.xml
168-
#check files created
169-
if [ ! -f ../../id_sync-coverage.xml ]; then
170-
echo "id_sync-coverage.xml not found, exiting with error"
171-
fi
172150
173151
- name: Run Test Failure Summary
174152
id: check_failure
175153
run: |
176-
echo "Checking for test failures..."
177-
ls *-coverage.xml
178-
cat shared-coverage.xml || echo "shared-coverage.xml not found"
179154
if [ -s failed_tests.txt ]; then
180155
echo "The following tests failed:"
181156
cat failed_tests.txt

.gitignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,4 @@ openapi.json
2929
!**/.vscode/settings.json.default
3030

3131
devtools/volume/
32-
backend/tests/.coverage
33-
redis_sync/.vscode/settings.json.default
34-
lambdas/shared/.coverage
32+
**/.coverage

.tool-versions

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
poetry 2.1.2
2+
nodejs 23.11.0
3+
python 3.11.12

Makefile

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
SHELL=/usr/bin/env bash -euo pipefail
22

3+
PYTHON_PROJECT_DIRS_WITH_UNIT_TESTS = ack_backend backend delta_backend filenameprocessor mesh_processor recordprocessor redis_sync
4+
PYTHON_PROJECT_DIRS = e2e e2e_batch $(PYTHON_PROJECT_DIRS_WITH_UNIT_TESTS)
5+
36
#Installs dependencies using poetry.
47
install-python:
58
poetry lock --no-update
@@ -38,7 +41,7 @@ build-proxy:
3841
scripts/build_proxy.sh
3942

4043
#Files to loop over in release
41-
_dist_include="pytest.ini poetry.lock poetry.toml pyproject.toml Makefile build/. e2e e2e_batch specification sandbox terraform scripts backend delta_backend ack_backend filenameprocessor recordprocessor mesh_processor redis_sync lambdas/id_sync"
44+
_dist_include="pytest.ini poetry.lock poetry.toml pyproject.toml Makefile build/. specification sandbox terraform scripts $(PYTHON_PROJECT_DIRS)"
4245

4346

4447
#Create /dist/ sub-directory and copy files into directory
@@ -85,3 +88,39 @@ test-prod:
8588

8689
setup-python-envs:
8790
scripts/setup-python-envs.sh
91+
92+
initialise-all-python-venvs:
93+
for dir in $(PYTHON_PROJECT_DIRS); do ( \
94+
cd $$dir && \
95+
pwd && \
96+
rm -rf .venv && \
97+
python -m venv .venv && \
98+
source .venv/bin/activate && \
99+
poetry install --no-root && \
100+
deactivate \
101+
); done
102+
103+
update-all-python-dependencies:
104+
for dir in $(PYTHON_PROJECT_DIRS); do ( \
105+
cd $$dir && \
106+
pwd && \
107+
source .venv/bin/activate && \
108+
poetry update && \
109+
deactivate \
110+
); done
111+
112+
run-all-python-unit-tests:
113+
for dir in $(PYTHON_PROJECT_DIRS_WITH_UNIT_TESTS); do ( \
114+
cd $$dir && \
115+
pwd && \
116+
source .venv/bin/activate && \
117+
poetry run make test && \
118+
deactivate \
119+
); done
120+
121+
build-all-docker-images:
122+
for dir in $(PYTHON_PROJECT_DIRS_WITH_UNIT_TESTS); do \
123+
for dockerfile in $$(ls $$dir/*Dockerfile); do \
124+
echo $$dockerfile && docker build --file $$dockerfile $$dir; \
125+
done; \
126+
done

ack_backend/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
FROM public.ecr.aws/lambda/python:3.10 AS base
1+
FROM public.ecr.aws/lambda/python:3.11 AS base
22

33
RUN mkdir -p /home/appuser && \
44
echo 'appuser:x:1001:1001::/home/appuser:/sbin/nologin' >> /etc/passwd && \
55
echo 'appuser:x:1001:' >> /etc/group && \
6-
chown -R 1001:1001 /home/appuser && pip install "poetry~=1.5.0"
7-
6+
chown -R 1001:1001 /home/appuser && pip install "poetry~=2.1.2"
7+
88
COPY poetry.lock pyproject.toml README.md ./
99
RUN poetry config virtualenvs.create false && poetry install --no-interaction --no-ansi --no-root --only main
1010
# -----------------------------

0 commit comments

Comments
 (0)