Skip to content

Commit

Permalink
Initial test changes to make them run at all without being logged int…
Browse files Browse the repository at this point in the history
…o AWS
  • Loading branch information
WillGibson committed Oct 24, 2024
1 parent 2c89758 commit e6fce2f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 6 additions & 6 deletions extensions/tests/unit.tftest.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ mock_provider "aws" {
alias = "domain-cdn"
}

mock_provider "aws" {}

override_data {
target = module.opensearch["test-opensearch"].data.aws_vpc.vpc
values = {
Expand All @@ -61,41 +63,39 @@ override_data {
run "aws_ssm_parameter_unit_test" {
command = plan

# Configuration
assert {
condition = aws_ssm_parameter.addons.name == "/copilot/applications/test-application/environments/test-environment/addons"
error_message = "Invalid config for aws_ssm_parameter name"
}

assert {
condition = aws_ssm_parameter.addons.tier == "Intelligent-Tiering"
error_message = "Intelligent-Tiering not enabled, parameters > 4096 characters will be rejected"
}

assert {
condition = aws_ssm_parameter.addons.type == "String"
error_message = "Invalid config for aws_ssm_parameter type"
}

# Value

# Tags
assert {
condition = aws_ssm_parameter.addons.tags["application"] == "test-application"
error_message = ""
}

assert {
condition = aws_ssm_parameter.addons.tags["copilot-application"] == "test-application"
error_message = ""
}

assert {
condition = aws_ssm_parameter.addons.tags["environment"] == "test-environment"
error_message = ""
}

assert {
condition = aws_ssm_parameter.addons.tags["copilot-environment"] == "test-environment"
error_message = ""
}

assert {
condition = aws_ssm_parameter.addons.tags["managed-by"] == "DBT Platform - Terraform"
error_message = ""
Expand Down
2 changes: 2 additions & 0 deletions opensearch/tests/unit.tftest.hcl
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
mock_provider "aws" {}

override_data {
target = data.aws_vpc.vpc
values = {
Expand Down

0 comments on commit e6fce2f

Please sign in to comment.