From 650caafafb681f00d07fcc1c85b2d4c482103bad Mon Sep 17 00:00:00 2001 From: RLRabinowitz Date: Thu, 31 Aug 2023 16:40:42 +0300 Subject: [PATCH] Test: Refresh-only and refresh:false should fail validation Signed-off-by: RLRabinowitz --- internal/command/test_test.go | 4 ++++ .../testdata/test/refresh_conflicting_config/main.tf | 3 +++ .../test/refresh_conflicting_config/main.tftest.hcl | 6 ++++++ 3 files changed, 13 insertions(+) create mode 100644 internal/command/testdata/test/refresh_conflicting_config/main.tf create mode 100644 internal/command/testdata/test/refresh_conflicting_config/main.tftest.hcl diff --git a/internal/command/test_test.go b/internal/command/test_test.go index b9607fb6bb..f2b29e2871 100644 --- a/internal/command/test_test.go +++ b/internal/command/test_test.go @@ -227,6 +227,10 @@ func TestTest_Broken_Full_Output(t *testing.T) { expected: "Blocks of type \"check\" are not expected here.", code: 1, }, + "refresh_conflicting_config": { + expected: "Incompatible plan options", + code: 1, + }, } for name, tc := range tcs { t.Run(name, func(t *testing.T) { diff --git a/internal/command/testdata/test/refresh_conflicting_config/main.tf b/internal/command/testdata/test/refresh_conflicting_config/main.tf new file mode 100644 index 0000000000..41cc84e5c4 --- /dev/null +++ b/internal/command/testdata/test/refresh_conflicting_config/main.tf @@ -0,0 +1,3 @@ +resource "test_resource" "foo" { + value = "bar" +} diff --git a/internal/command/testdata/test/refresh_conflicting_config/main.tftest.hcl b/internal/command/testdata/test/refresh_conflicting_config/main.tftest.hcl new file mode 100644 index 0000000000..44a1c765f5 --- /dev/null +++ b/internal/command/testdata/test/refresh_conflicting_config/main.tftest.hcl @@ -0,0 +1,6 @@ +run "apply" { + plan_options { + mode=refresh-only + refresh=false + } +} \ No newline at end of file