Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
363c132
attempt to assume role for dev
seansteberisal Sep 19, 2025
f1f84db
update to pr-link which should start linking the jira ticket
seansteberisal Sep 19, 2025
b66c588
update github-script action version
seansteberisal Sep 19, 2025
b9b2a66
Syntax error
seansteberisal Sep 19, 2025
78c4172
remove the permissions object to see if that's causing an issue
seansteberisal Sep 19, 2025
91fa418
set the permission correctly this time
seansteberisal Sep 19, 2025
e9a72c5
trying to specifically provide the github token
seansteberisal Sep 19, 2025
e179589
add issues: write and pull-requests: write permission
seansteberisal Sep 19, 2025
2c417ca
Syntax error
seansteberisal Sep 19, 2025
4c3dba4
Syntax error
seansteberisal Sep 19, 2025
209720b
adding some write permissions
seansteberisal Sep 19, 2025
aaae4b7
adding service-roles/
seansteberisal Sep 19, 2025
f5050dc
remove service-roles/ from path
seansteberisal Sep 19, 2025
5aeb2e5
Allow just the story tests to be run
seansteberisal Sep 19, 2025
08728e4
returning auth to DynamoDB helper to see if it does automagically get…
seansteberisal Sep 19, 2025
4c8af1d
DynamoDM table name env variable
seansteberisal Sep 19, 2025
fa439b1
typo
seansteberisal Sep 19, 2025
983d21a
remove more references to AWS profiles
seansteberisal Sep 19, 2025
eb931f1
use dev certs instead
seansteberisal Sep 19, 2025
b55d4c4
ignore cert directory
seansteberisal Sep 22, 2025
39808af
added s3 env variables
seansteberisal Sep 22, 2025
b3099b5
import of tests from API project
seansteberisal Sep 22, 2025
1b60625
add BASE_URL env variable
seansteberisal Sep 22, 2025
3097d33
updated tests
seansteberisal Sep 22, 2025
4159689
Slight change to command to run the tests
seansteberisal Sep 22, 2025
42f029f
Merge branch 'main' into feature/ELI-262-Configure-CI/CD-pipeline-for…
seansteberisal Sep 22, 2025
5185dce
Packages updates
seansteberisal Sep 22, 2025
96443ac
delete everything
seansteberisal Sep 22, 2025
8722ff6
Add everything again
seansteberisal Sep 22, 2025
91d3652
update placeholder_utils.py
seansteberisal Sep 22, 2025
ba065bb
update placeholder_utils.py
seansteberisal Sep 22, 2025
e5b380b
fixed ELI-371 tests
seansteberisal Sep 23, 2025
f97bb2c
take -vv off to speed up tests
seansteberisal Sep 23, 2025
fe3b426
added logic to determine correct values for different environments.
seansteberisal Sep 23, 2025
4945d5c
Pull Request ID has been removed
seansteberisal Sep 23, 2025
d40c834
more env stuff
seansteberisal Sep 23, 2025
e2c6747
Merge branch 'main' into feature/ELI-262-Configure-CI/CD-pipeline-for…
seansteberisal Sep 23, 2025
67cdf68
dynamo table re-created before tests begin
seansteberisal Sep 23, 2025
d046794
dynamo table re-created before tests begin
seansteberisal Sep 23, 2025
5431afe
Merge remote-tracking branch 'origin/feature/ELI-262-Configure-CI/CD-…
seansteberisal Sep 24, 2025
21e5bb0
environment variable ay now set by the test pack, you only need to pa…
seansteberisal Sep 24, 2025
5563375
update python packages
seansteberisal Sep 24, 2025
c52d215
pass in the log level you want
seansteberisal Sep 24, 2025
00b187d
removed the force error on failure step because it's not needed
seansteberisal Sep 24, 2025
9cff26c
Prevent DynamoDB tables being reset in any environment that is not de…
seansteberisal Sep 25, 2025
84dcc88
will now run all tests in all environments, not just story tests
seansteberisal Sep 26, 2025
aab0a5c
automerge dependabots
seansteberisal Sep 26, 2025
e2c3ebe
Merge branch 'main' into feature/ELI-262-Configure-CI/CD-pipeline-for…
seansteberisal Sep 26, 2025
e66619a
Merge branch 'main' into feature/ELI-262-Configure-CI/CD-pipeline-for…
seansteberisal Sep 26, 2025
f4b90fe
update poetry version and packages
seansteberisal Sep 26, 2025
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
4 changes: 2 additions & 2 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Add any summary information of what is in the change. **Remove this line if you
Pull requests should be named using the following format:

