Skip to content

[CDAPI-100]: Integrate CI Tests with APIM Proxy III#41

Open
nhsd-rebecca-flynn wants to merge 19 commits intomainfrom
feature/CDAPI-100-2
Open

[CDAPI-100]: Integrate CI Tests with APIM Proxy III#41
nhsd-rebecca-flynn wants to merge 19 commits intomainfrom
feature/CDAPI-100-2

Conversation

@nhsd-rebecca-flynn
Copy link
Contributor

@nhsd-rebecca-flynn nhsd-rebecca-flynn commented Feb 24, 2026

Description

Update the integration, contract, schema and acceptance tests ran as part of the CI process to run against the deployed APIM proxy

Summary

Dual-environment test infrastructure: Tests now run against either a local Lambda (ENV=local) or a remote APIM proxy preview environment (ENV=remote), driven by .env files and Makefile targets.
Client abstraction: Client is now a Protocol with LocalClient and RemoteClient implementations; remote requests carry APIM auth headers and have longer timeouts.
CI pipeline restructure: Acceptance tests, coverage merging, and SonarCloud analysis moved from stage-2-test.yaml into preview-env.yaml; a new reusable run-test-suite composite action reduces duplication. Integration, Contract and Schema validation tests still also run locally.
Contract/status endpoint updates: _status response changed from text/plain "OK" to application/json {"status": "pass", ...} (Proxygen standard format); pact contract updated accordingly.

Context

To allow for the CI process to run before the APIM integration has been completed, the tests are currently executed against a container running within the same process, which invokes the lambda in the same way as it would be ran within AWS. This ticket looks to alter the target of the tests to instead point at the deployed APIM proxy for the Pull Request.

Type of changes

  • Refactoring (non-breaking change)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would change existing functionality)
  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • I have followed the code style of the project
  • I have added tests to cover my changes
  • I have updated the documentation accordingly
  • This PR is a result of pair or mob programming
  • Exceptions/Exclusions to coding standards (e.g. #noqa or #NOSONAR) are included within this Pull Request.

Sensitive Information Declaration

To ensure the utmost confidentiality and protect your and others privacy, we kindly ask you to NOT including PII (Personal Identifiable Information) / PID (Personal Identifiable Data) or any other sensitive data in this PR (Pull Request) and the codebase changes. We will remove any PR that do contain any sensitive information. We really appreciate your cooperation in this matter.

  • I confirm that neither PII/PID nor sensitive data are included in this PR and the codebase changes.

@github-actions
Copy link

github-actions bot commented Feb 24, 2026

Trivy gate: no Critical/High vulnerabilities.

Trivy Filesystem Scan Summary

Filesystem: /tmp/artifact

Severity Count
CRITICAL 0
HIGH 0
MEDIUM 0
LOW 0
UNKNOWN 0

✅ No vulnerabilities found.

@nhsd-rebecca-flynn nhsd-rebecca-flynn force-pushed the feature/CDAPI-100-2 branch 6 times, most recently from f133ca4 to bf73134 Compare February 26, 2026 05:46
@nhsd-rebecca-flynn nhsd-rebecca-flynn marked this pull request as ready for review February 26, 2026 05:57
@nhsd-rebecca-flynn nhsd-rebecca-flynn requested a review from a team as a code owner February 26, 2026 05:57
@nhsd-rebecca-flynn nhsd-rebecca-flynn force-pushed the feature/CDAPI-100-2 branch 2 times, most recently from b3947b8 to 172c27e Compare February 26, 2026 14:39
neil-sproston
neil-sproston previously approved these changes Feb 26, 2026
Copy link
Contributor

@neil-sproston neil-sproston left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From a platform POV it looks sane and sensible and leave us in a perfect position ready when we re-plumb the preview-env functionality back into the man CI pipelines.

Copy link
Collaborator

@nhsd-jack-wainwright nhsd-jack-wainwright left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 👍 , just a few minor comments / questions.

"remoteUser": "pathology-dev",
"containerUser": "pathology-dev",
"containerEnv": {
"REQUESTS_CA_BUNDLE": "/etc/ssl/cert.pem"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is this container environment variable used?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without REQUESTS_CA_BUNDLE=/etc/ssl/cert.pem, Python's requests library falls back to its bundled certifi CA certificates instead of the system's CA store. Setting REQUESTS_CA_BUNDLE forces requests to use the system certificate bundle, including any custom CA certs added to the container image, instead of the limited certifi bundle.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 3, 2026

@github-actions
Copy link

github-actions bot commented Mar 3, 2026

Deployment Complete

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants