Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
6728acb
HOTE-541: Add pipeline for executing playwright tests
mikeeq Feb 18, 2026
8367217
remove commented code
mikeeq Feb 18, 2026
fc69fce
remove commented code v2
mikeeq Feb 18, 2026
283a31a
test pipeline
mikeeq Feb 18, 2026
7713c7d
test pipeline - remove
mikeeq Feb 18, 2026
a291da0
cleanup v5
mikeeq Feb 18, 2026
80b8afb
Add additional configs
mikeeq Feb 18, 2026
e07bcab
Add additional configs test
mikeeq Feb 18, 2026
5e3267e
run tests against dev env
mikeeq Feb 18, 2026
08fbb91
run tests against dev env v2
mikeeq Feb 18, 2026
58672a8
run tests against dev env v3
mikeeq Feb 18, 2026
6b5c044
run tests against dev env v4
mikeeq Feb 18, 2026
44800d1
run tests against dev env v5
mikeeq Feb 18, 2026
f030bc4
add clean all
mikeeq Feb 18, 2026
ff32def
add some checks
mikeeq Feb 18, 2026
294903f
add pr title check
mikeeq Feb 18, 2026
5fd9e80
Merge branch 'main' of github.com:NHSDigital/hometest-service into fe…
mikeeq Feb 18, 2026
acfadf2
merge
mikeeq Feb 19, 2026
86ac943
cleanup v3
mikeeq Feb 20, 2026
0cb445c
Merge branch 'main' of github.com:NHSDigital/hometest-service into fe…
mikeeq Feb 20, 2026
030425d
Fix failing tests
mikeeq Feb 20, 2026
f4c3395
name tags missing v2
mikeeq Feb 20, 2026
5a70279
name tags missing v3
mikeeq Feb 20, 2026
ae09c26
Merge branch 'main' of github.com:NHSDigital/hometest-service into fe…
mikeeq Feb 23, 2026
37c526a
Merge branch 'main' into feature/hote-541/add-playwright-tests
piotrkas Mar 3, 2026
844fd73
fix: correct import path for NhsLoginHelper in SandBoxUserManager
piotrkas Mar 3, 2026
dec34f1
fix: update Playwright command to use TARGET_ENV and set default API/…
piotrkas Mar 3, 2026
93923b2
fix: update default environment to 'dev' in Playwright E2E workflow
piotrkas Mar 4, 2026
fe8db7f
Merge branch 'main' into feature/hote-541/add-playwright-tests
piotrkas Mar 11, 2026
29b909c
wait 15 minutes before start testing
piotrkas Mar 12, 2026
e262896
wait 15 minutes before start testing
piotrkas Mar 12, 2026
284e2c2
Revert "wait 15 minutes before start testing"
piotrkas Mar 12, 2026
23ff950
Revert "wait 15 minutes before start testing"
piotrkas Mar 12, 2026
87cb58d
Revert "fix: update default environment to 'dev' in Playwright E2E wo…
piotrkas Mar 12, 2026
20c7ef6
Revert "fix: update Playwright command to use TARGET_ENV and set defa…
piotrkas Mar 12, 2026
ce16a15
feat: enhance NHS login flow with detailed logging and network error …
przemyslawbiesek Mar 12, 2026
c49dba0
feat: add logging for successful worker user login and session state …
przemyslawbiesek Mar 12, 2026
7fb5e23
Merge remote-tracking branch 'origin/feature/hote-541/add-playwright-…
przemyslawbiesek Mar 12, 2026
f706e78
Start application on dev too
piotrkas Mar 12, 2026
8e469cc
Merge remote-tracking branch 'origin/feature/hote-541/add-playwright-…
przemyslawbiesek Mar 12, 2026
263ec76
Merge branch 'main' into feature/hote-541/add-playwright-tests
piotrkas Mar 12, 2026
7740a91
Merge remote-tracking branch 'origin/main' into feature/hote-541/play…
przemyslawbiesek Mar 12, 2026
58b7bae
Resolving conflicts
przemyslawbiesek Mar 12, 2026
fa4b765
Merge branch 'feature/hote-541/playwright-Przemek' into feature/hote-…
piotrkas Mar 12, 2026
070d1d7
Merge branch 'main' into feature/hote-541/add-playwright-tests
piotrkas Mar 17, 2026
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
64 changes: 42 additions & 22 deletions .github/workflows/cicd-1-pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,34 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 1
steps:
- name: "Checkout code"
uses: actions/checkout@v6
- name: "Verify Jira ticket in PR title and Jira"
uses: ./.github/actions/verify-jira-ticket
with:
pr_title: ${{ github.event.pull_request.title }}
pr_branch: ${{ github.head_ref }}
jira_token: ${{ secrets.NHS_HOMETEST_JIRA_PAT }}
actor: ${{ github.event.pull_request.user.login }}
- name: "Check PR title for HOTE- Jira ID"
env:
PR_TITLE: ${{ github.event.pull_request.title }}
PR_BRANCH: ${{ github.head_ref }}
run: |
JIRA_PATTERN='HOTE-[0-9]+'

