Skip to content

Commit a7678f8

Browse files
committed
Merge branch 'master' into VED-358-github-actions-for-int
2 parents a67977d + 432a894 commit a7678f8

File tree

118 files changed

+3692
-2797
lines changed

Some content is hidden

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

118 files changed

+3692
-2797
lines changed

.github/workflows/sonarcloud.yml

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,11 @@ jobs:
1818
fetch-depth: 0
1919

2020
- name: Install poetry
21-
run: pip install poetry==1.8.4
21+
run: pip install poetry==2.1.2
2222

2323
- uses: actions/setup-python@v5
2424
with:
25-
python-version: |
26-
3.10
27-
3.11
25+
python-version: 3.11
2826
cache: 'poetry'
2927

3028
- name: Set up AWS credentials
@@ -40,7 +38,6 @@ jobs:
4038
id: filenameprocessor
4139
continue-on-error: true
4240
run: |
43-
poetry env use 3.11
4441
poetry install
4542
poetry run coverage run -m unittest discover || echo "filenameprocessor tests failed" >> ../failed_tests.txt
4643
poetry run coverage xml -o ../filenameprocessor-coverage.xml
@@ -50,7 +47,6 @@ jobs:
5047
id: recordprocessor
5148
continue-on-error: true
5249
run: |
53-
poetry env use 3.11
5450
poetry install
5551
poetry run coverage run -m unittest discover || echo "recordprocessor tests failed" >> ../failed_tests.txt
5652
poetry run coverage xml -o ../recordprocessor-coverage.xml
@@ -63,7 +59,6 @@ jobs:
6359
PYTHONPATH: ${{ github.workspace }}/backend/src:${{ github.workspace }}/backend/tests
6460
continue-on-error: true
6561
run: |
66-
poetry env use 3.11
6762
poetry install
6863
poetry run coverage run -m unittest discover -s "./tests" -p "*batch*.py" || echo "recordforwarder tests failed" >> ../failed_tests.txt
6964
poetry run coverage xml -o ../recordforwarder-coverage.xml
@@ -73,7 +68,6 @@ jobs:
7368
id: acklambda
7469
continue-on-error: true
7570
run: |
76-
poetry env use 3.10
7771
poetry install
7872
poetry run coverage run -m unittest discover || echo "ack-lambda tests failed" >> ../failed_tests.txt
7973
poetry run coverage xml -o ../ack-lambda-coverage.xml
@@ -85,7 +79,6 @@ jobs:
8579
PYTHONPATH: delta_backend/src:delta_backend/tests
8680
continue-on-error: true
8781
run: |
88-
poetry env use 3.11
8982
poetry install
9083
poetry run coverage run -m unittest discover || echo "delta tests failed" >> ../failed_tests.txt
9184
poetry run coverage xml -o ../delta-coverage.xml
@@ -97,7 +90,6 @@ jobs:
9790
id: fhirapi
9891
continue-on-error: true
9992
run: |
100-
poetry env use 3.11
10193
poetry install
10294
poetry run coverage run -m unittest discover || echo "fhir-api tests failed" >> ../failed_tests.txt
10395
poetry run coverage xml -o ../backend-coverage.xml
@@ -107,7 +99,6 @@ jobs:
10799
id: meshprocessor
108100
continue-on-error: true
109101
run: |
110-
poetry env use 3.10
111102
poetry install
112103
poetry run coverage run -m unittest discover || echo "mesh_processor tests failed" >> ../failed_tests.txt
113104
poetry run coverage xml -o ../mesh_processor-coverage.xml
@@ -119,7 +110,6 @@ jobs:
119110
PYTHONPATH: ${{ github.workspace }}/redis_sync/src:${{ github.workspace }}/redis_sync/tests
120111
continue-on-error: true
121112
run: |
122-
poetry env use 3.11
123113
poetry install
124114
poetry run coverage run -m unittest discover || echo "redis_sync tests failed" >> ../failed_tests.txt
125115
poetry run coverage xml -o ../redis_sync-coverage.xml

.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"
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)