Skip to content

Commit 5c22a2e

Browse files
authored
Merge branch 'master' into VED-307-Future-Dates
2 parents 4446d87 + 48fd36d commit 5c22a2e

33 files changed

+453
-836
lines changed

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ updates:
6060
- "/recordprocessor"
6161
- "/lambdas/redis_sync"
6262
- "/lambdas/id_sync"
63+
- "/lambdas/mns_subscription"
6364
- "/lambdas/shared"
64-
- "/mns_subscription"
6565
schedule:
6666
interval: "daily"
6767
open-pull-requests-limit: 1

.github/workflows/sonarcloud.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -123,16 +123,16 @@ jobs:
123123
poetry run coverage xml -o ../mesh_processor-coverage.xml
124124
125125
- name: Run unittest with coverage-mns-subscription
126-
working-directory: mns_subscription
127-
env:
128-
PYTHONPATH: ${{ github.workspace }}/mns_subscription/src:${{ github.workspace }}/mns_subscription/tests
126+
working-directory: lambdas/mns_subscription
129127
id: mns_subscription
128+
env:
129+
PYTHONPATH: ${{ env.LAMBDA_PATH }}/mns_subscription/src:${{ env.SHARED_PATH }}/src
130130
continue-on-error: true
131131
run: |
132132
poetry install
133-
poetry run coverage run -m unittest discover || echo "mns_subscription tests failed" >> ../failed_tests.txt
133+
poetry run coverage run -m unittest discover || echo "mns_subscription tests failed" >> ../../failed_tests.txt
134134
poetry run coverage report -m
135-
poetry run coverage xml -o ../mns_subscription-coverage.xml
135+
poetry run coverage xml -o ../../mns_subscription-coverage.xml
136136
137137
- name: Run unittest with redis_sync
138138
working-directory: lambdas/redis_sync
@@ -141,9 +141,9 @@ jobs:
141141
PYTHONPATH: ${{ env.LAMBDA_PATH }}/redis_sync/src:${{ env.SHARED_PATH }}/src
142142
continue-on-error: true
143143
run: |
144-
poetry install
145-
poetry run coverage run --source=src -m unittest discover || echo "redis_sync tests failed" >> ../../failed_tests.txt
146-
poetry run coverage xml -o ../../redis_sync-coverage.xml
144+
poetry install
145+
poetry run coverage run --source=src -m unittest discover || echo "redis_sync tests failed" >> ../../failed_tests.txt
146+
poetry run coverage xml -o ../../redis_sync-coverage.xml
147147
148148
- name: Run unittest with shared
149149
working-directory: lambdas/shared
@@ -152,9 +152,9 @@ jobs:
152152
PYTHONPATH: ${{ env.SHARED_PATH }}/src
153153
continue-on-error: true
154154
run: |
155-
poetry install
156-
poetry run coverage run --rcfile=.coveragerc --source=src -m unittest discover -s tests -p "test_*.py" -v || echo "shared tests failed" >> ../../failed_tests.txt
157-
poetry run coverage xml -o ../../shared-coverage.xml
155+
poetry install
156+
poetry run coverage run --rcfile=.coveragerc --source=src -m unittest discover -s tests -p "test_*.py" -v || echo "shared tests failed" >> ../../failed_tests.txt
157+
poetry run coverage xml -o ../../shared-coverage.xml
158158
159159
- name: Run unittest with id_sync
160160
working-directory: lambdas/id_sync
@@ -163,9 +163,9 @@ jobs:
163163
PYTHONPATH: ${{ env.LAMBDA_PATH }}/id_sync/src:${{ env.SHARED_PATH }}/src
164164
continue-on-error: true
165165
run: |
166-
poetry install
167-
poetry run coverage run --rcfile=.coveragerc --source=src -m unittest discover || echo "id_sync tests failed" >> ../../failed_tests.txt
168-
poetry run coverage xml -o ../../id_sync-coverage.xml
166+
poetry install
167+
poetry run coverage run --rcfile=.coveragerc --source=src -m unittest discover || echo "id_sync tests failed" >> ../../failed_tests.txt
168+
poetry run coverage xml -o ../../id_sync-coverage.xml
169169
170170
- name: Run Test Failure Summary
171171
id: check_failure

Makefile

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

3-
PYTHON_PROJECT_DIRS_WITH_UNIT_TESTS = ack_backend backend batch_processor_filter delta_backend filenameprocessor mesh_processor recordprocessor lambdas/redis_sync lambdas/id_sync lambdas/shared mns_subscription
3+
PYTHON_PROJECT_DIRS_WITH_UNIT_TESTS = ack_backend backend batch_processor_filter delta_backend filenameprocessor mesh_processor recordprocessor lambdas/redis_sync lambdas/id_sync lambdas/mns_subscription lambdas/shared
44
PYTHON_PROJECT_DIRS = e2e e2e_batch $(PYTHON_PROJECT_DIRS_WITH_UNIT_TESTS)
55

66
#Installs dependencies using poetry.

immunisation-fhir-api.code-workspace

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@
3131
"path": "lambdas/redis_sync"
3232
},
3333
{
34-
"path": "mns_subscription"
34+
"path": "lambdas/id_sync"
3535
},
3636
{
37-
"path": "lambdas/id_sync"
37+
"path": "lambdas/mns_subscription"
3838
},
3939
{
4040
"path": "lambdas/shared"
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"python.analysis.extraPaths": [
3+
"./src"
4+
],
5+
"python.testing.unittestArgs": [
6+
"-v",
7+
"-s",
8+
"./",
9+
"-p",
10+
"test_*.py"
11+
],
12+
"python.testing.pytestEnabled": false,
13+
"python.testing.unittestEnabled": true,
14+
"pylint.args": [
15+
"--init-hook",
16+
"import sys; sys.path.append('./src')"
17+
],
18+
"[makefile]": {
19+
"editor.insertSpaces": false,
20+
"editor.detectIndentation": false
21+
},
22+
"files.trimTrailingWhitespace": true,
23+
"[python]": {
24+
"files.trimTrailingWhitespace": true
25+
},
26+
"files.insertFinalNewline": true
27+
}

lambdas/mns_subscription/Makefile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
RUN_ENV := @PYTHONPATH=src:../shared/src
2+
3+
subscribe:
4+
$(RUN_ENV) poetry run python src/subscribe_mns.py
5+
6+
unsubscribe:
7+
$(RUN_ENV) poetry run python src/unsubscribe_mns.py
8+
9+
TEST_ENV := @PYTHONPATH=src:tests:../shared/src
10+
11+
test:
12+
$(TEST_ENV) python -m unittest
13+
14+
coverage-run:
15+
$(TEST_ENV) coverage run -m unittest discover
16+
17+
coverage-report:
18+
$(TEST_ENV) coverage report -m
19+
20+
coverage-html:
21+
$(TEST_ENV) coverage html
22+
23+
.PHONY: build package test

0 commit comments

Comments
 (0)