Skip to content

Commit

Permalink
[NRLF-120] Enable status endpoint (#16)
Browse files Browse the repository at this point in the history
Co-authored-by: Joel Klinger <[email protected]>
  • Loading branch information
jaklinger and jaklinger authored Jan 3, 2023
1 parent c08ddef commit cddce66
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 16 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,10 @@ Then export the following env var:

If you want to run the smoke tests against a particular product or app then you can set up the command like this:

Example using `nrl-producer-api-pr-15` as the app:
Example using for the current product deployed to `internal-dev`:

`pytest tests/api_tests.py::test_smoke --proxy-name="nrl-producer-api-internal-dev" --api-name=nrl-producer-api`

Example using the product deployed for GitHub pull request 15:

`pytest tests/api_tests.py::test_smoke --proxy-name="nrl-producer-api-pr-15" --api-name=nrl-producer-api`
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,22 @@
<DisplayName>ServiceCallout.CallHealthcheckEndpoint</DisplayName>
<Properties/>
<Request clearPayload="true" variable="healthcheckRequest">
<Set>
<Headers>
<Header name="NHSD-Correlation-ID">{request.header.NHSD-Correlation-ID}</Header>
</Headers>
</Set>
<IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables>
</Request>
<Response>healthcheckResponse</Response>
<!-- <HTTPTargetConnection>-->
<!-- <SSLInfo>-->
<!-- <Enabled>true</Enabled>-->
<!-- </SSLInfo>-->
<!-- <LoadBalancer>-->
<!-- <Server name="nrl-producer-api" />-->
<!-- </LoadBalancer>-->
<!-- <Path>/_ping</Path>-->
<!-- </HTTPTargetConnection>-->
<HTTPTargetConnection>
<URL>http://mocktarget.apigee.net</URL>
<Properties>
<Property name="supports.http10">true</Property>
<Property name="request.retain.headers">User-Agent,Referer,Accept-Language</Property>
<Property name="retain.queryparams">apikey</Property>
</Properties>
<SSLInfo>
<Enabled>true</Enabled>
</SSLInfo>
<LoadBalancer>
<Server name="nrl-producer-api"/>
</LoadBalancer>
<Path>/production/_status</Path>
</HTTPTargetConnection>
<Timeout>20000</Timeout>
</ServiceCallout>
2 changes: 2 additions & 0 deletions tests/api_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ def test_status_endpoint(nhsd_apim_proxy_url, status_endpoint_auth_headers):
status_json = resp.json()
assert resp.status_code == 200
assert status_json["status"] == "pass"
assert status_json["checks"]['healthcheck']["responseCode"] == 200
assert status_json["checks"]['healthcheck']["outcome"] == {"message": "OK"}


@pytest.mark.nhsd_apim_authorization({"access": "application", "level": "level3"})
Expand Down

0 comments on commit cddce66

Please sign in to comment.