Skip to content

Conversation

@josielsouzanordcloud
Copy link
Contributor

@josielsouzanordcloud josielsouzanordcloud commented Oct 23, 2025

Fix smoke test for production apex domain configuration

Description

Fixed smoke test script to support apex domain configuration for production environment. The smoke test was failing because it was constructing URLs as {env}.{domain}/sha for all environments, but production uses an apex domain configuration (use_apex_domain = true) which requires just {domain}/sha.

Changes Made

1. Updated smoke test script

  • Added USE_APEX_DOMAIN parameter (5th parameter) to container_app_smoke_test.sh
  • Added conditional logic to construct URLs based on apex domain flag:
    • When USE_APEX_DOMAIN=true: uses https://{DNS_ZONE_NAME}/sha
    • When USE_APEX_DOMAIN=false: uses https://{ENV_CONFIG}.{DNS_ZONE_NAME}/sha
    • For PR environments: always uses https://pr-{PR_NUMBER}.{DNS_ZONE_NAME}/sha
  • Defaults to false for backward compatibility

2. Updated GitHub workflow

  • Modified .github/workflows/stage-4-deploy.yaml to extract use_apex_domain from environment's variables.tfvars
  • Passes the use_apex_domain value as 5th parameter to smoke test script
  • Falls back to "false" if variable not present in tfvars

3. Added documentation

  • Added "Smoke Testing" section to docs/infrastructure/infra-faq.md
  • Documents common smoke test failure scenarios including apex domain misconfiguration
  • Provides troubleshooting steps for 404/timeout issues

Testing

Tested locally with:

# Dev environment
scripts/bash/container_app_smoke_test.sh dev <sha> manage-breast-screening.non-live.screening.nhs.uk "" false

# Production environment  
scripts/bash/container_app_smoke_test.sh prod <sha> manage-breast-screening.nhs.uk "" true

## Jira link

## Review notes

<!-- Add notable context, discussion items, and anything else that would be helpful for a reviewer to know. -->

- Add USE_APEX_DOMAIN parameter to container_app_smoke_test.sh
- Update workflow to pass use_apex_domain from environment config
- Add smoke test troubleshooting docs to infra-faq.md

Fixes smoke test failures for production environment which uses
apex domain (manage-breast-screening.nhs.uk) instead of subdomain
(prod.manage-breast-screening.nhs.uk).
@josielsouzanordcloud josielsouzanordcloud merged commit 8f64efd into main Oct 23, 2025
12 checks passed
@josielsouzanordcloud josielsouzanordcloud deleted the DTOSS-11410-amend-smoke-test-to-handle-apex-domain branch October 23, 2025 15:54
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.

2 participants