echo "PR Title: $PR_TITLE"
echo "PR Branch: $PR_BRANCH"

if [[ "$PR_TITLE" =~ $JIRA_PATTERN ]]; then
TICKET="${BASH_REMATCH[0]}"
echo "✅ Found Jira ticket '$TICKET' in PR title"
exit 0
fi

if [[ "$PR_BRANCH" =~ $JIRA_PATTERN ]]; then
TICKET="${BASH_REMATCH[0]}"
echo "⚠️ Jira ticket '$TICKET' found in branch name but NOT in PR title"
echo "Please include the Jira ticket ID in the PR title, e.g.: '$TICKET: <description>'"
exit 1
fi

echo "❌ No Jira ticket ID found in PR title or branch name"
echo ""
echo "PR title must contain a Jira ticket ID matching pattern: HOTE-<number>"
echo "Example: 'HOTE-123: Add user authentication'"
exit 1
metadata:
name: "Set CI/CD metadata"
runs-on: ubuntu-latest
Expand All @@ -48,28 +66,30 @@ jobs:
id: variables
run: |
datetime=$(date -u +'%Y-%m-%dT%H:%M:%S%z')
BUILD_DATETIME=$datetime make version-create-effective-file
echo "build_datetime_london=$(TZ=Europe/London date --date=$datetime +'%Y-%m-%dT%H:%M:%S%z')" >> $GITHUB_OUTPUT
echo "build_datetime=$datetime" >> $GITHUB_OUTPUT
echo "build_timestamp=$(date --date=$datetime -u +'%Y%m%d%H%M%S')" >> $GITHUB_OUTPUT
echo "build_epoch=$(date --date=$datetime -u +'%s')" >> $GITHUB_OUTPUT
echo "nodejs_version=$(grep "^v" .nvmrc | cut -f2 -d'v')" >> $GITHUB_OUTPUT
echo "python_version=$(grep "^python\s" .tool-versions | cut -f2 -d' ')" >> $GITHUB_OUTPUT
echo "terraform_version=$(grep "^terraform\s" .tool-versions | cut -f2 -d' ')" >> $GITHUB_OUTPUT
echo "version=$(head -n 1 .version 2> /dev/null || echo unknown)" >> $GITHUB_OUTPUT
BUILD_DATETIME="$datetime" make version-create-effective-file
{
echo "build_datetime_london=$(TZ=Europe/London date --date="$datetime" +'%Y-%m-%dT%H:%M:%S%z')"
echo "build_datetime=$datetime"
echo "build_timestamp=$(date --date="$datetime" -u +'%Y%m%d%H%M%S')"
echo "build_epoch=$(date --date="$datetime" -u +'%s')"
echo "nodejs_version=$(grep "^nodejs\s" .tool-versions | cut -f2 -d' ')"
echo "python_version=$(grep "^python\s" .tool-versions | cut -f2 -d' ')"
echo "terraform_version=$(grep "^terraform\s" .tool-versions | cut -f2 -d' ')"
echo "version=$(head -n 1 .version 2> /dev/null || echo unknown)"
} >> "$GITHUB_OUTPUT"
- name: "Check if pull request exists for this branch"
id: pr_exists
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
branch_name=${GITHUB_HEAD_REF:-$(echo $GITHUB_REF | sed 's#refs/heads/##')}
branch_name=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}
echo "Current branch is '$branch_name'"
if gh pr list --head $branch_name | grep -q .; then
if gh pr list --head "$branch_name" | grep -q .; then
echo "Pull request exists"
echo "does_pull_request_exist=true" >> $GITHUB_OUTPUT
echo "does_pull_request_exist=true" >> "$GITHUB_OUTPUT"
else
echo "Pull request doesn't exist"
echo "does_pull_request_exist=false" >> $GITHUB_OUTPUT
echo "does_pull_request_exist=false" >> "$GITHUB_OUTPUT"
fi
- name: "List variables"
run: |
Expand Down
20 changes: 11 additions & 9 deletions .github/workflows/cicd-2-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,16 @@ jobs:
id: variables
run: |
datetime=$(date -u +'%Y-%m-%dT%H:%M:%S%z')
echo "build_datetime=$datetime" >> $GITHUB_OUTPUT
echo "build_timestamp=$(date --date=$datetime -u +'%Y%m%d%H%M%S')" >> $GITHUB_OUTPUT
echo "build_epoch=$(date --date=$datetime -u +'%s')" >> $GITHUB_OUTPUT
echo "nodejs_version=$(grep "^nodejs\s" .tool-versions | cut -f2 -d' ')" >> $GITHUB_OUTPUT
echo "python_version=$(grep "^python\s" .tool-versions | cut -f2 -d' ')" >> $GITHUB_OUTPUT
echo "terraform_version=$(grep "^terraform\s" .tool-versions | cut -f2 -d' ')" >> $GITHUB_OUTPUT
# TODO: Get the version, but it may not be the .version file as this should come from the CI/CD Pull Request Workflow
echo "version=$(head -n 1 .version 2> /dev/null || echo unknown)" >> $GITHUB_OUTPUT
{
echo "build_datetime=$datetime"
echo "build_timestamp=$(date --date="$datetime" -u +'%Y%m%d%H%M%S')"
echo "build_epoch=$(date --date="$datetime" -u +'%s')"
echo "nodejs_version=$(grep "^nodejs\s" .tool-versions | cut -f2 -d' ')"
echo "python_version=$(grep "^python\s" .tool-versions | cut -f2 -d' ')"
echo "terraform_version=$(grep "^terraform\s" .tool-versions | cut -f2 -d' ')"
# TODO: Get the version, but it may not be the .version file as this should come from the CI/CD Pull Request Workflow
echo "version=$(head -n 1 .version 2> /dev/null || echo unknown)"
} >> "$GITHUB_OUTPUT"
- name: "List variables"
run: |
export BUILD_DATETIME="${{ steps.variables.outputs.build_datetime }}"
Expand Down Expand Up @@ -89,7 +91,7 @@ jobs:
steps:
- name: "Check prerequisites for notification"
id: check
run: echo "secret_exist=${{ secrets.TEAMS_NOTIFICATION_WEBHOOK_URL != '' }}" >> $GITHUB_OUTPUT
run: echo "secret_exist=${{ secrets.TEAMS_NOTIFICATION_WEBHOOK_URL != '' }}" >> "$GITHUB_OUTPUT"
- name: "Notify on publishing packages"
if: steps.check.outputs.secret_exist == 'true'
uses: nhs-england-tools/notify-msteams-action@v1.0.0
Expand Down
28 changes: 12 additions & 16 deletions .github/workflows/cicd-3-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@ name: "CI/CD deploy"

