From 60bae0c69295c807ea35d25a61cbe7d6dcc0092f Mon Sep 17 00:00:00 2001 From: Kamil Kozik Date: Mon, 9 Mar 2026 21:23:33 +0100 Subject: [PATCH] add function tuples round-trip test suite --- .../hcl2_original/function_tuples.tf | 17 ++++++++++++++ .../hcl2_reconstructed/function_tuples.tf | 18 +++++++++++++++ .../json_reserialized/function_tuples.json | 22 +++++++++++++++++++ .../json_serialized/function_tuples.json | 22 +++++++++++++++++++ 4 files changed, 79 insertions(+) create mode 100644 test/integration/hcl2_original/function_tuples.tf create mode 100644 test/integration/hcl2_reconstructed/function_tuples.tf create mode 100644 test/integration/json_reserialized/function_tuples.json create mode 100644 test/integration/json_serialized/function_tuples.json diff --git a/test/integration/hcl2_original/function_tuples.tf b/test/integration/hcl2_original/function_tuples.tf new file mode 100644 index 00000000..8e60bcea --- /dev/null +++ b/test/integration/hcl2_original/function_tuples.tf @@ -0,0 +1,17 @@ +resource "octopusdeploy_process_templated_step" "step" { + parameters = { + "Octopus.Action.Aws.IamCapabilities" = jsonencode([ + "CAPABILITY_AUTO_EXPAND", + "CAPABILITY_IAM", + "CAPABILITY_NAMED_IAM", + ]) + } +} + +variable "list" { + default = toset([ + "a", + "b", + "c", + ]) +} diff --git a/test/integration/hcl2_reconstructed/function_tuples.tf b/test/integration/hcl2_reconstructed/function_tuples.tf new file mode 100644 index 00000000..0b436631 --- /dev/null +++ b/test/integration/hcl2_reconstructed/function_tuples.tf @@ -0,0 +1,18 @@ +resource "octopusdeploy_process_templated_step" "step" { + parameters = { + "Octopus.Action.Aws.IamCapabilities" = jsonencode([ + "CAPABILITY_AUTO_EXPAND", + "CAPABILITY_IAM", + "CAPABILITY_NAMED_IAM" + ]), + } +} + + +variable "list" { + default = toset([ + "a", + "b", + "c" + ]) +} diff --git a/test/integration/json_reserialized/function_tuples.json b/test/integration/json_reserialized/function_tuples.json new file mode 100644 index 00000000..6b645728 --- /dev/null +++ b/test/integration/json_reserialized/function_tuples.json @@ -0,0 +1,22 @@ +{ + "resource": [ + { + "\"octopusdeploy_process_templated_step\"": { + "\"step\"": { + "parameters": { + "\"Octopus.Action.Aws.IamCapabilities\"": "${jsonencode([\"CAPABILITY_AUTO_EXPAND\", \"CAPABILITY_IAM\", \"CAPABILITY_NAMED_IAM\"])}" + }, + "__is_block__": true + } + } + } + ], + "variable": [ + { + "\"list\"": { + "default": "${toset([\"a\", \"b\", \"c\"])}", + "__is_block__": true + } + } + ] +} diff --git a/test/integration/json_serialized/function_tuples.json b/test/integration/json_serialized/function_tuples.json new file mode 100644 index 00000000..6b645728 --- /dev/null +++ b/test/integration/json_serialized/function_tuples.json @@ -0,0 +1,22 @@ +{ + "resource": [ + { + "\"octopusdeploy_process_templated_step\"": { + "\"step\"": { + "parameters": { + "\"Octopus.Action.Aws.IamCapabilities\"": "${jsonencode([\"CAPABILITY_AUTO_EXPAND\", \"CAPABILITY_IAM\", \"CAPABILITY_NAMED_IAM\"])}" + }, + "__is_block__": true + } + } + } + ], + "variable": [ + { + "\"list\"": { + "default": "${toset([\"a\", \"b\", \"c\"])}", + "__is_block__": true + } + } + ] +}