expect_runtime_check_fail_command_plan

This commit is contained in:
Elbaz 2023-08-29 11:17:22 +03:00
parent 94400dfebb
commit a444b7e6f2
3 changed files with 20 additions and 1 deletions

View File

@ -84,6 +84,10 @@ func TestTest(t *testing.T) {
expected: "0 passed, 1 failed.",
code: 1,
},
"expect_runtime_check_fail_command_plan": {
expected: "0 passed, 1 failed.",
code: 1,
},
"expect_failures_resources": {
expected: "1 passed, 0 failed.",
code: 0,
@ -183,7 +187,7 @@ func TestTest(t *testing.T) {
})
}
}
func TestTest_Broken_HCL_Files(t *testing.T) {
func TestTest_Broken_Full_Output(t *testing.T) {
tcs := map[string]struct {
override string
args []string
@ -195,6 +199,10 @@ func TestTest_Broken_HCL_Files(t *testing.T) {
expected: "Unsupported block type",
code: 1,
},
"expect_runtime_check_fail_command_plan": {
expected: "Check block assertion known after apply",
code: 1,
},
"broken_wrong_block_resource": {
expected: "Blocks of type \"resource\" are not expected here.",
code: 1,

View File

@ -0,0 +1,8 @@
resource "test_resource" "resource" {}
check "check" {
assert {
condition = test_resource.resource.id == ""
error_message = "check block: resource has no id"
}
}

View File

@ -0,0 +1,3 @@
run "test" {
command = plan
}