```text
Tag: [AEA-NNNN] - Short description
Tag: [ELI-NNNN] - Short description
```

Tag can be one of:
Expand Down Expand Up @@ -45,7 +45,7 @@ The description of your pull request will be used as the commit message for the
If you need to rename your pull request, you can restart the checks by either:

- Closing and reopening the pull request
- pushing an empty commit
- pushing an empty commit
```bash
git commit --allow-empty -m 'trigger build'
git push
Expand Down
21 changes: 14 additions & 7 deletions .github/workflows/pr-link.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
name: PR Link ticket
on:
pull_request:
types: [opened]
types: [ opened ]
jobs:
link-ticket:
runs-on: ubuntu-22.04
env:
REF: ${{ github.event.pull_request.head.ref }}
permissions:
id-token: write
pull-requests: write
issues: write
steps:
- name: Check ticket name conforms to requirements
run: echo "$REF" | grep -i -E -q "(eli-[0-9]+)|(dependabot\/)"
Expand All @@ -31,10 +35,13 @@ jobs:
- name: Comment on PR with link to JIRA ticket
if: contains(github.event.pull_request.head.ref, 'eli-')
continue-on-error: true
uses: unsplash/comment-on-pr@b5610c6125a7197eaec80072ea35ef53e1fc6035
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: actions/github-script@v8
with:
msg: |
This branch is work on a ticket in an NHS England JIRA Project. Here's a handy link to the ticket:
# [${{ env.TICKET_NAME }}](https://nhsd-jira.digital.nhs.uk/browse/${{ env.TICKET_NAME }})
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `This branch is work on a ticket in an NHS England JIRA Project. Here is a handy link to the ticket:
[${{ env.TICKET_NAME }}](https://nhsd-jira.digital.nhs.uk/browse/${{ env.TICKET_NAME }})`
})
44 changes: 23 additions & 21 deletions .github/workflows/regression_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,55 +12,58 @@ on:
type: environment
required: true
default: "dev"
log_level:
description: 'Log level to output to console'
type: choice
options: ["INFO", "DEBUG"]
required: false
default: "INFO"
id:
description: 'Unique run identifier (Do not change this)'
required: false
required: true
default: "Manually Triggered Run"
pull_request_id:
description: 'The ID of the pull request. This should be in the format pr-xxxx where xxxx is the pull request id'
required: false
default: ""
github_tag:
description: 'The github tag to run the test pack from'
required: false
required: true
default: "main"

jobs:
regression_tests:
permissions:
id-token: write
issues: write
pull-requests: write
runs-on: ubuntu-22.04
environment: ${{ inputs.environment }}
steps:
- name: show_input_parameters
env:
tags: ${{ inputs.tags }}
environment: ${{ inputs.environment }}
log_level: ${{ inputs.log_level }}
id: ${{ inputs.id }}
pull_request_id: ${{ inputs.pull_request_id }}
github_tag: ${{ inputs.github_tag }}
run: |
echo "tags: ${tags}"
echo "environment: ${environment}"
echo "log_level: ${log_level}"
echo "id: ${id}"
echo "pull_request_id: ${pull_request_id}"
echo "github_tag: ${github_tag}"
# output to summary
# shellcheck disable=SC2129
echo "tags: ${tags}" >> "$GITHUB_STEP_SUMMARY"
echo "environment: ${environment}" >> "$GITHUB_STEP_SUMMARY"
echo "log_level: ${log_level}" >> "$GITHUB_STEP_SUMMARY"
echo "id: ${id}" >> "$GITHUB_STEP_SUMMARY"
echo "pull_request_id: ${pull_request_id}" >> "$GITHUB_STEP_SUMMARY"
echo "github_tag: ${github_tag}" >> "$GITHUB_STEP_SUMMARY"

- name: ${{github.event.inputs.id}}
env:
ID: ${{github.event.inputs.id}}
ENV: ${{ inputs.environment }}
PULL_REQUEST_ID: ${{ inputs.pull_request_id }}
run: |
echo run identifier "$ID"-"$ENV"-"$PULL_REQUEST_ID"
echo run identifier "$ID"-"$ENV"-"$PULL_REQUEST_ID" >> "$GITHUB_STEP_SUMMARY"
echo run identifier "$ID"-"$ENV"
echo run identifier "$ID"-"$ENV" >> "$GITHUB_STEP_SUMMARY"

- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
Expand Down Expand Up @@ -98,18 +101,17 @@ jobs:
if: steps.cache-venv.outputs.cache-hit != 'true'
run: make install

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v5.0.0
with:
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/Eligibility-Signposting-API-E2E-Regression-Tests
aws-region: eu-west-2

- name: Regression Tests
id: tests
continue-on-error: true
env:
ENVIRONMENT: ${{ inputs.environment }}
PULL_REQUEST_ID: ${{ inputs.pull_request_id }}
LOG_LEVEL: ${{ inputs.log_level }}
INPUT_TAG: ${{ inputs.tags }}
run: echo Coming Soon!
# run: make run-tests

- name: force error on failure
if: steps.tests.outcome != 'success'
run: |
echo The regression tests step failed, this likely means there are test failures.
exit 1
make run-tests env="$ENVIRONMENT" log_level="$LOG_LEVEL"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -254,3 +254,4 @@ vscode

# Node Modules
node_modules
/certs/
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
python 3.13.5
poetry 2.1.4
poetry 2.2.0
shellcheck 0.11.0
actionlint 1.7.7
nodejs 22.18.0
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,7 @@ deep-clean-install:
pre-commit:
poetry run pre-commit run --all-files

run-tests:
poetry run pytest
run-tests: guard-env guard-log_level
poetry run pytest --env=${env} --log-cli-level=${log_level} -s tests/test_story_tests.py
poetry run pytest --env=${env} --log-cli-level=${log_level} -s tests/test_error_scenario_tests.py
poetry run pytest --env=${env} --log-cli-level=${log_level} -s tests/test_vita_integration_tests.py
94 changes: 94 additions & 0 deletions data/configs/inProgressTestConfigs/440/AUTO_RSV_ELI-440-04.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
{
"CampaignConfig": {
"ID": "AUTO_RSV_ELI-440-04-Campaign-ID",
"Version": 1,
"Name": "ELI-440-04-Iteration-Config-Name",
"Type": "V",
"Target": "RSV",
"Manager": [
"person1@nhs.net"
],
"Approver": [
"person1@nhs.net"
],
"Reviewer": [
"person1@nhs.net"
],
"IterationFrequency": "X",
"IterationType": "O",
"IterationTime": "07:00:00",
"StartDate": "20250717",
"EndDate": "20350717",
"ApprovalMinimum": 0,
"ApprovalMaximum": 0,
"DefaultCommsRouting": "BOOK_NBS",
"Iterations": [
{
"ID": "AUTO_RSV_ELI-440-04-Iteration-ID",
"DefaultCommsRouting": "TEST_ACTION",
"DefaultNotActionableRouting": "TEST_NOT_ACTION",
"DefaultNotEligibleRouting": "TEST_NOT_ELI",
"Version": 1,
"Name": "ELI-440-04-Iteration-Config-Name",
"IterationDate": "20240808",
"IterationNumber": 1,
"CommsType": "I",
"ApprovalMinimum": 0,
"ApprovalMaximum": 0,
"Type": "O",
"IterationCohorts": [
{
"CohortLabel": "elid_virtual_cohort",
"CohortGroup": "elid_virtual_cohort",
"PositiveDescription": "In elid_virtual_cohort",
"NegativeDescription": "Out elid_virtual_cohort",
"Priority": 1,
"Virtual": "Y"
},
{
"CohortLabel": "rsv_eli_440_cohort_999",
"CohortGroup": "rsv_eli_440_cohort_999",
"PositiveDescription": "In rsv_eli_440_cohort_999",
"NegativeDescription": "Out rsv_eli_440_cohort_999",
"Priority": 2
}
],
"IterationRules": [
{
"Type": "F",
"Name": "Filter based on cohort membership",
"Description": "Filter based on cohort membership",
"Priority": 100,
"AttributeLevel": "COHORT",
"AttributeName": "COHORT_LABEL",
"Operator": "in",
"Comparator": "elid_virtual_cohort"
}
],
"ActionsMapper": {
"TEST_ACTION": {
"ExternalRoutingCode": "TestAction",
"ActionDescription": "TestAction Description",
"ActionType": "ButtonWithAuthLink",
"UrlLink": "http://www.nhs.uk/book-rsv",
"UrlLabel": "Continue to booking"
},
"TEST_NOT_ACTION": {
"ExternalRoutingCode": "TestNotAction",
"ActionDescription": "TestNotAction Description",
"ActionType": "ButtonWithAuthLink",
"UrlLink": null,
"UrlLabel": ""
},
"TEST_NOT_ELI": {
"ExternalRoutingCode": "TestNotEli",
"ActionDescription": "TestNotEli Description",
"ActionType": "TestNotEliAction",
"UrlLink": "https://www.noteligible.com/440",
"UrlLabel": "not_eli_UrlLabel"
}
}
}
]
}
}
3 changes: 2 additions & 1 deletion data/configs/storyTestConfigs/AUTO_RSV_ELI-222.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@
"CohortGroup": "magic_cohort",
"PositiveDescription": "",
"NegativeDescription": "",
"Priority": 20
"Priority": 20,
"Virtual": "Y"
}
],
"IterationRules": [
Expand Down
88 changes: 88 additions & 0 deletions data/configs/storyTestConfigs/AUTO_RSV_ELI-223-01.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
{
"CampaignConfig": {
"ID": "AUTO_RSV_ELI-223-01-Campaign-ID",
"Version": 1,
"Name": "ELI-223-01-Iteration-Config-Name",
"Type": "V",
"Target": "RSV",
"Manager": [
"person1@nhs.net"
],
"Approver": [
"person1@nhs.net"
],
"Reviewer": [
"person1@nhs.net"
],
"IterationFrequency": "X",
"IterationType": "O",
"IterationTime": "07:00:00",
"StartDate": "20250717",
"EndDate": "20350717",
"ApprovalMinimum": 0,
"ApprovalMaximum": 0,
"DefaultCommsRouting": "BOOK_NBS",
"Iterations": [
{
"ID": "AUTO_RSV_ELI-223-01-Iteration-ID",
"DefaultCommsRouting": "TEST_ACTION",
"DefaultNotActionableRouting": "TEST_NOT_ACTION",
"DefaultNotEligibleRouting": "TEST_NOT_ELI",
"Version": 1,
"Name": "ELI-223-01-Iteration-Config-Name",
"IterationDate": "20240808",
"IterationNumber": 1,
"CommsType": "I",
"ApprovalMinimum": 0,
"ApprovalMaximum": 0,
"Type": "O",
"IterationCohorts": [
{
"CohortLabel": "rsv_eli_223_cohort_1",
"CohortGroup": "rsv_eli_223_cohort_group",
"PositiveDescription": "are a member of eli_223_cohort_group",
"NegativeDescription": "are not a member of eli_223_cohort_group",
"Priority": 0
}
],
"IterationRules": [
{
"Type": "S",
"Name": "Already Vaccinated",
"Description": "## You've had your RSV vaccination\\n\\nWe believe you had the RSV vaccination on [[TARGET.RSV.LAST_SUCCESSFUL_DATE:DATE(%d %B %Y)]]",
"Priority": 200,
"AttributeLevel": "TARGET",
"AttributeTarget": "RSV",
"AttributeName": "LAST_SUCCESSFUL_DATE",
"Operator": "Y>=",
"Comparator": "-25",
"RuleStop": "Y"
}
],
"ActionsMapper": {
"TEST_ACTION": {
"ExternalRoutingCode": "TestActionDefault",
"ActionDescription": "TestActionDefault Description",
"ActionType": "ButtonWithAuthLink",
"UrlLink": "http://www.nhs.uk/book-rsv",
"UrlLabel": "TestActionDefault"
},
"TEST_NOT_ACTION": {
"ExternalRoutingCode": "TestNotAction",
"ActionDescription": "TestNotAction Description",
"ActionType": "ButtonWithAuthLink",
"UrlLink": null,
"UrlLabel": ""
},
"AMEND_NBS": {
"ExternalRoutingCode": "AmendNBS",
"ActionDescription": "## You have an RSV vaccination appointment\n You can view, change or cancel your appointment below.",
"ActionType": "ButtonWithAuthLink",
"UrlLink": "http://www.nhs.uk/book-rsv",
"UrlLabel": "Manage your appointment"
}
}
}
]
}
}
Loading