I am getting the following error messages running Terraform test:
│ Error: Failed to clean up after tests
│
│ Due to errors during destroy, test suite "defaults" has left behind an object for module.ns_checks.module.namespaces.aws_iam_role.ns_editor["pm"], with the following identity:
│ name = "editor-ns"
│
│ You will need to delete this object manually in the remote system, or else it may have an ongoing cost.
╵
╷
│ Error: Failed to clean up after tests
│
│ Due to errors during destroy, test suite "defaults" has left behind an object for module.ns_checks.module.namespaces.aws_iam_role.ns_editor["cs"], with the following identity:
│ name = "s-editor"
│
│ You will need to delete this object manually in the remote system, or else it may have an ongoing cost.
╵
╷
│ Error: Failed to clean up after tests
│
│ Due to errors during destroy, test suite "defaults" has left behind an object for module.ns_checks.module.namespaces.aws_iam_role.ns_editor["as"], with the following identity:
│ name = "editor"
│
│ You will need to delete this object manually in the remote system, or else it may have an ongoing cost.
╵
Success! All of the test assertions passed.
However, the test runs successfully , and the resources are also getting deleted … Can i know how to get rid of this error.
I also manually tried doing init/plan and apply/destroy in the test directory and it was successfull, but when i run the terraform test it thows these errors.
I also tried with incorrect outputs as well and it fails as expected
Error: Failed to clean up after tests
│
│ Due to errors during destroy, test suite "defaults" has left behind an object for module.ns_checks.module.namespaces.null_resource.ns_admin["cs"]. You will need to delete this object manually in the remote system, or else it may
│ have an ongoing cost.
╵
╷
│ Error: Failed to clean up after tests
│
│ Due to errors during destroy, test suite "defaults" has left behind an object for module.ns_checks.module.namespaces.null_resource.ns_admin["as"]. You will need to delete this object manually in the remote system, or else it may
│ have an ongoing cost.
╵
╷
│ Error: Failed to clean up after tests
│
│ Due to errors during destroy, test suite "defaults" has left behind an object for module.ns_checks.module.namespaces.null_resource.ns_admin["pm"]. You will need to delete this object manually in the remote system, or else it may
│ have an ongoing cost.
╵
─── Failed: defaults.ns_name1.name (Check the ns)
wrong value
got: "pm"
want: "as"
─── Failed: defaults.ns_name2.name (Check the ns)
wrong value
got: "as"
want: "cs"
─── Failed: defaults.ns_name3.name (Check the ns)
wrong value
got: "cs"
want: "pm"
Ref : Integration testing with Terraform 0.15 - The Scale Factory
Kindly advice how to get rid of those errors