Skip to content

Commit 464fc44

Browse files
authored
CCM-11353: Add automated tests for event publishing (#631)
1 parent caf1c40 commit 464fc44

File tree

26 files changed

+834
-170
lines changed

26 files changed

+834
-170
lines changed

.github/actions/test-types.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[
22
"accessibility",
3+
"api",
4+
"event",
35
"ui-component",
4-
"ui-e2e",
5-
"api"
6+
"ui-e2e"
67
]

docs/testing/index.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

infrastructure/terraform/components/sandbox/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
|------|--------|---------|
2929
| <a name="module_backend_api"></a> [backend\_api](#module\_backend\_api) | ../../modules/backend-api | n/a |
3030
| <a name="module_cognito_triggers"></a> [cognito\_triggers](#module\_cognito\_triggers) | ../../modules/cognito-triggers | n/a |
31+
| <a name="module_eventpub"></a> [eventpub](#module\_eventpub) | git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/eventpub | v2.0.19 |
3132
## Outputs
3233

3334
| Name | Description |
@@ -38,6 +39,7 @@
3839
| <a name="output_cognito_user_pool_id"></a> [cognito\_user\_pool\_id](#output\_cognito\_user\_pool\_id) | n/a |
3940
| <a name="output_deployment"></a> [deployment](#output\_deployment) | Deployment details used for post-deployment scripts |
4041
| <a name="output_download_bucket_name"></a> [download\_bucket\_name](#output\_download\_bucket\_name) | n/a |
42+
| <a name="output_event_cache_bucket_name"></a> [event\_cache\_bucket\_name](#output\_event\_cache\_bucket\_name) | n/a |
4143
| <a name="output_internal_bucket_name"></a> [internal\_bucket\_name](#output\_internal\_bucket\_name) | n/a |
4244
| <a name="output_quarantine_bucket_name"></a> [quarantine\_bucket\_name](#output\_quarantine\_bucket\_name) | n/a |
4345
| <a name="output_request_proof_queue_url"></a> [request\_proof\_queue\_url](#output\_request\_proof\_queue\_url) | n/a |

infrastructure/terraform/components/sandbox/module_backend_api.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ module "backend_api" {
2727

2828
kms_key_arn = data.aws_kms_key.sandbox.arn
2929

30+
sns_topic_arn = module.eventpub.sns_topic.arn
31+
3032
send_to_firehose = false
3133

3234
enable_event_stream = true
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
module "eventpub" {
2+
source = "git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/eventpub?ref=v2.0.19"
3+
4+
name = "eventpub"
5+
6+
aws_account_id = var.aws_account_id
7+
component = var.component
8+
environment = var.environment
9+
project = var.project
10+
region = var.region
11+
group = var.group
12+
13+
log_retention_in_days = var.log_retention_in_days
14+
kms_key_arn = data.aws_kms_key.sandbox.arn
15+
16+
enable_event_cache = true
17+
enable_sns_delivery_logging = false
18+
enable_firehose_raw_message_delivery = true
19+
event_cache_buffer_interval = 0
20+
sns_success_logging_sample_percent = 0
21+
force_destroy = true
22+
23+
# In the context of sbx these planes are not needed but the module require them
24+
data_plane_bus_arn = aws_sns_topic.events.arn
25+
control_plane_bus_arn = aws_sns_topic.events.arn
26+
}

infrastructure/terraform/components/sandbox/outputs.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,7 @@ output "test_email_bucket_name" {
6565
output "test_email_bucket_prefix" {
6666
value = "emails-${var.environment}"
6767
}
68+
69+
output "event_cache_bucket_name" {
70+
value = module.eventpub.s3_bucket_event_cache.bucket
71+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
# this is not used for anything other than to keep the eventpub module happy
3+
resource "aws_sns_topic" "events" {
4+
name = "${local.csi}-events-sns"
5+
6+
kms_master_key_id = data.aws_kms_key.sandbox.arn
7+
}

local/.env.template

Lines changed: 0 additions & 2 deletions
This file was deleted.

local/README.md

Lines changed: 0 additions & 57 deletions
This file was deleted.

local/docker-compose.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)