on:
workflow_dispatch:
inputs:
tag:
description: "This is the tag that is oging to be deployed"
required: true
default: "latest"

jobs:
metadata:
Expand All @@ -22,23 +17,24 @@ jobs:
python_version: ${{ steps.variables.outputs.python_version }}
terraform_version: ${{ steps.variables.outputs.terraform_version }}
version: ${{ steps.variables.outputs.version }}
tag: ${{ steps.variables.outputs.tag }}
steps:
- name: "Checkout code"
uses: actions/checkout@v6

- name: "Set CI/CD variables"
id: variables
run: |
datetime=$(date -u +'%Y-%m-%dT%H:%M:%S%z')
echo "build_datetime=$datetime" >> $GITHUB_OUTPUT
echo "build_timestamp=$(date --date=$datetime -u +'%Y%m%d%H%M%S')" >> $GITHUB_OUTPUT
echo "build_epoch=$(date --date=$datetime -u +'%s')" >> $GITHUB_OUTPUT
echo "nodejs_version=$(grep "^nodejs\s" .tool-versions | cut -f2 -d' ')" >> $GITHUB_OUTPUT
echo "python_version=$(grep "^python\s" .tool-versions | cut -f2 -d' ')" >> $GITHUB_OUTPUT
echo "terraform_version=$(grep "^terraform\s" .tool-versions | cut -f2 -d' ')" >> $GITHUB_OUTPUT
# TODO: Get the version, but it may not be the .version file as this should come from the CI/CD Pull Request Workflow
echo "version=$(head -n 1 .version 2> /dev/null || echo unknown)" >> $GITHUB_OUTPUT
echo "tag=${{ github.event.inputs.tag }}" >> $GITHUB_OUTPUT
{
echo "build_datetime=$datetime"
echo "build_timestamp=$(date --date="$datetime" -u +'%Y%m%d%H%M%S')"
echo "build_epoch=$(date --date="$datetime" -u +'%s')"
echo "nodejs_version=$(grep "^nodejs\s" .tool-versions | cut -f2 -d' ')"
echo "python_version=$(grep "^python\s" .tool-versions | cut -f2 -d' ')"
echo "terraform_version=$(grep "^terraform\s" .tool-versions | cut -f2 -d' ')"
# TODO: Get the version, but it may not be the .version file as this should come from the CI/CD Pull Request Workflow
echo "version=$(head -n 1 .version 2> /dev/null || echo unknown)"
} >> "$GITHUB_OUTPUT"
- name: "List variables"
run: |
export BUILD_DATETIME="${{ steps.variables.outputs.build_datetime }}"
Expand All @@ -48,8 +44,8 @@ jobs:
export PYTHON_VERSION="${{ steps.variables.outputs.python_version }}"
export TERRAFORM_VERSION="${{ steps.variables.outputs.terraform_version }}"
export VERSION="${{ steps.variables.outputs.version }}"
export TAG="${{ steps.variables.outputs.tag }}"
make list-variables

