Skip to content

Commit e96b53e

Browse files
committed
CI/CD E2E Tests
1 parent 1a62f0b commit e96b53e

22 files changed

Lines changed: 1998 additions & 0 deletions

.github/workflows/cicd-4-test.yaml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: "CI/CD E2E Tests"
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
environment:
7+
description: Target environment
8+
required: true
9+
type: choice
10+
options: [dev, test, preprod]
11+
12+
jobs:
13+
listS3:
14+
runs-on: ubuntu-latest
15+
environment: ${{ inputs.environment }}
16+
permissions:
17+
id-token: write
18+
contents: read
19+
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
24+
- name: Set up Python
25+
uses: actions/setup-python@v4
26+
with:
27+
python-version: "3.11"
28+
29+
- name: Install Poetry
30+
run: |
31+
curl -sSL https://install.python-poetry.org | python3 -
32+
export PATH="$HOME/.local/bin:$PATH"
33+
34+
- name: Install dependencies with Poetry
35+
run: |
36+
poetry install --no-root
37+
38+
- name: Configure AWS Credentials
39+
uses: aws-actions/configure-aws-credentials@v4
40+
with:
41+
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/service-roles/github-actions-api-deployment-role
42+
aws-region: eu-west-2
43+
44+
- name: List S3 bucket
45+
run: |
46+
aws s3 ls s3://eligibility-signposting-api-${{ inputs.environment }}-tfstate
47+
48+
- name: Run Behave tests
49+
run: |
50+
mkdir -p reports
51+
poetry run behave --format json --outfile reports/behave-report.json
52+
53+
- name: Upload Behave test results
54+
uses: actions/upload-artifact@v4
55+
with:
56+
name: behave-test-results
57+
path: reports/

tests/e2e/.env.example

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# API Configuration
2+
BASE_URL=https://sandbox.api.service.nhs.uk/eligibility-signposting-api
3+
API_KEY=your_api_key_here
4+
5+
# Test Data
6+
VALID_NHS_NUMBER=50000000004
7+
INVALID_NHS_NUMBER=9876543210
8+
9+
# AWS
10+
# AWS
11+
ABORT_ON_AWS_FAILURE=false
12+
AWS_REGION=eu-west-2
13+
AWS_ACCESS_KEY_ID=aws_access_key_id_token_here
14+
AWS_SECRET_ACCESS_KEY=aws_secret_access_ey_token_here
15+
AWS_SESSION_TOKEN=aws_session_token_here
16+
17+
# DynamoDB
18+
DYNAMODB_TABLE_NAME=eligibilty_data_store
19+
DYNAMO_JSON_SOURCE_DIR=./data/dynamoDB/test_data.json
20+
21+
# S3
22+
S3_BUCKET_NAME=your-bucket-name
23+
S3_UPLOAD_DIR=qa/json
24+
S3_JSON_SOURCE_DIR=./data/s3
25+
26+
# Cleanup
27+
KEEP_SEED=false

tests/e2e/.gitignore

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Python
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
*.so
6+
.Python
7+
env/
8+
build/
9+
develop-eggs/
10+
dist/
11+
downloads/
12+
eggs/
13+
.eggs/
14+
lib/
15+
lib64/
16+
parts/
17+
sdist/
18+
var/
19+
*.egg-info/
20+
.installed.cfg
21+
*.egg
22+
23+
# Virtual Environment
24+
venv/
25+
ENV/
26+
env/
27+
28+
# IDE
29+
.idea/
30+
.vscode/
31+
*.swp
32+
*.swo
33+
34+
# Test reports
35+
report.html
36+
assets/
37+
.pytest_cache/
38+
39+
# Environment variables
40+
.env
41+
42+
# Logs
43+
*.log
44+
/helpers/output/

0 commit comments

Comments
 (0)