-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update minimum TF version; add tests (#6)
- Loading branch information
1 parent
b04ce2f
commit 30d308e
Showing
15 changed files
with
231 additions
and
8 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,9 +9,10 @@ jobs: | |
steps: | ||
- name: Generate Matrix | ||
id: matrix | ||
uses: Invicton-Labs/terraform-module-testing/matrix@v0.2.0 | ||
uses: Invicton-Labs/terraform-module-testing/matrix@v0.3.0 | ||
with: | ||
minimum_tf_version: '1.9.0' | ||
minimum_tf_version: '1.10.3' | ||
additional_runners: 'macos-13, windows-2019' | ||
|
||
- name: Output Matrix | ||
run: | | ||
|
@@ -28,25 +29,119 @@ jobs: | |
steps: | ||
- name: Initialize - Pass | ||
id: init-pass | ||
uses: Invicton-Labs/terraform-module-testing/initialize@v0.2.0 | ||
uses: Invicton-Labs/terraform-module-testing/initialize@v0.3.0 | ||
with: | ||
tf_path: tests/pass | ||
- name: Run Tests - Pass | ||
id: tests-pass | ||
uses: Invicton-Labs/terraform-module-testing/apply-destroy@v0.2.0 | ||
uses: Invicton-Labs/terraform-module-testing/apply-destroy@v0.3.0 | ||
with: | ||
tf_path: tests/pass | ||
|
||
- name: Initialize - Pass (With Output) | ||
id: init-pass-output | ||
uses: Invicton-Labs/terraform-module-testing/[email protected] | ||
with: | ||
tf_path: tests/pass-output | ||
- name: Run Tests - Pass (With Output) | ||
id: tests-pass-output | ||
uses: Invicton-Labs/terraform-module-testing/[email protected] | ||
with: | ||
tf_path: tests/pass-output | ||
|
||
- name: Initialize - Pass - Condition Delayed | ||
id: init-pass-condition-delayed | ||
uses: Invicton-Labs/terraform-module-testing/[email protected] | ||
with: | ||
tf_path: tests/pass-condition-delayed | ||
- name: Run Tests - Pass - Condition Delayed | ||
id: tests-pass-condition-delayed | ||
uses: Invicton-Labs/terraform-module-testing/[email protected] | ||
with: | ||
tf_path: tests/pass-condition-delayed | ||
|
||
- name: Initialize - Pass - Message Delayed | ||
id: init-pass-message-delayed | ||
uses: Invicton-Labs/terraform-module-testing/[email protected] | ||
with: | ||
tf_path: tests/pass-message-delayed | ||
- name: Run Tests - Pass - Message Delayed | ||
id: tests-pass-message-delayed | ||
uses: Invicton-Labs/terraform-module-testing/[email protected] | ||
with: | ||
tf_path: tests/pass-message-delayed | ||
stderr_contains: Unsuitable value for error message | ||
|
||
- name: Initialize - Pass - Condition & Message Delayed | ||
id: init-pass-condition-message-delayed | ||
uses: Invicton-Labs/terraform-module-testing/[email protected] | ||
with: | ||
tf_path: tests/pass-condition-message-delayed | ||
- name: Run Tests - Pass - Condition & Message Delayed | ||
id: tests-pass-condition-message-delayed | ||
uses: Invicton-Labs/terraform-module-testing/[email protected] | ||
with: | ||
tf_path: tests/pass-condition-message-delayed | ||
|
||
- name: Initialize - Fail | ||
id: init-fail | ||
uses: Invicton-Labs/terraform-module-testing/initialize@v0.2.0 | ||
uses: Invicton-Labs/terraform-module-testing/initialize@v0.3.0 | ||
with: | ||
tf_path: tests/fail | ||
- name: Run Tests - Fail | ||
id: tests-fail | ||
uses: Invicton-Labs/terraform-module-testing/apply-failure@v0.2.0 | ||
uses: Invicton-Labs/terraform-module-testing/apply-failure@v0.3.0 | ||
with: | ||
tf_path: tests/fail | ||
stderr_contains: sample error | ||
|
||
- name: Initialize - Fail (Output) | ||
id: init-fail-output | ||
uses: Invicton-Labs/terraform-module-testing/[email protected] | ||
with: | ||
tf_path: tests/fail-output | ||
- name: Run Tests - Fail (Output) | ||
id: tests-fail-output | ||
uses: Invicton-Labs/terraform-module-testing/[email protected] | ||
with: | ||
tf_path: tests/fail-output | ||
stderr_contains: sample error | ||
|
||
- name: Initialize - Fail - Condition Delayed | ||
id: init-fail-condition-delayed | ||
uses: Invicton-Labs/terraform-module-testing/[email protected] | ||
with: | ||
tf_path: tests/fail-condition-delayed | ||
- name: Run Tests - Fail - Condition Delayed | ||
id: tests-fail-condition-delayed | ||
uses: Invicton-Labs/terraform-module-testing/[email protected] | ||
with: | ||
tf_path: tests/fail-condition-delayed | ||
stderr_contains: sample error | ||
|
||
- name: Initialize - Fail - Message Delayed | ||
id: init-fail-message-delayed | ||
uses: Invicton-Labs/terraform-module-testing/[email protected] | ||
with: | ||
tf_path: tests/fail-message-delayed | ||
- name: Run Tests - Fail - Message Delayed | ||
id: tests-fail-message-delayed | ||
uses: Invicton-Labs/terraform-module-testing/[email protected] | ||
with: | ||
tf_path: tests/fail-message-delayed | ||
stderr_contains: Unsuitable value for error message | ||
|
||
- name: Initialize - Fail - Condition & Message Delayed | ||
id: init-fail-condition-message-delayed | ||
uses: Invicton-Labs/terraform-module-testing/[email protected] | ||
with: | ||
tf_path: tests/fail-condition-message-delayed | ||
- name: Run Tests - Fail - Condition & Message Delayed | ||
id: tests-fail-condition-message-delayed | ||
uses: Invicton-Labs/terraform-module-testing/[email protected] | ||
with: | ||
tf_path: tests/fail-condition-message-delayed | ||
stderr_contains: sample error | ||
|
||
# This job just waits for all other jobs to pass. We have it here | ||
# so our branch protection rule can reference a single job, instead | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module "fail" { | ||
source = "../../" | ||
// Use a condition that isn't known until the apply step | ||
condition = uuid() == "" | ||
error_message = "sample error" | ||
} |
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 @@ | ||
module "fail" { | ||
source = "../../" | ||
// Use a condition that isn't known until the apply step | ||
condition = uuid() == "" | ||
// Use a message that isn't known until the apply step | ||
error_message = "sample error: ${uuid()}" | ||
} |
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,6 @@ | ||
module "fail" { | ||
source = "../../" | ||
condition = false | ||
// Use a message that isn't known until the apply step | ||
error_message = "sample error: ${uuid()}" | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,11 @@ | ||
module "fail" { | ||
source = "../../" | ||
condition = false | ||
error_message = "sample error" | ||
} | ||
|
||
// Force the module and conditions to be evaluated | ||
// by using the module output in a config output. | ||
output "result" { | ||
value = module.fail.checked | ||
} |
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,6 @@ | ||
module "pass" { | ||
source = "../../" | ||
// Use a condition that isn't known until the apply step | ||
condition = uuid() != "" | ||
error_message = "sample error" | ||
} |
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 @@ | ||
module "pass" { | ||
source = "../../" | ||
// Use a condition that isn't known until the apply step | ||
condition = uuid() != "" | ||
// Use a message that isn't known until the apply step | ||
error_message = "sample error: ${uuid()}" | ||
} |
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,6 @@ | ||
module "pass" { | ||
source = "../../" | ||
condition = true | ||
// Use a message that isn't known until the apply step | ||
error_message = "sample error: ${uuid()}" | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,11 @@ | ||
module "pass" { | ||
source = "../../" | ||
condition = true | ||
error_message = "sample error" | ||
} | ||
|
||
// Force the module and conditions to be evaluated | ||
// by using the module output in a config output. | ||
output "result" { | ||
value = module.pass.checked | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
terraform { | ||
required_version = ">= 1.9.0" | ||
required_version = ">= 1.10.3" | ||
} |