deploy:
name: "Deploy to an environment"
runs-on: ubuntu-latest
Expand Down
90 changes: 58 additions & 32 deletions .github/workflows/playwright-e2e.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
---
name: "Playwright E2E Tests"
run-name: "E2E Tests: env: ${{ inputs.environment || 'local' }}, browser: ${{ inputs.browser || 'chromium' }}, filter: ${{ inputs.test_filter && format(' - {0}', inputs.test_filter) || '' }}"

on:
schedule:
- cron: '0 2 * * *' # Every day at 2am UTC
workflow_dispatch:
inputs:
environment:
description: "Target environment"
required: false
default: "local"
type: choice
options:
- local
- dev
browser:
description: "Browser to run tests on"
required: false
Expand All @@ -27,15 +36,14 @@ jobs:
name: "Playwright E2E tests"
runs-on: ubuntu-latest
timeout-minutes: 30
env:
TARGET_ENV: ${{ inputs.environment || 'local' }}
steps:
- name: "Checkout code"
uses: actions/checkout@v6

- name: "Install mise"
uses: jdx/mise-action@v3
with:
install: true
cache: true
- name: Initialize mise
uses: ./.github/actions/init-mise

- name: "Install Playwright browsers"
working-directory: tests
Expand All @@ -57,34 +65,50 @@ jobs:
EOF

- name: "Start the application"
if: env.TARGET_ENV == 'local' || env.TARGET_ENV == 'dev'
run: |
npm run start

- name: "Show application status"
if: env.TARGET_ENV == 'local' || env.TARGET_ENV == 'dev'
run: |
docker compose -f local-environment/docker-compose.yml ps
docker logs ui

- name: "Get terraform outputs"
if: env.TARGET_ENV == 'local' || env.TARGET_ENV == 'dev'
id: terraform
run: |
UI_URL=$(terraform -chdir=local-environment/infra output -raw ui_url)
API_URL=$(terraform -chdir=local-environment/infra output -raw api_base_url)
Comment on lines 67 to 83
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

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

