-
Notifications
You must be signed in to change notification settings - Fork 1
[GPCAPIM-397] Set up INT test provider requests #193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
davidhamill1-nhs
wants to merge
101
commits into
main
Choose a base branch
from
feature/GPCAPIM-397-set-up-int-test-provider-requests
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 91 commits
Commits
Show all changes
101 commits
Select commit
Hold shift + click to select a range
6b0f825
Move towards using URL-based env var names.
davidhamill1-nhs a4675a8
Resolve this TODO later.
davidhamill1-nhs 0202c90
Broaden vocabulary.
davidhamill1-nhs 8d2f8a1
Log the client details.
davidhamill1-nhs dea2c64
Use env vars and pass those through an .env file in the make deploy c…
davidhamill1-nhs 4204308
Make number go up.
davidhamill1-nhs 899ba50
Make number go up.
davidhamill1-nhs 4f47fa9
Make number go up.
davidhamill1-nhs d80e86e
Make explicit environment variables being passed to container.
davidhamill1-nhs 67ef071
Make mypy happy again.
davidhamill1-nhs b289500
Place env vars in to app config.
davidhamill1-nhs 69a2929
Pass URLs to controller.
davidhamill1-nhs 5268215
Remove default URLs
davidhamill1-nhs 3cdecdb
Tidy up.
davidhamill1-nhs ba67227
Improve make commands to build up env files for different environments.
davidhamill1-nhs c54bb04
Merge remote-tracking branch 'origin' into debt/GPCAPIM-359-sort-out-…
davidhamill1-nhs 5b41732
FLASK env vars are not actually variable. Leave them hardcoded.
davidhamill1-nhs a2866c5
Enable test environment to be set up easily.
davidhamill1-nhs a0a47d3
Define shell.
davidhamill1-nhs e6e1c14
Inject env correctly and safely.
davidhamill1-nhs 78663fa
Remove duplicate/unused make commands.
davidhamill1-nhs 15528f8
Add simple logging to clients to demonstrate URLs being used.
davidhamill1-nhs 629c53c
Remove unused pipeline env var.
davidhamill1-nhs 405a7af
Merge remote-tracking branch 'origin' into debt/GPCAPIM-359-sort-out-…
davidhamill1-nhs 71cf237
Don't need to do some TODOs
davidhamill1-nhs 0c29fb2
Resolve some TODOs
davidhamill1-nhs 3dd80ff
Handle unit test enviroment variables better.
davidhamill1-nhs c82811f
Simplify local vs remote paths.
davidhamill1-nhs 247881f
Always overwrite.
davidhamill1-nhs d850d0e
Update docs. Improve env-ci output.
davidhamill1-nhs c3d633f
Tidy up.
davidhamill1-nhs 2aafbee
Place the test user in to the env variables.
davidhamill1-nhs 928d629
Tidy up.
davidhamill1-nhs 9290a0a
Merge remote-tracking branch 'origin' into debt/GPCAPIM-359-sort-out-…
davidhamill1-nhs 04092fd
Make linter happy.
davidhamill1-nhs 0b7e583
More tightly define type.
davidhamill1-nhs bda2bb6
Doesn't seem to 'omit'
davidhamill1-nhs 55a234b
Resolved to do.
davidhamill1-nhs bab15e1
Place make env file eariler in commands to run.
davidhamill1-nhs cff2eff
Update creation of .env.test. steps.
davidhamill1-nhs 5fc19a2
Add an orangebox environment that would reflect env-organebox behaviour.
davidhamill1-nhs 4082b47
Correctly print out logs.
davidhamill1-nhs f9be003
Make orange box test patient FHIR compliant.
davidhamill1-nhs 5ded7c5
Update FHIR Parameters resource to include required name field.
davidhamill1-nhs 03aff72
Add explicit return statements.
davidhamill1-nhs 80bedaf
Add a default case for the test user - none. It should only be needed…
davidhamill1-nhs 762b10b
Add local secret handling for int
davidhamill1-nhs f9f1319
Removing noise from "make deploy" output
davidhamill1-nhs 5c99f53
Only log pertinent, non-sensitive env vars.
davidhamill1-nhs dd2c50b
Do not log sensitive headers.
davidhamill1-nhs b5445c5
clean up.
davidhamill1-nhs 519efda
Remove env vars that did not exist before fiddling with the env vars.
davidhamill1-nhs 057a4c4
Options not supported at this level.
davidhamill1-nhs 548c49d
Do not log sensitive headers.
davidhamill1-nhs 158f4c0
Stub for int environment, until 397 is worked.
davidhamill1-nhs c22c719
Provide useful error messages if env files do not exist.
davidhamill1-nhs 9d39d0e
Merge remote-tracking branch 'origin' into debt/GPCAPIM-359-sort-out-…
davidhamill1-nhs d043161
Provide explanation around the expected secrets.
davidhamill1-nhs 7a4fc64
Correct env file check.
davidhamill1-nhs f84e63e
Refine logger setup; test url that instantiates the client is being u…
davidhamill1-nhs 5d2266e
Rename class to better reflect behaviour.
davidhamill1-nhs 3775cb5
Test url that instantiates the controller is being used on the GET re…
davidhamill1-nhs c98e561
Remove unused fixture.
davidhamill1-nhs 8c5c2fe
Provider a more helpful warning.
davidhamill1-nhs 1212296
Explain what this decorator is doing.
davidhamill1-nhs b02ac58
Update fixture name.
davidhamill1-nhs 71ea523
Remove toggling of sandbox/int services
davidhamill1-nhs 4032bbc
Merge branch 'debt/GPCAPIM-359-sort-out-env-vars' into feature/GPCAPI…
davidhamill1-nhs f04a489
Remove toggling of sandbox/int services
davidhamill1-nhs 99c4328
Merge branch 'debt/GPCAPIM-359-sort-out-env-vars' into feature/GPCAPI…
davidhamill1-nhs 1901406
As of pytest 4, ini_options is no longer needed.
davidhamill1-nhs 2c563f1
Merge remote-tracking branch 'origin' into feature/GPCAPIM-397-set-up…
davidhamill1-nhs 7c5494d
Remove redundant only file in redundant folder.
davidhamill1-nhs fbfa9e1
Need to find a way to trust the CA for EMIS INT's certs.
davidhamill1-nhs d46ae9e
Enable easy test config for int.
davidhamill1-nhs 23379f8
Seed EMIS INT patient into stub, to allow for testing while INT PDS A…
davidhamill1-nhs 1372326
Update env make commands to allow for testing INT.
davidhamill1-nhs 4f8706c
Update vocab.
davidhamill1-nhs 96434d3
Handle additional kwargs that can be passed in a requests.post method.
davidhamill1-nhs 2f54b36
Reduce friction in adding new endpoints to the stub.
davidhamill1-nhs ae1e161
Add body to provider response logging, in order to understand/confirm…
davidhamill1-nhs 2ef3bd1
Provide value that are valid for INT environment requests - full end-…
davidhamill1-nhs b5a274a
Make it easier to build INT env file.
davidhamill1-nhs 361c6e2
Update docs.
davidhamill1-nhs e905a71
Remove duplicated make command.
davidhamill1-nhs 655a1eb
For the moment, run int tests against a locally deployed app.
davidhamill1-nhs 1d249a4
Tidy up test helpers.
davidhamill1-nhs a030982
Use ODS code that has a valid looking ASID in the SDS stub.
davidhamill1-nhs 89a5821
Improve layout.
davidhamill1-nhs efb7a1b
Fixture no longer exists - remove docs for it.
davidhamill1-nhs 7f7c693
Add explanation on testing locally deployed app pointing at INT.
davidhamill1-nhs e2b3eca
Merge remote-tracking branch 'origin' into feature/GPCAPIM-397-set-up…
davidhamill1-nhs 7b0a15a
Certs will be handled by the HSCN proxy. For now, disable cert verifi…
davidhamill1-nhs b6ac22b
Give the test patient the ODS code that wil lead to the EMIS endpoint…
davidhamill1-nhs d060c2f
Remove unreference test data file.
davidhamill1-nhs 39d9338
Ensure there is a consumer-system ODS code available for testing agai…
davidhamill1-nhs fe92f5e
Improve loading expected responses.
davidhamill1-nhs 6003175
INT env already merged from Ian's work.
davidhamill1-nhs 128bd58
Tidy up.
davidhamill1-nhs 17f61b9
Update docs.
davidhamill1-nhs 6878efe
Tidy up.
davidhamill1-nhs File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,6 +34,7 @@ dpkg | |
| DSTU | ||
| eamodio | ||
| errstr | ||
| EMIS | ||
| Farsley | ||
| fhir | ||
| getfixturevalue | ||
|
|
||
8 changes: 8 additions & 0 deletions
8
bruno/gateway-api/collections/Steel_Thread/environments/INT.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| name: INT | ||
| variables: | ||
| - name: nhs_number | ||
| value: "9692140466" | ||
| - name: from_ods | ||
| value: S55555 | ||
| - name: base_url | ||
| value: http://localhost:5000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
83 changes: 83 additions & 0 deletions
83
gateway-api/stubs/stubs/data/patients/emis_int_test_9692140466.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| { | ||
| "resourceType": "Patient", | ||
| "id": "593C97B5-7B99-4326-9140-B329CC03A0D1", | ||
| "meta": { | ||
| "versionId": "1533356236474679227", | ||
| "profile": [ | ||
| "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Patient-1" | ||
| ] | ||
| }, | ||
| "extension": [ | ||
| { | ||
| "url": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-RegistrationDetails-1", | ||
| "extension": [ | ||
| { | ||
| "url": "preferredBranchSurgery", | ||
| "valueReference": { | ||
| "reference": "Location/EB3994A6-5A87-4B53-A414-913137072F57" | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| ], | ||
| "identifier": [ | ||
| { | ||
| "extension": [ | ||
| { | ||
| "url": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-NHSNumberVerificationStatus-1", | ||
| "valueCodeableConcept": { | ||
| "coding": [ | ||
| { | ||
| "system": "https://fhir.nhs.uk/STU3/CodeSystem/CareConnect-NHSNumberVerificationStatus-1", | ||
| "code": "01", | ||
| "display": "Number present and verified" | ||
| } | ||
| ], | ||
| "text": "Number present and verified" | ||
| } | ||
| } | ||
| ], | ||
| "system": "https://fhir.nhs.uk/Id/nhs-number", | ||
| "value": "9692140466" | ||
| } | ||
| ], | ||
| "name": [ | ||
| { | ||
| "use": "official", | ||
| "family": "Egan", | ||
| "given": [ | ||
| "Lester" | ||
| ], | ||
| "prefix": [ | ||
| "Mr" | ||
| ] | ||
| } | ||
| ], | ||
| "gender": "male", | ||
| "birthDate": "1958-02-02", | ||
| "address": [ | ||
| { | ||
| "use": "home", | ||
| "type": "physical", | ||
| "line": [ | ||
| "Cornerways", | ||
| "Leek Hill", | ||
| "Winterton" | ||
| ], | ||
| "city": "Scunthorpe", | ||
| "district": "S Humberside", | ||
| "postalCode": "DN15 9SR" | ||
| } | ||
| ], | ||
| "generalPractitioner": [ | ||
| { | ||
| "id": "1", | ||
| "type": "Organization", | ||
| "identifier": { | ||
| "system": "https://fhir.nhs.uk/Id/ods-organization-code", | ||
| "value": "EMIS_INT_ODS_CODE", | ||
| "period": {"start": "2020-01-01", "end": "9999-12-31"} | ||
| } | ||
| } | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -43,6 +43,7 @@ Use the following commands to create the appropriate `.env.test` file for the ta | |||||
| * `make env-test-ci` to write a `.env.test` file for testing a locally deployed application, from outside the dev container. | ||||||
| * `make env-test-pr-<pr number>` to write a `.env.test` file for testing an application deployed behind a PR proxy. | ||||||
| * `make env-test-alpha-int` to write a `.env.test` file for testing an application deployed to the "alpha integration" environment. | ||||||
| * `make env-test-int` to write a `.env.test` file for testing an application that sends requests to PDS, SDS and Provider integration environments. | ||||||
|
|
||||||
| _Note: Unit tests require the `.env` file, as these tests do not test a deployed application`_ | ||||||
|
|
||||||
|
|
@@ -213,10 +214,9 @@ Consumer tests generate the pact contract files in `tests/contract/pacts/` (e.g. | |||||
| Shared fixtures in `tests/conftest.py` are available across all test types: | ||||||
|
|
||||||
| * **`base_url`**: The base URL of the deployed Lambda function (from `BASE_URL` environment variable highlighted above) | ||||||
| * **`host`**: The hostname of the deployed application (from `HOST` environment variable highlighted above) | ||||||
| * **`client`**: An HTTP client instance for sending requests to the APIs | ||||||
|
|
||||||
| ### Load Testing with Locust ('load/') | ||||||
| ## Load Testing with Locust ('load/') | ||||||
|
|
||||||
| Load testing is performed using Locust. You have the option of running via the CLI or UI. | ||||||
| You will need [Proxygen setup](../../README.md#proxygen) to run the load tests. | ||||||
|
|
@@ -350,3 +350,26 @@ The GitHub Actions workflow (`.github/workflows/stage-2-test.yaml`) orchestrates | |||||
| │ 3. Enforce thresholds │ | ||||||
| └───────────────────────┘ | ||||||
| ``` | ||||||
|
|
||||||
| ## Testing INT | ||||||
|
|
||||||
| To test a locally deployed application against the integration environments of external services, PDS, SDS and Provider systems: | ||||||
|
|
||||||
| * Set up secrets in `.secrets` as per the instructions in `.secrets/README.md` | ||||||
| * `make env-int` - writes the `.env` file to point the application at the integration environments for each external service. | ||||||
| * `make deploy` - will deploy the application, feeding the `.env` values in to its container environment. | ||||||
|
|
||||||
| ### Manual test | ||||||
|
|
||||||
| To manually test the application against the integration environments, run the Bruno collection using the `INT.yml` environment. | ||||||
|
|
||||||
| ### Automated tests | ||||||
|
|
||||||
| To run a subset the automated test suite, run the following commands | ||||||
|
||||||
| To run a subset the automated test suite, run the following commands | |
| To run a subset of the automated test suite, run the following commands |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
**_kwargs: stris too restrictive for arequests.post-like stub. The production call now passesverify(bool) andtimeout(int|None), so this annotation will fail type-checking under strict mypy. Use**_kwargs: Any(or a typed**kwargs: object) to match the real signature more accurately.