Skip to content

[GPCAPIM-260]-[Steel Thread integration testing]-[RP]#86

Open
BJSS-russell-pollock wants to merge 2 commits intomainfrom
feature/GPCAPIM-260
Open

[GPCAPIM-260]-[Steel Thread integration testing]-[RP]#86
BJSS-russell-pollock wants to merge 2 commits intomainfrom
feature/GPCAPIM-260

Conversation

@BJSS-russell-pollock
Copy link
Contributor

Description

Move all pipline tests from stage-2 into preview-env

Context

Allows for the tests to be ran with the preview environment

  • 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.

@BJSS-russell-pollock BJSS-russell-pollock requested a review from a team as a code owner February 17, 2026 11:01
@sonarqubecloud
Copy link

@github-actions
Copy link

Deployment Complete

@github-actions
Copy link

Trivy gate: no Critical/High issues.

Trivy IaC (Terraform) Summary

Severity Count
CRITICAL 0
HIGH 0
MEDIUM 0
LOW 0
UNKNOWN 0
Findings (top 50)
Severity ID Title File

@github-actions
Copy link

Trivy gate: no Critical/High vulnerabilities.

Trivy Image Scan Summary

Image: 900119715266.dkr.ecr.eu-west-2.amazonaws.com/whoami:feature-gpcapim-260

Severity Count
CRITICAL 0
HIGH 0
MEDIUM 0
LOW 1
UNKNOWN 0
Findings (top 50)
Severity ID Package Installed Fixed Source
LOW CVE-2026-1703 pip 25.3 26.0 Python

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 points / suggestions

retention-days: 30

- name: Check unit-tests.xml exists
id: check-unit
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would we ever expect this unit-tests.xml file to not exist? Maybe it would be nicer to just let this step fail if the file doesn't exist, as I think this would point to something else going wrong anyway?

path: gateway-api/test-artefacts/
retention-days: 30

- name: Check contract-tests.xml exists
Copy link
Collaborator

Choose a reason for hiding this comment

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

As above would we ever expect the contract-tests.xml file to not exist here?

path: gateway-api/test-artefacts/
retention-days: 30

- name: Check schema-tests.xml exists
Copy link
Collaborator

Choose a reason for hiding this comment

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

As above, I think schema-tests.xml should always exist?

path: gateway-api/test-artefacts/
retention-days: 30

- name: Check integration-tests.xml exists
Copy link
Collaborator

Choose a reason for hiding this comment

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

As above, I think integration-tests.xml should always exist?

path: gateway-api/test-artefacts/
retention-days: 30

- name: Check acceptance-tests.xml exists
Copy link
Collaborator

Choose a reason for hiding this comment

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

As above, I think acceptance-tests.xml should always exist?

# Cleanup after tests
- name: Remove mTLS temp files
if: github.event.action != 'closed'
run: rm -f /tmp/client1-key.pem /tmp/client1-cert.pem || true
Copy link
Collaborator

Choose a reason for hiding this comment

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

At this point would these temporary files always exist? If so, perhaps it would be better to let this step fail with an unsuccessful exit code rather than providing a default true statement?

Suggested change
run: rm -f /tmp/client1-key.pem /tmp/client1-cert.pem || true
run: rm -f /tmp/client1-key.pem /tmp/client1-cert.pem

headers=headers,
data=body,
cert=self.cert,
verify=False,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Given we have the certificate file and key, I think we should be able to verify the certificate provided by the server here?

# Verify the response matches expectations
assert response.status_code == 200
body = response.json()
assert body["resourceType"] == "Bundle"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Are these assertions being covered in tests elsewhere?


cert = None
cert_path = os.getenv("MTLS_CERT")
key_path = os.getenv("MTLS_KEY")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would it be nicer here if these values were provided as fixtures to the test rather than having the test need to fetch the environment variables itself? The tests would then be able to depend on these values as arguments passed into the methods themselves

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

Comments