Skip to content

Commit 74dd5e9

Browse files
authored
Run e2e tests at end of deployment (#903)
- Run e2e tests at end of deploy.yml - Update modules/service service_endpoint output to use custom domain if set - Tweak job names to improve readability of job workflows - Rename job names to " " when calling callable workflows - Shorten job names to be within 3 words
1 parent 186630d commit 74dd5e9

File tree

4 files changed

+26
-6
lines changed

4 files changed

+26
-6
lines changed

.github/workflows/deploy.yml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ jobs:
4242
contents: read
4343
id-token: write
4444

45+
outputs:
46+
service_endpoint: ${{ steps.deploy-release.outputs.service_endpoint }}
47+
4548
steps:
4649
- uses: actions/checkout@v4
4750

@@ -55,4 +58,17 @@ jobs:
5558
environment: ${{ inputs.environment }}
5659

5760
- name: Deploy release
58-
run: make release-deploy APP_NAME=${{ inputs.app_name }} ENVIRONMENT=${{ inputs.environment }} IMAGE_TAG=${{ needs.database-migrations.outputs.commit_hash }}
61+
id: deploy-release
62+
run: |
63+
make release-deploy APP_NAME=${{ inputs.app_name }} ENVIRONMENT=${{ inputs.environment }} IMAGE_TAG=${{ needs.database-migrations.outputs.commit_hash }}
64+
service_endpoint=$(terraform -chdir="infra/${{ inputs.app_name }}/service" output -raw service_endpoint)
65+
echo "service_endpoint=${service_endpoint}"
66+
echo "service_endpoint=${service_endpoint}" >> "$GITHUB_OUTPUT"
67+
68+
e2e:
69+
name: " " # GitHub UI is noisy when calling reusable workflows, so use whitespace for name to reduce noise
70+
needs: [deploy]
71+
uses: ./.github/workflows/e2e-tests.yml
72+
with:
73+
app_name: ${{ inputs.app_name }}
74+
service_endpoint: ${{ needs.deploy.outputs.service_endpoint }}

.github/workflows/e2e-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ on:
2323

2424
jobs:
2525
e2e:
26-
name: Run E2E tests (${{ matrix.shard }} of ${{ matrix.total_shards }})
26+
name: E2E tests (${{ matrix.shard }} of ${{ matrix.total_shards }})
2727
runs-on: ubuntu-latest
2828

2929
strategy:
@@ -62,7 +62,7 @@ jobs:
6262
retention-days: 1
6363

6464
create-report:
65-
name: Create merged test report
65+
name: E2E test report
6666
if: ${{ !cancelled() }}
6767
needs: e2e
6868
runs-on: ubuntu-latest

infra/modules/service/dns.tf

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1+
locals {
2+
domain_name = !var.is_temporary && var.domain_name != null ? var.domain_name : null
3+
}
4+
15
resource "aws_route53_record" "app" {
26
# Don't create DNS record for temporary environments (e.g. ones spun up by CI/)
3-
count = !var.is_temporary && var.domain_name != null && var.hosted_zone_id != null ? 1 : 0
7+
count = local.domain_name != null && var.hosted_zone_id != null ? 1 : 0
48

5-
name = var.domain_name
9+
name = local.domain_name
610
zone_id = var.hosted_zone_id
711
type = "A"
812
alias {

infra/modules/service/outputs.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ output "migrator_role_arn" {
2222

2323
output "public_endpoint" {
2424
description = "The public endpoint for the service."
25-
value = "${var.certificate_arn != null ? "https" : "http"}://${aws_lb.alb.dns_name}"
25+
value = "${var.certificate_arn != null ? "https" : "http"}://${local.domain_name != null ? local.domain_name : aws_lb.alb.dns_name}"
2626
}

0 commit comments

Comments
 (0)