For TARGET_ENV=dev this job still starts the local application and fetches terraform outputs, but later overrides URLs to point at the remote dev environment. This adds unnecessary runtime and risk of failure. Consider making these steps conditional on TARGET_ENV == 'local' only (and skip terraform/docker when running against remote dev).

Copilot uses AI. Check for mistakes.
echo "ui_url=$UI_URL" >> $GITHUB_OUTPUT
echo "api_base_url=$API_URL" >> $GITHUB_OUTPUT
echo "ui_url=$UI_URL" >> "$GITHUB_OUTPUT"
echo "api_base_url=$API_URL" >> "$GITHUB_OUTPUT"
echo "UI URL: $UI_URL"
echo "API URL: $API_URL"

- name: "Set environment URLs"
id: urls
run: |
if [ "$TARGET_ENV" == "dev" ]; then
echo "ui_url=https://dev.hometest.service.nhs.uk" >> "$GITHUB_OUTPUT"
echo "api_url=https://dev.hometest.service.nhs.uk/" >> "$GITHUB_OUTPUT"
else
echo "ui_url=${{ steps.terraform.outputs.ui_url }}" >> "$GITHUB_OUTPUT"
echo "api_url=${{ steps.terraform.outputs.api_base_url }}" >> "$GITHUB_OUTPUT"
fi
Comment on lines +92 to +98
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

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

For TARGET_ENV=dev, api_url is set to https://dev.hometest.service.nhs.uk/, but the test framework default apiBaseUrl includes the /api prefix (e.g. http://localhost:4000/api) and API clients build URLs relative to that. Unless the dev API is actually hosted at the root, this will produce incorrect request URLs; align the dev api_url with the expected API base path (and keep it consistent with local/terraform outputs).

Copilot uses AI. Check for mistakes.

- name: "Wait for UI to be reachable"
run: |
UI_URL="${{ steps.terraform.outputs.ui_url }}"
UI_URL="${{ steps.urls.outputs.ui_url }}"
echo "Waiting for UI to be reachable at $UI_URL..."
timeout=120
elapsed=0
until curl -sf "$UI_URL" > /dev/null 2>&1; do
if [ $elapsed -ge $timeout ]; then
echo "Timeout: UI not reachable after ${timeout}s"
docker logs ui
if [ "$TARGET_ENV" == "local" ] || [ "$TARGET_ENV" == "dev" ]; then
docker logs ui
fi
exit 1
fi
echo "Waiting... (${elapsed}s)"
Expand All @@ -101,7 +125,7 @@ jobs:
FILTER="${{ inputs.test_filter }}"

# Build the command
CMD="npx playwright test"
CMD="HEADLESS=true ENV=dev npx playwright test"

# Add browser project
if [ "$BROWSER" != "all" ]; then
Expand All @@ -114,19 +138,19 @@ jobs:
fi

echo "Running: $CMD"
eval $CMD
eval "$CMD"
env:
CI: true
FORCE_COLOR: true
UI_BASE_URL: ${{ steps.terraform.outputs.ui_url }}
API_BASE_URL: ${{ steps.terraform.outputs.api_base_url }}
UI_BASE_URL: ${{ steps.urls.outputs.ui_url }}
API_BASE_URL: ${{ steps.urls.outputs.api_url }}

- name: "Grab docker compose logs"
if: always() && (env.TARGET_ENV == 'local' || env.TARGET_ENV == 'dev')
run: |
for service in $(docker compose -f local-environment/docker-compose.yml ps --services); do
docker compose -f local-environment/docker-compose.yml logs "$service" > "tests/testResults/docker-compose-${service}.log" 2>&1
done
if: always()

