Skip to content

Commit

Permalink
ajusta os testes para rodar no terrafo 1.6.x
Browse files Browse the repository at this point in the history
  • Loading branch information
lukerops committed Jul 18, 2024
1 parent d333f09 commit b4d3cde
Showing 1 changed file with 30 additions and 33 deletions.
63 changes: 30 additions & 33 deletions manifestValidation/tests/unit.tftest.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ run "missing_apiVersion" {

variables {
path = "."
text = yamlencode({})
text = "{}"
}

expect_failures = [
Expand All @@ -29,9 +29,9 @@ run "invalid_apiVersion" {

variables {
path = "."
text = yamlencode({
apiVersion = "test.group",
})
text = <<-EOT
"apiVersion": "test.group"
EOT
}

expect_failures = [
Expand All @@ -44,9 +44,9 @@ run "missing_kind" {

variables {
path = "."
text = yamlencode({
apiVersion = "test.group/v1alpha1",
})
text = <<-EOT
"apiVersion": "test.group/v1alpha1"
EOT
}

expect_failures = [
Expand All @@ -59,10 +59,10 @@ run "missing_metadata" {

variables {
path = "."
text = yamlencode({
apiVersion = "test.group/v1alpha1",
kind = "Test",
})
text = <<-EOT
"apiVersion": "test.group/v1alpha1"
"kind": "Test"
EOT
}

expect_failures = [
Expand All @@ -75,11 +75,11 @@ run "missing_metadata_name" {

variables {
path = "."
text = yamlencode({
apiVersion = "test.group/v1alpha1",
kind = "Test",
metadata = {},
})
text = <<-EOT
"apiVersion": "test.group/v1alpha1"
"kind": "Test"
"metadata": {}
EOT
}

expect_failures = [
Expand All @@ -92,13 +92,12 @@ run "missing_spec" {

variables {
path = "."
text = yamlencode({
apiVersion = "test.group/v1alpha1",
kind = "Test",
metadata = {
name = "test",
},
})
text = <<-EOT
"apiVersion": "test.group/v1alpha1"
"kind": "Test"
"metadata":
"name": "test"
EOT
}

expect_failures = [
Expand All @@ -111,16 +110,14 @@ run "with_valid_manifest" {

variables {
path = "."
text = yamlencode({
apiVersion = "test.group/v1alpha1",
kind = "Test",
metadata = {
name = "test",
},
spec = {
test = "test",
}
})
text = <<-EOT
"apiVersion": "test.group/v1alpha1"
"kind": "Test"
"metadata":
"name": "test"
"spec":
"test": "test"
EOT
}

assert {
Expand Down

0 comments on commit b4d3cde

Please sign in to comment.