Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion azure/azure-pr-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ extends:
- environment: internal-dev
make_spec_visible: true
post_deploy:
- template: ./templates/run-smoke-tests.yml
# - template: ./templates/run-smoke-tests.yml
- template: ./templates/run-integration-tests.yml
parameters:
service_name: ${{ variables.service_name }}
# - environment: internal-dev-sandbox
# proxy_path: sandbox
# post_deploy:
Expand Down
31 changes: 31 additions & 0 deletions azure/templates/run-integration-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
parameters:
- name: service_name
type: string

steps:
- bash: |
pip install virtualenv
virtualenv test_env
source ./test_env/bin/activate
pip install -r requirements.txt
workingDirectory: $(Pipeline.Workspace)/s/${{ parameters.service_name }}/$(SERVICE_ARTIFACT_NAME)/tests
displayName: Setup integration tests

- bash: |
source ./test_env/bin/activate
export OAUTH_BASE_URI="https://$(APIGEE_ENVIRONMENT).api.service.nhs.uk"
export OAUTH_PROXY="oauth2"
export SERVICE_NAME="$(FULLY_QUALIFIED_SERVICE_NAME)"
export ID_TOKEN_PRIVATE_KEY_ABSOLUTE_PATH="$(Pipeline.Workspace)/secrets/$(ID_TOKEN_TESTING_PRIVATE_KEY)"
export JWT_PRIVATE_KEY_ABSOLUTE_PATH="$(Pipeline.Workspace)/secrets/$(JWT_TESTING_PRIVATE_KEY)"
export APIGEE_API_TOKEN="$(secret.AccessToken)"
pytest --reruns 5 --reruns-delay 1 -v --junitxml=test-report.xml
workingDirectory: $(Pipeline.Workspace)/s/${{ parameters.service_name }}/$(SERVICE_ARTIFACT_NAME)/tests
displayName: Run integration tests

- task: PublishTestResults@2
displayName: 'Publish integration test results'
condition: always()
inputs:
testResultsFiles: '$(Pipeline.Workspace)/s/${{ parameters.service_name }}/$(SERVICE_ARTIFACT_NAME)/tests/test-report.xml'
failTaskOnFailedTests: true
89 changes: 80 additions & 9 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<FlowCallout async="false" continueOnError="false" enabled="true" name="FlowCallout.UserRoleService">
<DisplayName>FlowCallout.UserRoleService</DisplayName>
<FaultRules/>
<Properties/>
<SharedFlowBundle>UserRoleService</SharedFlowBundle>
</FlowCallout>
12 changes: 10 additions & 2 deletions proxies/live/apiproxy/proxies/default.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
<ProxyEndpoint name="default">
<Flows>
<Flow name="UserRoleService">
<Request>
<Step>
<Name>FlowCallout.UserRoleService</Name>
</Step>
</Request>
<Condition>proxy.pathsuffix MatchesPath "/user-role-service"</Condition>
</Flow>
<Flow name="OptionsPreFlight">
<Request/>
<Response>
Expand Down Expand Up @@ -62,9 +70,9 @@
<RouteRule name="shared-flow-testing-target">
<TargetEndpoint>shared-flow-testing-target</TargetEndpoint>
</RouteRule>
<DefaultFaultRule>
<!-- <DefaultFaultRule>
<Step>
<Name>AssignMessage.Errors.CatchAllMessage</Name>
</Step>
</DefaultFaultRule>
</DefaultFaultRule> -->
</ProxyEndpoint>
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ keywords = ["healthcare", "uk", "nhs"] #TODO add additional keywords

[tool.poetry.dependencies]
python = "^3.8"
requests = "^2.25.1"
assertpy = "^1.1"

[tool.poetry.dev-dependencies]
flake8 = "^3.7.9"
Expand All @@ -32,6 +34,6 @@ pytest = "^6.1.2"
coverage = "^5.5"
aiohttp = "^3.7.3"
pytest-asyncio = "^0.14.0"
api-test-utils = {url = "https://github.com/NHSDigital/apim-test-utils/releases/download/v1.0.92-alpha/api_test_utils-1.0.92a0-py3-none-any.whl"}
api-test-utils = {url = "https://github.com/NHSDigital/apim-test-utils/releases/download/v1.1.2-alpha/api_test_utils-1.1.2a0-py3-none-any.whl"}

[tool.poetry.scripts]
Loading