Skip to content

Commit

Permalink
Adiciona assert para validar agrupamento por Kind
Browse files Browse the repository at this point in the history
  • Loading branch information
daltonmatos committed Sep 21, 2024
1 parent 89d5d96 commit 5816183
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/test_output_by_apigroup.tftest.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,25 @@ run "valida_output_por_apigroup" {
condition = length(keys(module.groupResources.groupedResources)) == 1
error_message = "Deveria haver apenas um apigroup: gcp.iam"
}

}

run "valida_output_por_kind" {
command = plan
variables {
yamls = [
"tests/fixtures/user.gcp.iam.crd.yaml",
"tests/fixtures/user.gcp.iam.manifest.yaml",
]
}


assert {
condition = length(
keys(
try(module.groupResources.groupedResources["gcp.iam"]["User"], {})
)
) == 2
error_message = "Não agrupou pelo kind User"
}
}

0 comments on commit 5816183

Please sign in to comment.