- name: "Publish Test Results"
uses: dorny/test-reporter@v2
Expand All @@ -140,24 +164,26 @@ jobs:
- name: "Generate Job Summary"
if: always()
run: |
echo "## Playwright Test Results" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
if [ -f tests/testResults/junit-results.xml ]; then
TESTS=$(grep -oP 'tests="\K[0-9]+' tests/testResults/junit-results.xml | head -1)
FAILURES=$(grep -oP 'failures="\K[0-9]+' tests/testResults/junit-results.xml | head -1)
ERRORS=$(grep -oP 'errors="\K[0-9]+' tests/testResults/junit-results.xml | head -1)
TIME=$(grep -oP 'time="\K[0-9.]+' tests/testResults/junit-results.xml | head -1)
PASSED=$((TESTS - FAILURES - ERRORS))
echo "| Metric | Value |" >> $GITHUB_STEP_SUMMARY
echo "|--------|-------|" >> $GITHUB_STEP_SUMMARY
echo "| Total Tests | $TESTS |" >> $GITHUB_STEP_SUMMARY
echo "| :white_check_mark: Passed | $PASSED |" >> $GITHUB_STEP_SUMMARY
echo "| :x: Failed | $FAILURES |" >> $GITHUB_STEP_SUMMARY
echo "| :warning: Errors | $ERRORS |" >> $GITHUB_STEP_SUMMARY
echo "| :stopwatch: Duration | ${TIME}s |" >> $GITHUB_STEP_SUMMARY
else
echo ":warning: No test results found" >> $GITHUB_STEP_SUMMARY
fi
{
echo "## Playwright Test Results"
echo ""
if [ -f tests/testResults/junit-results.xml ]; then
TESTS=$(grep -oP 'tests="\K[0-9]+' tests/testResults/junit-results.xml | head -1)
FAILURES=$(grep -oP 'failures="\K[0-9]+' tests/testResults/junit-results.xml | head -1)
ERRORS=$(grep -oP 'errors="\K[0-9]+' tests/testResults/junit-results.xml | head -1)
TIME=$(grep -oP 'time="\K[0-9.]+' tests/testResults/junit-results.xml | head -1)
PASSED=$((TESTS - FAILURES - ERRORS))
echo "| Metric | Value |"
echo "|--------|-------|"
echo "| Total Tests | $TESTS |"
echo "| :white_check_mark: Passed | $PASSED |"
echo "| :x: Failed | $FAILURES |"
echo "| :warning: Errors | $ERRORS |"
echo "| :stopwatch: Duration | ${TIME}s |"
else
echo ":warning: No test results found"
fi
} >> "$GITHUB_STEP_SUMMARY"

- name: "Upload test results"
uses: actions/upload-artifact@v7
Expand Down
9 changes: 8 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,20 @@ repos:
args: [--markdown-linebreak-ext=md]
- id: end-of-file-fixer
- id: check-yaml
args: [--allow-multiple-documents]
- id: check-json
- id: check-toml
- id: check-added-large-files
args: ["--maxkb=500"]
- id: check-case-conflict
- id: check-merge-conflict
- id: check-symlinks
- id: detect-private-key
- id: check-executables-have-shebangs
- id: forbid-submodules
- id: mixed-line-ending
args: [--fix=lf]
- id: no-commit-to-branch
args: [--branch, main, --branch, master, --branch, develop]

- repo: local
hooks:
Expand Down
2 changes: 0 additions & 2 deletions local-environment/scripts/localstack/deploy.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
#!/bin/bash
set -ex
SCRIPT_DIR=$(dirname "$0")

ENDPOINT_URL="http://localstack:4566"
ROLE_ARN="arn:aws:iam::000000000000:role/lambda-exec"

export AWS_ACCESS_KEY_ID="test"
export AWS_SECRET_ACCESS_KEY="test"
Expand Down
2 changes: 1 addition & 1 deletion local-environment/scripts/localstack/get_supplier_id.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
set -e

for i in {1..10}; do
for _ in {1..10}; do
SUPPLIER_ID=$(docker exec postgres-db psql "postgresql://app_user:STRONG_APP_PASSWORD@localhost:5432/local_hometest_db" -A -t -c "SET search_path TO hometest; SELECT supplier_id FROM supplier LIMIT 1;" 2>/dev/null | grep -v '^$' | grep -v '^SET$' | head -n 1 || echo "")
if [[ -n "$SUPPLIER_ID" ]]; then
echo "{\"supplier_id\": \"$SUPPLIER_ID\"}"
Expand Down
Loading
Loading