Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.22
toolchain go1.22.3

require (
github.com/OctopusDeploy/go-octopusdeploy/v2 v2.64.0
github.com/OctopusDeploy/go-octopusdeploy/v2 v2.64.2
github.com/OctopusSolutionsEngineering/OctopusTerraformTestFramework v0.0.0-20241206032352-dbc62b2d16cf
github.com/google/uuid v1.6.0
github.com/hashicorp/go-cty v1.4.1-0.20200723130312-85980079f637
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ github.com/OctopusDeploy/go-octodiff v1.0.0 h1:U+ORg6azniwwYo+O44giOw6TiD5USk8S4
github.com/OctopusDeploy/go-octodiff v1.0.0/go.mod h1:Mze0+EkOWTgTmi8++fyUc6r0aLZT7qD9gX+31t8MmIU=
github.com/OctopusDeploy/go-octopusdeploy/v2 v2.64.0 h1:NWqQ/7JLUfEJQ8QHrkek7AfePuN121+f6+tUi3xP6vE=
github.com/OctopusDeploy/go-octopusdeploy/v2 v2.64.0/go.mod h1:ggvOXzMnq+w0pLg6C9zdjz6YBaHfO3B3tqmmB7JQdaw=
github.com/OctopusDeploy/go-octopusdeploy/v2 v2.64.2 h1:soRQnNPMLFiTm8tSH6fx3znFvTYOyGnTFYPAfpJH9e0=
github.com/OctopusDeploy/go-octopusdeploy/v2 v2.64.2/go.mod h1:ggvOXzMnq+w0pLg6C9zdjz6YBaHfO3B3tqmmB7JQdaw=
github.com/OctopusSolutionsEngineering/OctopusTerraformTestFramework v0.0.0-20241206032352-dbc62b2d16cf h1:wuUJ6DbSZEHE4a3SfSJIcoeTQCSI6lbQ+i46ibY14+Q=
github.com/OctopusSolutionsEngineering/OctopusTerraformTestFramework v0.0.0-20241206032352-dbc62b2d16cf/go.mod h1:xVv8DvYhhwxtQUQQDfOYA6CY8KTkHXccxQ2RfRj6IJ0=
github.com/ProtonMail/go-crypto v1.1.0-alpha.2 h1:bkyFVUP+ROOARdgCiJzNQo2V2kiB97LyUpzH9P6Hrlg=
Expand Down
16 changes: 13 additions & 3 deletions octopusdeploy_framework/resource_script_module_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@ package octopusdeploy_framework

import (
"fmt"
"path/filepath"
"testing"

"github.com/OctopusDeploy/go-octopusdeploy/v2/pkg/scriptmodules"
"github.com/OctopusDeploy/go-octopusdeploy/v2/pkg/variables"
"github.com/OctopusSolutionsEngineering/OctopusTerraformTestFramework/octoclient"
"github.com/OctopusSolutionsEngineering/OctopusTerraformTestFramework/test"
"github.com/hashicorp/terraform-plugin-testing/helper/acctest"
"github.com/hashicorp/terraform-plugin-testing/helper/resource"
"github.com/hashicorp/terraform-plugin-testing/terraform"
"path/filepath"
"testing"
)

func TestAccOctopusDeployScriptModuleBasic(t *testing.T) {
Expand Down Expand Up @@ -102,7 +104,7 @@ func TestScriptModuleResource(t *testing.T) {
Take: 1,
}

resources, err := client.LibraryVariableSets.Get(query)
resources, err := scriptmodules.Get(client, newSpaceId, query)
if err != nil {
t.Fatal(err.Error())
}
Expand All @@ -116,6 +118,14 @@ func TestScriptModuleResource(t *testing.T) {
t.Fatal("The library variable set must be have a description of \"Test script module\" (was \"" + resource.Description + "\")")
}

if resource.Syntax != "PowerShell" {
t.Fatal("The script module must have a syntax of \"PowerShell\" (was \"" + resource.Syntax + "\")")
}

if resource.ScriptBody != "echo \"hi\"" {
t.Fatal("The script module must have a script body of \"echo \"hi\"\" (was \"" + resource.ScriptBody + "\")")
}

variables, err := client.Variables.GetAll(resource.ID)

if len(variables.Variables) != 2 {
Expand Down
Loading