Skip to content
Merged
Changes from 2 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
f78df74
VED-812: Add e2e test pipeline.
mfjarvis Oct 14, 2025
42d1ab4
VED-812: Add test pipeline trigger.
mfjarvis Oct 14, 2025
4658af4
VED-812: Add debug logging.
mfjarvis Oct 14, 2025
88fac1f
VED-812: Fix Sonar errors.
mfjarvis Oct 14, 2025
0c8af42
VED-812: Update test trigger.
mfjarvis Oct 14, 2025
5c71f49
VED-812: Fix variable name.
mfjarvis Oct 14, 2025
eff76af
VED-812: Use Python library for TOTP code generation. Add some missin…
mfjarvis Oct 14, 2025
e3629f2
VED-812: Change test command.
mfjarvis Oct 14, 2025
11ad0b4
VED-812: Obtain AWS credentials before running e2e tests.
mfjarvis Oct 14, 2025
8e2c7d6
VED-812: Hard code environment for testing.
mfjarvis Oct 14, 2025
ed635bf
VED-812: Use input parameters. Add batch e2e tests.
mfjarvis Oct 14, 2025
b87043b
VED-812: Pass secrets to reusable pipeline. Fix batch e2e test command.
mfjarvis Oct 14, 2025
eadad72
VED-812: Read outputs from Terraform. Some tidying up.
mfjarvis Oct 14, 2025
63d0c46
VED-812: Select workspace before running Terraform output.
mfjarvis Oct 14, 2025
a058e78
VED-812: Fix env var names
mfjarvis Oct 14, 2025
ab4c0e3
VED-812: Set workspace explicitly.
mfjarvis Oct 14, 2025
1f54c44
VED-812: Revert previous change.
mfjarvis Oct 14, 2025
44ebcb4
VED-812: Add missing env var.
mfjarvis Oct 14, 2025
443aaf9
VED-812: Only restore relevant caches. Always run batch e2e tests.
mfjarvis Oct 15, 2025
0197736
VED-812: Wait for API to be available before running tests.
mfjarvis Oct 15, 2025
0806304
VED-812: Replace use of unavailable context.
mfjarvis Oct 15, 2025
5c8213d
VED-812: Set proxy name and service base path according to the enviro…
mfjarvis Oct 15, 2025
2096d8a
VED-812: Replicate existing e2e test commands per env.
mfjarvis Oct 15, 2025
d7b9d0c
VED-812: Tidy up. Use env vars associated with the Apigee environment…
mfjarvis Oct 16, 2025
190af29
VED-812: Update test pipeline.
mfjarvis Oct 16, 2025
9be2c98
VED-812: Improve Terraform workspace Makefile commands.
mfjarvis Oct 16, 2025
16162da
VED-812: Add workaround for batch e2e tests conditional job.
mfjarvis Oct 16, 2025
d13c033
VED-812: Wait for correct commit hash earlier in the pipeline.
mfjarvis Oct 16, 2025
808075c
VED-812: Remove testing pipeline.
mfjarvis Oct 16, 2025
95925f7
Merge branch 'master' into VED-812-e2e-test-pipeline
mfjarvis Oct 16, 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
99 changes: 99 additions & 0 deletions .github/workflows/run-e2e-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
name: Run e2e Tests

on:
workflow_call:
inputs:
apigee_environment:
required: true
type: string
environment:
required: true
type: string
sub_environment:
required: true
type: string
workflow_dispatch:
inputs:
apigee_environment:
type: choice
description: Select the Apigee proxy environment
options:
- internal-dev
- int
- ref
- prod
environment:
type: string
description: Select the backend environment
options:
- dev
- preprod
- prod
sub_environment:
type: string
description: Set the sub environment name e.g. pr-xxx, or green/blue in higher environments
# TODO - remove
pull_request:
types: [opened]

jobs:
e2e-tests:
runs-on: ubuntu-latest
environment:
name: ${{ inputs.environment }}
env: # Sonarcloud - do not allow direct usage of untrusted data
APIGEE_ENVIRONMENT: internal-dev
BACKEND_ENVIRONMENT: dev
BACKEND_SUB_ENVIRONMENT: internal-dev
APIGEE_USERNAME: ${{ vars.APIGEE_USERNAME }}
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8

- name: Install poetry
run: pip install poetry==2.1.4

- uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c
with:
python-version: 3.11
cache: "poetry"

- name: Install e2e test dependencies
run: poetry install --no-root
working-directory: e2e

- name: Install oathtool
run: sudo apt-get update && sudo apt-get install -y oathtool

- name: Get Apigee access token
env:
APIGEE_PASSWORD: ${{ secrets.APIGEE_PASSWORD }}
APIGEE_OAUTH_TOKEN: ${{ secrets.APIGEE_BASIC_AUTH_TOKEN }}
APIGEE_OTP_SECRET: ${{ secrets.APIGEE_OTP_KEY }}
run: |
CODE=$(oathtool --totp -b "$APIGEE_OTP_SECRET")
echo "::add-mask::$CODE"
echo "Requesting access token from Apigee..."
response=$(curl -s -X POST "https://login.apigee.com/oauth/token" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: application/json;charset=utf-8" \
-H "Authorization: Basic $APIGEE_BASIC_AUTH_TOKEN" \
-d "username=$APIGEE_USERNAME&password=$APIGEE_PASSWORD&mfa_token=$CODE&grant_type=password")
token=$(echo "$response" | jq -e -r '.access_token')
if [[ -z "$token" ]]; then
echo "Failed to retrieve access token"
exit 1
fi
echo "::add-mask::$token"
echo "APIGEE_ACCESS_TOKEN=$token" >> $GITHUB_ENV

- name: Run e2e tests
working-directory: e2e
run: |
# export PROXY_NAME=immunisation-fhir-api-${{ inputs.sub_environment }}
# export SERVICE_BASE_PATH=immunisation-fhir-api/FHIR/R4-${{ inputs.sub_environment }}
export PROXY_NAME=immunisation-fhir-api-internal-dev
export SERVICE_BASE_PATH=immunisation-fhir-api/FHIR/R4
make run-immunization
Loading