-
Notifications
You must be signed in to change notification settings - Fork 509
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added unit tests for breaking changes case
- Loading branch information
Devang Gaur
committed
Jan 15, 2021
1 parent
b1c5360
commit a359304
Showing
6 changed files
with
71 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
pkg/iac-providers/terraform/v12/testdata/destroy-provisioners/main.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
locals { | ||
user = "name" | ||
} | ||
|
||
resource "null_resource" "a" { | ||
connection { | ||
host = self.hostname | ||
user = local.user # ERROR: Invalid reference from destroy provisioner | ||
} | ||
|
||
provisioner "remote-exec" { | ||
when = destroy | ||
index = count.index | ||
key = each.key | ||
|
||
// path and terraform values are static, and do not create any | ||
// dependencies. | ||
dir = path.module | ||
workspace = terraform.workspace | ||
} | ||
} | ||
|
||
resource "null_resource" "b" { | ||
connection { | ||
host = self.hostname | ||
# this is OK since there is no destroy provisioner | ||
user = local.user | ||
} | ||
|
||
provisioner "remote-exec" { | ||
} | ||
} | ||
|
||
resource "null_resource" "b" { | ||
provisioner "remote-exec" { | ||
when = destroy | ||
connection { | ||
host = self.hostname | ||
user = local.user # ERROR: Invalid reference from destroy provisioner | ||
} | ||
|
||
command = "echo ${local.name}" # ERROR: Invalid reference from destroy provisioner | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
pkg/iac-providers/terraform/v12/testdata/multiple-required-providers/a.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
terraform { | ||
required_providers { | ||
bar = { | ||
version = "~>1.0.0" | ||
} | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
pkg/iac-providers/terraform/v12/testdata/multiple-required-providers/b.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
terraform { | ||
required_providers { | ||
foo = { | ||
version = "~>2.0.0" | ||
} | ||
} | ||
} |