Skip to content

Commit 9be20b6

Browse files
Merge pull request #25 from NHSDigital/mm-apm-1926-immunisation-history-enhancements
Mm apm 1926 immunisation history enhancements
2 parents c647091 + a9793fd commit 9be20b6

39 files changed

+19657
-709
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,6 @@ newman/
1111
__pycache__/
1212
.envrc
1313
.idea/
14-
.venv/
14+
.venv/
15+
16+
smoketest-report.xml

Makefile

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
SHELL=/bin/bash -euo pipefail
22

3-
install: install-node install-python install-hooks
4-
53
install-python:
64
poetry install
75

86
install-node:
97
npm install
108
cd sandbox && npm install
119

12-
install-hooks:
10+
.git/hooks/pre-commit:
1311
cp scripts/pre-commit .git/hooks/pre-commit
1412

13+
install: install-node install-python .git/hooks/pre-commit
14+
1515
lint:
1616
npm run lint
17-
find . -name '*.py' | xargs poetry run flake8
17+
find . -name '*.py' -not -path '**/.venv/*' | xargs poetry run flake8
1818

1919
clean:
2020
rm -rf build
@@ -40,13 +40,19 @@ start-sandbox:
4040
build-proxy:
4141
scripts/build_proxy.sh
4242

43+
_dist_include="pytest.ini poetry.lock poetry.toml pyproject.toml Makefile build/. tests"
44+
4345
release: clean publish build-proxy
4446
mkdir -p dist
45-
cp -r build/. dist
46-
cp -r tests dist
47+
for f in $(_dist_include); do cp -r $$f dist; done
4748
cp ecs-proxies-deploy.yml dist/ecs-deploy-sandbox.yml
4849
cp ecs-proxies-deploy.yml dist/ecs-deploy-internal-qa-sandbox.yml
4950
cp ecs-proxies-deploy.yml dist/ecs-deploy-internal-dev-sandbox.yml
5051

5152
test:
52-
poetry run pytest -v
53+
# this target should be used for local unit tests .. runs as part of the build pipeline
54+
make --no-print-directory -C sandbox test
55+
56+
smoketest:
57+
# this target is for end to end smoketests this would be run 'post deploy' to verify an environment is working
58+
poetry run pytest -v --junitxml=smoketest-report.xml -s -m smoketest

azure/azure-pr-pipeline.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ extends:
3939
- environment: internal-dev
4040
make_spec_visible: true
4141
post_deploy:
42-
- template: ./templates/run-ping-tests.yml
42+
- template: ./templates/run-smoke-tests.yml
4343
- environment: internal-dev-sandbox
4444
proxy_path: sandbox
4545
post_deploy:
46-
- template: ./templates/run-ping-tests.yml
46+
- template: ./templates/run-smoke-tests.yml

azure/azure-release-pipeline.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,27 +37,27 @@ extends:
3737
- environment: internal-dev
3838
make_spec_visible: true # Off by default. Turn on to allow expose API developers can subscribe their Apps to
3939
post_deploy:
40-
- template: ./templates/run-ping-tests.yml
40+
- template: ./templates/run-smoke-tests.yml
4141
- environment: internal-qa
4242
make_spec_visible: true
4343
post_deploy:
44-
- template: ./templates/run-ping-tests.yml
44+
- template: ./templates/run-smoke-tests.yml
4545
- environment: internal-qa-sandbox
4646
proxy_path: sandbox
4747
make_spec_visible: true
4848
post_deploy:
49-
- template: ./templates/run-ping-tests.yml
49+
- template: ./templates/run-smoke-tests.yml
5050
# make_spec_visible is false for sandbox environment
5151
# (App subscription make sense for most sandbox implementations)
5252
- environment: sandbox
5353
proxy_path: sandbox
5454
post_deploy:
55-
- template: ./templates/run-ping-tests.yml
55+
- template: ./templates/run-smoke-tests.yml
5656
# Enable int environment when ready by uncommenting:
5757
# - environment: int
5858
# make_spec_visible: true
5959
# depends_on:
6060
# - internal_qa
6161
# - internal_qa_sandbox
6262
# post_deploy:
63-
# - template: ./templates/run-ping-tests.yml
63+
# - template: ./templates/run-smoke-tests.yml
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,23 @@
11
steps:
2-
- bash: poetry install
3-
workingDirectory: $(Pipeline.Workspace)/s/$(SERVICE_NAME)/$(SERVICE_ARTIFACT_NAME)/tests
2+
- bash: |
3+
make install-python
4+
workingDirectory: $(Pipeline.Workspace)/s/$(SERVICE_NAME)/$(SERVICE_ARTIFACT_NAME)
45
displayName: Setup pytests
56
67
- bash: |
8+
export RELEASE_RELEASEID=$(Build.BuildId)
9+
export SOURCE_COMMIT_ID=$(Build.SourceVersion)
710
export APIGEE_ENVIRONMENT="$(ENVIRONMENT)"
811
export SERVICE_BASE_PATH="$(SERVICE_BASE_PATH)"
12+
export STATUS_ENDPOINT_API_KEY="$(status-endpoint-api-key)"
913
10-
poetry run pytest -v --junitxml=test-report.xml -m ping
11-
workingDirectory: $(Pipeline.Workspace)/s/$(SERVICE_NAME)/$(SERVICE_ARTIFACT_NAME)/tests
12-
displayName: run ping pytests
14+
make smoketest
15+
workingDirectory: $(Pipeline.Workspace)/s/$(SERVICE_NAME)/$(SERVICE_ARTIFACT_NAME)
16+
displayName: run smoketests
1317
1418
- task: PublishTestResults@2
15-
displayName: 'Publish ping pytest results'
19+
displayName: 'Publish smoketest results'
1620
condition: always()
1721
inputs:
18-
testResultsFiles: '$(Pipeline.Workspace)/s/$(SERVICE_NAME)/$(SERVICE_ARTIFACT_NAME)/tests/test-report.xml'
22+
testResultsFiles: '$(Pipeline.Workspace)/s/$(SERVICE_NAME)/$(SERVICE_ARTIFACT_NAME)/smoketest-report.xml'
1923
failTaskOnFailedTests: true

ecs-proxies-deploy.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
docker_service:
22
- name: sandbox
33
expose: true
4+
environment:
5+
- name: NODE_ENV
6+
value: production
7+
- name: LOG_LEVEL
8+
value: "{{ 'debug' if APIGEE_ENVIRONMENT == 'internal-dev' else 'info' }}"
9+
- name: VERSION_INFO
10+
value: "{{ version_info | to_json }}"
411
health_check:
512
matcher: "200"
6-
path: "/_status"
13+
path: "/_ping"

0 commit comments

Comments
 (0)