From aab141f0fe8abd50aa5956d0b8d4f893bb11bbc8 Mon Sep 17 00:00:00 2001 From: Volodymyr Manilo Date: Fri, 11 Oct 2024 20:44:15 +0200 Subject: [PATCH 01/15] disable scheduled smoke tests --- .github/workflows/smoketests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/smoketests.yml b/.github/workflows/smoketests.yml index 99d43740..b3edaeee 100644 --- a/.github/workflows/smoketests.yml +++ b/.github/workflows/smoketests.yml @@ -4,8 +4,8 @@ name: Smoke Tests permissions: read-all on: - schedule: - - cron: "0 */3 * * *" +# schedule: +# - cron: "0 */3 * * *" workflow_dispatch: {} jobs: From 2a6146dfc9e2555e680fd5f046587136b89e2d0c Mon Sep 17 00:00:00 2001 From: Volodymyr Manilo Date: Fri, 11 Oct 2024 20:46:34 +0200 Subject: [PATCH 02/15] fix go.mod file --- go.mod | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 9545fca4..464d6026 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,7 @@ module github.com/Twingate/terraform-provider-twingate/v3 -go 1.22 +go 1.22.0 + toolchain go1.22.5 require ( From fb32b7d136a5a16daf808437103a0b4253f28e7b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 18 Oct 2024 06:29:44 -0700 Subject: [PATCH 03/15] Bump github.com/hashicorp/terraform-plugin-framework-validators from 0.13.0 to 0.14.0 (#589) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 9545fca4..2b242f1e 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/hashicorp/go-uuid v1.0.3 github.com/hashicorp/terraform-plugin-docs v0.19.4 github.com/hashicorp/terraform-plugin-framework v1.12.0 - github.com/hashicorp/terraform-plugin-framework-validators v0.13.0 + github.com/hashicorp/terraform-plugin-framework-validators v0.14.0 github.com/hashicorp/terraform-plugin-go v0.24.0 github.com/hashicorp/terraform-plugin-testing v1.10.0 github.com/hasura/go-graphql-client v0.13.1 diff --git a/go.sum b/go.sum index a8cd636f..a428c888 100644 --- a/go.sum +++ b/go.sum @@ -178,8 +178,8 @@ github.com/hashicorp/terraform-plugin-docs v0.19.4 h1:G3Bgo7J22OMtegIgn8Cd/CaSey github.com/hashicorp/terraform-plugin-docs v0.19.4/go.mod h1:4pLASsatTmRynVzsjEhbXZ6s7xBlUw/2Kt0zfrq8HxA= github.com/hashicorp/terraform-plugin-framework v1.12.0 h1:7HKaueHPaikX5/7cbC1r9d1m12iYHY+FlNZEGxQ42CQ= github.com/hashicorp/terraform-plugin-framework v1.12.0/go.mod h1:N/IOQ2uYjW60Jp39Cp3mw7I/OpC/GfZ0385R0YibmkE= -github.com/hashicorp/terraform-plugin-framework-validators v0.13.0 h1:bxZfGo9DIUoLLtHMElsu+zwqI4IsMZQBRRy4iLzZJ8E= -github.com/hashicorp/terraform-plugin-framework-validators v0.13.0/go.mod h1:wGeI02gEhj9nPANU62F2jCaHjXulejm/X+af4PdZaNo= +github.com/hashicorp/terraform-plugin-framework-validators v0.14.0 h1:3PCn9iyzdVOgHYOBmncpSSOxjQhCTYmc+PGvbdlqSaI= +github.com/hashicorp/terraform-plugin-framework-validators v0.14.0/go.mod h1:LwDKNdzxrDY/mHBrlC6aYfE2fQ3Dk3gaJD64vNiXvo4= github.com/hashicorp/terraform-plugin-go v0.24.0 h1:2WpHhginCdVhFIrWHxDEg6RBn3YaWzR2o6qUeIEat2U= github.com/hashicorp/terraform-plugin-go v0.24.0/go.mod h1:tUQ53lAsOyYSckFGEefGC5C8BAaO0ENqzFd3bQeuYQg= github.com/hashicorp/terraform-plugin-log v0.9.0 h1:i7hOA+vdAItN1/7UrfBqBwvYPQ9TFvymaRGZED3FCV0= From 5c0965af490fffba87b3c44a2a34182b09c78a34 Mon Sep 17 00:00:00 2001 From: Volodymyr Manilo <35466116+vmanilo@users.noreply.github.com> Date: Thu, 31 Oct 2024 14:13:30 +0100 Subject: [PATCH 04/15] Fix: warn message after plan (#590) --- go.mod | 3 +- twingate/internal/client/resource.go | 4 +-- .../internal/provider/resource/resource.go | 28 ++----------------- .../test/acctests/resource/resource_test.go | 17 +++++++---- 4 files changed, 18 insertions(+), 34 deletions(-) diff --git a/go.mod b/go.mod index 2b242f1e..5cbc4a19 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,7 @@ module github.com/Twingate/terraform-provider-twingate/v3 -go 1.22 +go 1.22.0 + toolchain go1.22.5 require ( diff --git a/twingate/internal/client/resource.go b/twingate/internal/client/resource.go index 6747af04..c3fa9135 100644 --- a/twingate/internal/client/resource.go +++ b/twingate/internal/client/resource.go @@ -92,8 +92,8 @@ func (client *Client) CreateResource(ctx context.Context, input *model.Resource) resource.IsBrowserShortcutEnabled = nil } - if input.SecurityPolicyID == nil { - resource.SecurityPolicyID = nil + if input.SecurityPolicyID != nil && *input.SecurityPolicyID == "" { + resource.SecurityPolicyID = input.SecurityPolicyID } return resource, nil diff --git a/twingate/internal/provider/resource/resource.go b/twingate/internal/provider/resource/resource.go index 4dc8e390..13dde557 100644 --- a/twingate/internal/provider/resource/resource.go +++ b/twingate/internal/provider/resource/resource.go @@ -773,9 +773,8 @@ func (r *twingateResource) Read(ctx context.Context, req resource.ReadRequest, r if resource != nil { resource.IsAuthoritative = convertAuthoritativeFlag(state.IsAuthoritative) - if state.SecurityPolicyID.ValueString() == "" { - emptyPolicy := "" - resource.SecurityPolicyID = &emptyPolicy + if state.SecurityPolicyID.IsNull() { + resource.SecurityPolicyID = nil } } @@ -1323,31 +1322,10 @@ func (m useDefaultPolicyForUnknownModifier) MarkdownDescription(_ context.Contex // PlanModifyString implements the plan modification logic. func (m useDefaultPolicyForUnknownModifier) PlanModifyString(ctx context.Context, req planmodifier.StringRequest, resp *planmodifier.StringResponse) { if req.StateValue.IsNull() && req.ConfigValue.IsNull() { - resp.PlanValue = types.StringPointerValue(nil) - - return - } - - // Do nothing if there is no state value. - if req.StateValue.IsNull() { - return - } - - // Do nothing if there is an unknown configuration value, otherwise interpolation gets messed up. - if req.ConfigValue.IsUnknown() { - return - } + resp.PlanValue = types.StringNull() - // Do nothing if there is a known planned value. - if req.ConfigValue.ValueString() != "" { return } - - if req.StateValue.ValueString() == "" && req.PlanValue.ValueString() == DefaultSecurityPolicyID { - resp.PlanValue = types.StringValue("") - } else if req.StateValue.ValueString() == DefaultSecurityPolicyID && req.PlanValue.ValueString() == "" { - resp.PlanValue = types.StringValue(DefaultSecurityPolicyID) - } } func accessGroupAttributeTypes() map[string]tfattr.Type { diff --git a/twingate/internal/test/acctests/resource/resource_test.go b/twingate/internal/test/acctests/resource/resource_test.go index b81df06c..ec07f6ef 100644 --- a/twingate/internal/test/acctests/resource/resource_test.go +++ b/twingate/internal/test/acctests/resource/resource_test.go @@ -3030,10 +3030,10 @@ func TestAccTwingateResourceUpdateSecurityPolicy(t *testing.T) { CheckDestroy: acctests.CheckTwingateResourceDestroy, Steps: []sdk.TestStep{ { - Config: createResourceWithSecurityPolicy(remoteNetworkName, resourceName, defaultPolicy), + Config: createResourceWithoutSecurityPolicy(remoteNetworkName, resourceName), Check: acctests.ComposeTestCheckFunc( acctests.CheckTwingateResourceExists(theResource), - sdk.TestCheckResourceAttr(theResource, attr.SecurityPolicyID, defaultPolicy), + sdk.TestCheckNoResourceAttr(theResource, attr.SecurityPolicyID), ), }, { @@ -3052,8 +3052,11 @@ func TestAccTwingateResourceUpdateSecurityPolicy(t *testing.T) { }, { Config: createResourceWithSecurityPolicy(remoteNetworkName, resourceName, ""), - // no changes - PlanOnly: true, + Check: acctests.ComposeTestCheckFunc( + acctests.CheckTwingateResourceExists(theResource), + sdk.TestCheckResourceAttr(theResource, attr.SecurityPolicyID, ""), + ), + ExpectNonEmptyPlan: true, }, }, }) @@ -3118,11 +3121,13 @@ func TestAccTwingateResourceSetDefaultSecurityPolicyByDefault(t *testing.T) { Check: acctests.ComposeTestCheckFunc( acctests.CheckResourceSecurityPolicy(theResource, defaultPolicy), ), + ExpectNonEmptyPlan: true, }, { Config: createResourceWithoutSecurityPolicy(remoteNetworkName, resourceName), - // no changes - PlanOnly: true, + Check: acctests.ComposeTestCheckFunc( + acctests.CheckResourceSecurityPolicy(theResource, defaultPolicy), + ), }, }, }) From 52e702de993526a1e407685b242c2842be43f5d8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 1 Nov 2024 06:26:32 -0700 Subject: [PATCH 05/15] Bump github.com/hashicorp/terraform-plugin-framework from 1.12.0 to 1.13.0 (#593) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 12 ++++++------ go.sum | 24 ++++++++++++------------ 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/go.mod b/go.mod index 5cbc4a19..5dc4c122 100644 --- a/go.mod +++ b/go.mod @@ -10,9 +10,9 @@ require ( github.com/hashicorp/go-retryablehttp v0.7.7 github.com/hashicorp/go-uuid v1.0.3 github.com/hashicorp/terraform-plugin-docs v0.19.4 - github.com/hashicorp/terraform-plugin-framework v1.12.0 + github.com/hashicorp/terraform-plugin-framework v1.13.0 github.com/hashicorp/terraform-plugin-framework-validators v0.14.0 - github.com/hashicorp/terraform-plugin-go v0.24.0 + github.com/hashicorp/terraform-plugin-go v0.25.0 github.com/hashicorp/terraform-plugin-testing v1.10.0 github.com/hasura/go-graphql-client v0.13.1 github.com/iancoleman/strcase v0.3.0 @@ -70,7 +70,7 @@ require ( github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 // indirect github.com/hashicorp/go-hclog v1.6.3 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect - github.com/hashicorp/go-plugin v1.6.1 // indirect + github.com/hashicorp/go-plugin v1.6.2 // indirect github.com/hashicorp/go-version v1.7.0 // indirect github.com/hashicorp/hc-install v0.8.0 // indirect github.com/hashicorp/hcl/v2 v2.21.0 // indirect @@ -122,10 +122,10 @@ require ( golang.org/x/tools v0.25.0 // indirect google.golang.org/api v0.198.0 // indirect google.golang.org/appengine v1.6.8 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240725223205-93522f1f2a9f // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect - google.golang.org/grpc v1.66.2 // indirect - google.golang.org/protobuf v1.34.2 // indirect + google.golang.org/grpc v1.67.1 // indirect + google.golang.org/protobuf v1.35.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index a428c888..7f35c9e0 100644 --- a/go.sum +++ b/go.sum @@ -155,8 +155,8 @@ github.com/hashicorp/go-hclog v1.6.3/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVH github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= -github.com/hashicorp/go-plugin v1.6.1 h1:P7MR2UP6gNKGPp+y7EZw2kOiq4IR9WiqLvp0XOsVdwI= -github.com/hashicorp/go-plugin v1.6.1/go.mod h1:XPHFku2tFo3o3QKFgSYo+cghcUhw1NA1hZyMK0PWAw0= +github.com/hashicorp/go-plugin v1.6.2 h1:zdGAEd0V1lCaU0u+MxWQhtSDQmahpkwOun8U8EiRVog= +github.com/hashicorp/go-plugin v1.6.2/go.mod h1:CkgLQ5CZqNmdL9U9JzM532t8ZiYQ35+pj3b1FD37R0Q= github.com/hashicorp/go-retryablehttp v0.7.7 h1:C8hUCYzor8PIfXHa4UrZkU4VvK8o9ISHxT2Q8+VepXU= github.com/hashicorp/go-retryablehttp v0.7.7/go.mod h1:pkQpWZeYWskR+D1tR2O5OcBFOxfA7DoAO6xtkuQnHTk= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= @@ -176,12 +176,12 @@ github.com/hashicorp/terraform-json v0.22.1 h1:xft84GZR0QzjPVWs4lRUwvTcPnegqlyS7 github.com/hashicorp/terraform-json v0.22.1/go.mod h1:JbWSQCLFSXFFhg42T7l9iJwdGXBYV8fmmD6o/ML4p3A= github.com/hashicorp/terraform-plugin-docs v0.19.4 h1:G3Bgo7J22OMtegIgn8Cd/CaSeyEljqjH3G39w28JK4c= github.com/hashicorp/terraform-plugin-docs v0.19.4/go.mod h1:4pLASsatTmRynVzsjEhbXZ6s7xBlUw/2Kt0zfrq8HxA= -github.com/hashicorp/terraform-plugin-framework v1.12.0 h1:7HKaueHPaikX5/7cbC1r9d1m12iYHY+FlNZEGxQ42CQ= -github.com/hashicorp/terraform-plugin-framework v1.12.0/go.mod h1:N/IOQ2uYjW60Jp39Cp3mw7I/OpC/GfZ0385R0YibmkE= +github.com/hashicorp/terraform-plugin-framework v1.13.0 h1:8OTG4+oZUfKgnfTdPTJwZ532Bh2BobF4H+yBiYJ/scw= +github.com/hashicorp/terraform-plugin-framework v1.13.0/go.mod h1:j64rwMGpgM3NYXTKuxrCnyubQb/4VKldEKlcG8cvmjU= github.com/hashicorp/terraform-plugin-framework-validators v0.14.0 h1:3PCn9iyzdVOgHYOBmncpSSOxjQhCTYmc+PGvbdlqSaI= github.com/hashicorp/terraform-plugin-framework-validators v0.14.0/go.mod h1:LwDKNdzxrDY/mHBrlC6aYfE2fQ3Dk3gaJD64vNiXvo4= -github.com/hashicorp/terraform-plugin-go v0.24.0 h1:2WpHhginCdVhFIrWHxDEg6RBn3YaWzR2o6qUeIEat2U= -github.com/hashicorp/terraform-plugin-go v0.24.0/go.mod h1:tUQ53lAsOyYSckFGEefGC5C8BAaO0ENqzFd3bQeuYQg= +github.com/hashicorp/terraform-plugin-go v0.25.0 h1:oi13cx7xXA6QciMcpcFi/rwA974rdTxjqEhXJjbAyks= +github.com/hashicorp/terraform-plugin-go v0.25.0/go.mod h1:+SYagMYadJP86Kvn+TGeV+ofr/R3g4/If0O5sO96MVw= github.com/hashicorp/terraform-plugin-log v0.9.0 h1:i7hOA+vdAItN1/7UrfBqBwvYPQ9TFvymaRGZED3FCV0= github.com/hashicorp/terraform-plugin-log v0.9.0/go.mod h1:rKL8egZQ/eXSyDqzLUuwUYLVdlYeamldAHSxjUFADow= github.com/hashicorp/terraform-plugin-sdk/v2 v2.34.0 h1:kJiWGx2kiQVo97Y5IOGR4EMcZ8DtMswHhUuFibsCQQE= @@ -465,8 +465,8 @@ google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJ google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto/googleapis/api v0.0.0-20240725223205-93522f1f2a9f h1:b1Ln/PG8orm0SsBbHZWke8dDp2lrCD4jSmfglFpTZbk= -google.golang.org/genproto/googleapis/api v0.0.0-20240725223205-93522f1f2a9f/go.mod h1:AHT0dDg3SoMOgZGnZk29b5xTbPHMoEC8qthmBLJCpys= +google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142 h1:wKguEg1hsxI2/L3hUYrpo1RVi48K+uTyzKqprwLXsb8= +google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142/go.mod h1:d6be+8HhtEtucleCbxpPW9PA9XwISACu8nvpPqF0BVo= google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 h1:pPJltXNxVzT4pK9yD8vR9X75DaWYYmLGMsEvBfFQZzQ= google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= @@ -474,8 +474,8 @@ google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyac google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.66.2 h1:3QdXkuq3Bkh7w+ywLdLvM56cmGvQHUMZpiCzt6Rqaoo= -google.golang.org/grpc v1.66.2/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= +google.golang.org/grpc v1.67.1 h1:zWnc1Vrcno+lHZCOofnIMvycFcc0QRGIzm9dhnDX68E= +google.golang.org/grpc v1.67.1/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -487,8 +487,8 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= -google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= +google.golang.org/protobuf v1.35.1 h1:m3LfL6/Ca+fqnjnlqQXNpFPABW1UD7mjh8KO2mKFytA= +google.golang.org/protobuf v1.35.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= From df7786cb7f7eaa8b03145b9ed07d4f1591af7585 Mon Sep 17 00:00:00 2001 From: Volodymyr Manilo <35466116+vmanilo@users.noreply.github.com> Date: Mon, 4 Nov 2024 17:34:59 +0100 Subject: [PATCH 06/15] Fix: dns filtering profile mutation (#594) --- twingate/internal/client/client.go | 13 +++++++++++++ twingate/internal/client/dns-filtering-profile.go | 10 +++++----- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/twingate/internal/client/client.go b/twingate/internal/client/client.go index 6357ee0c..bfc9c0a3 100644 --- a/twingate/internal/client/client.go +++ b/twingate/internal/client/client.go @@ -339,6 +339,19 @@ func (client *Client) mutate(ctx context.Context, resp MutationResponse, variabl return nil } +func (client *Client) mutateWithTimeout(ctx context.Context, resp MutationResponse, variables map[string]any, opr operation, attrs ...attr) error { + var err error + + for i := 0; i == 0 || err != nil && (strings.Contains(err.Error(), "timeout") || strings.Contains(err.Error(), "deadline")) && i < defaultQueryRetries; i++ { + timeoutCtx, cancel := context.WithTimeout(ctx, defaultQueryTimeout) + err = client.mutate(timeoutCtx, resp, variables, opr, attrs...) + + cancel() + } + + return err +} + type ResponseWithPayload interface { IsEmpty() bool } diff --git a/twingate/internal/client/dns-filtering-profile.go b/twingate/internal/client/dns-filtering-profile.go index b197f80c..658228cd 100644 --- a/twingate/internal/client/dns-filtering-profile.go +++ b/twingate/internal/client/dns-filtering-profile.go @@ -11,7 +11,7 @@ func (client *Client) ReadShallowDNSFilteringProfiles(ctx context.Context) ([]*m opr := resourceDNSFilteringProfile.read().withCustomName("readShallowDNSFilteringProfiles") response := query.ReadDNSFilteringProfiles{} - if err := client.query(ctx, &response, nil, opr, attr{id: "All"}); err != nil { + if err := client.queryWithTimeout(ctx, &response, nil, opr, attr{id: "All"}); err != nil { return nil, err } @@ -59,7 +59,7 @@ func (client *Client) CreateDNSFilteringProfile(ctx context.Context, name string ) var response query.CreateDNSFilteringProfile - if err := client.mutate(ctx, &response, variables, opr, attr{name: name}); err != nil { + if err := client.mutateWithTimeout(ctx, &response, variables, opr, attr{name: name}); err != nil { return nil, err } @@ -169,7 +169,7 @@ func (client *Client) UpdateDNSFilteringProfile(ctx context.Context, input *mode ) var response query.UpdateDNSFilteringProfile - if err := client.mutate(ctx, &response, variables, opr, attr{id: input.ID}); err != nil { + if err := client.mutateWithTimeout(ctx, &response, variables, opr, attr{id: input.ID}); err != nil { return nil, err } @@ -188,7 +188,7 @@ func (client *Client) readDNSFilteringProfileGroupsAfter(ctx context.Context, va variables[query.CursorGroups] = cursor response := query.ReadDNSFilteringProfileGroups{} - if err := client.query(ctx, &response, variables, opr, attr{id: "All"}); err != nil { + if err := client.queryWithTimeout(ctx, &response, variables, opr, attr{id: "All"}); err != nil { return nil, err } @@ -204,5 +204,5 @@ func (client *Client) DeleteDNSFilteringProfile(ctx context.Context, profileID s var response query.DeleteDNSFilteringProfile - return client.mutate(ctx, &response, newVars(gqlID(profileID)), opr, attr{id: profileID}) + return client.mutateWithTimeout(ctx, &response, newVars(gqlID(profileID)), opr, attr{id: profileID}) } From 041be8bc8b2ea72d3fd60451a0278dfab71cb7d4 Mon Sep 17 00:00:00 2001 From: Volodymyr Manilo <35466116+vmanilo@users.noreply.github.com> Date: Mon, 4 Nov 2024 17:47:13 +0100 Subject: [PATCH 07/15] Upgrade go 1.23 (#595) Co-authored-by: bertekintw <101608051+bertekintw@users.noreply.github.com> --- .go-version | 2 +- .tool-versions | 2 +- go.mod | 4 +--- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.go-version b/.go-version index 71f7f51d..a1b6e17d 100644 --- a/.go-version +++ b/.go-version @@ -1 +1 @@ -1.22 +1.23 diff --git a/.tool-versions b/.tool-versions index 2ffc68b7..01bf8091 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,3 +1,3 @@ -golang 1.22.0 +golang 1.23.2 python 3.12.2 terraform 1.9.2 diff --git a/go.mod b/go.mod index 5dc4c122..d3e34ef3 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,6 @@ module github.com/Twingate/terraform-provider-twingate/v3 -go 1.22.0 - -toolchain go1.22.5 +go 1.23.2 require ( github.com/client9/misspell v0.3.4 From 6940d82199feb29ad23110553c7eddd2f2ee102e Mon Sep 17 00:00:00 2001 From: Volodymyr Manilo <35466116+vmanilo@users.noreply.github.com> Date: Mon, 4 Nov 2024 20:54:48 +0100 Subject: [PATCH 08/15] Fix: improve acc tests (#596) Co-authored-by: Bob Lee --- .github/workflows/ci.yml | 12 +- .github/workflows/smoketests.yml | 13 +- scripts/test.sh | 2 +- .../acctests/datasource/connector_test.go | 86 +-- .../acctests/datasource/connectors_test.go | 45 +- .../datasource/dns-filtering-profile_test.go | 2 + .../test/acctests/datasource/group_test.go | 106 ++-- .../test/acctests/datasource/groups_test.go | 2 +- .../datasource/remote-network_test.go | 143 ++--- .../datasource/remote-networks_test.go | 36 +- .../test/acctests/datasource/resource_test.go | 86 +-- .../acctests/datasource/resources_test.go | 67 +- .../datasource/security-policies_test.go | 36 +- .../datasource/security-policy_test.go | 168 ++--- .../datasource/service-accounts_test.go | 195 +++--- .../test/acctests/datasource/user_test.go | 85 +-- .../test/acctests/datasource/users_test.go | 35 +- .../resource/connector-tokens_test.go | 32 +- .../test/acctests/resource/connector_test.go | 356 +++++------ .../test/acctests/resource/group_test.go | 558 ++++++++-------- .../acctests/resource/remote-network_test.go | 242 +++---- .../test/acctests/resource/resource_test.go | 105 ++- .../acctests/resource/service-account_test.go | 140 ++-- .../acctests/resource/service-key_test.go | 596 +++++++++--------- .../test/acctests/resource/user_test.go | 384 +++++------ 25 files changed, 1791 insertions(+), 1741 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fc5ce2f4..31258383 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -120,14 +120,13 @@ jobs: needs: build runs-on: ubuntu-latest if: "!github.event.pull_request.head.repo.fork" - timeout-minutes: 15 strategy: - max-parallel: 2 + max-parallel: 3 fail-fast: false matrix: terraform: - '1.8.*' - - '1.9.*' +# - '1.9.*' - 'latest' steps: @@ -161,6 +160,7 @@ jobs: TWINGATE_API_TOKEN: ${{ secrets.TWINGATE_API_TOKEN }} TEST_UNIQUE_VALUE: ${{ github.run_id }}-${{ github.run_number }}-${{ matrix.terraform }} run: | + terraform version make testacc - name: Send coverage @@ -175,13 +175,13 @@ jobs: needs: build runs-on: ubuntu-latest if: "!github.event.pull_request.head.repo.fork" - timeout-minutes: 15 strategy: - max-parallel: 2 + max-parallel: 3 fail-fast: false matrix: tofu: - '1.6.*' + - '1.7.*' - 'latest' steps: @@ -224,7 +224,7 @@ jobs: cleanup: name: Cleanup - if: "!github.event.pull_request.head.repo.fork" + if: '!github.event.pull_request.head.repo.fork && always()' needs: [tests-acceptance, tests-acceptance-opentofu] runs-on: ubuntu-latest timeout-minutes: 15 diff --git a/.github/workflows/smoketests.yml b/.github/workflows/smoketests.yml index 99d43740..ee4ebfd5 100644 --- a/.github/workflows/smoketests.yml +++ b/.github/workflows/smoketests.yml @@ -40,14 +40,13 @@ jobs: name: Matrix Acceptance Tests needs: build runs-on: ubuntu-latest - timeout-minutes: 15 strategy: - max-parallel: 2 + max-parallel: 3 fail-fast: false matrix: terraform: - '1.8.*' - - '1.9.*' +# - '1.9.*' - 'latest' steps: - name: Check out code into the Go module directory @@ -94,6 +93,7 @@ jobs: TWINGATE_API_TOKEN: ${{ secrets.TWINGATE_API_TOKEN }} TEST_UNIQUE_VALUE: ${{ github.run_id }}-${{ github.run_number }}-${{ matrix.terraform }} run: | + terraform version make testacc - name: Report Status @@ -112,14 +112,13 @@ jobs: name: OpenTofu Matrix Acceptance Tests needs: build runs-on: ubuntu-latest - if: "!github.event.pull_request.head.repo.fork" - timeout-minutes: 15 strategy: - max-parallel: 2 + max-parallel: 3 fail-fast: false matrix: tofu: - '1.6.*' + - '1.7.*' - 'latest' steps: @@ -162,7 +161,7 @@ jobs: cleanup: name: Cleanup - if: always() + if: '!github.event.pull_request.head.repo.fork && always()' needs: [tests-acceptance, tests-acceptance-opentofu] runs-on: ubuntu-latest timeout-minutes: 15 diff --git a/scripts/test.sh b/scripts/test.sh index 67f6211f..feaa2f10 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -10,7 +10,7 @@ mkdir -p "${TEST_RESULTS}" echo PACKAGE_NAME: "$PACKAGE_NAME" echo "Running tests:" -go run gotest.tools/gotestsum --rerun-fails --packages "${PACKAGE_NAME}" --format standard-quiet --junitfile "${TEST_RESULTS}"/test-results.xml -- -coverpkg="${PACKAGE_NAME}" -coverprofile="${TEST_RESULTS}"/coverage.out.tmp "${PACKAGE_NAME}" +go run gotest.tools/gotestsum --rerun-fails=5 --packages "${PACKAGE_NAME}" --format standard-quiet --junitfile "${TEST_RESULTS}"/test-results.xml -- -coverpkg="${PACKAGE_NAME}" -coverprofile="${TEST_RESULTS}"/coverage.out.tmp "${PACKAGE_NAME}" echo echo "Generating coverage report (removing generated **/api/gen/** and *.pb.go files)" diff --git a/twingate/internal/test/acctests/datasource/connector_test.go b/twingate/internal/test/acctests/datasource/connector_test.go index bd7ead9b..95381d35 100644 --- a/twingate/internal/test/acctests/datasource/connector_test.go +++ b/twingate/internal/test/acctests/datasource/connector_test.go @@ -13,24 +13,24 @@ import ( ) func TestAccDatasourceTwingateConnector_basic(t *testing.T) { - t.Run("Test Twingate Datasource : Acc Connector Basic", func(t *testing.T) { - networkName := test.RandomName() - connectorName := test.RandomConnectorName() - - resource.Test(t, resource.TestCase{ - ProtoV6ProviderFactories: acctests.ProviderFactories, - PreCheck: func() { acctests.PreCheck(t) }, - CheckDestroy: acctests.CheckTwingateConnectorDestroy, - Steps: []resource.TestStep{ - { - Config: testDatasourceTwingateConnector(networkName, connectorName), - Check: acctests.ComposeTestCheckFunc( - resource.TestCheckOutput("my_connector", connectorName), - resource.TestCheckOutput("my_connector_notification_status", "true"), - ), - }, + t.Parallel() + + networkName := test.RandomName() + connectorName := test.RandomConnectorName() + + resource.Test(t, resource.TestCase{ + ProtoV6ProviderFactories: acctests.ProviderFactories, + PreCheck: func() { acctests.PreCheck(t) }, + CheckDestroy: acctests.CheckTwingateConnectorDestroy, + Steps: []resource.TestStep{ + { + Config: testDatasourceTwingateConnector(networkName, connectorName), + Check: acctests.ComposeTestCheckFunc( + resource.TestCheckOutput("my_connector", connectorName), + resource.TestCheckOutput("my_connector_notification_status", "true"), + ), }, - }) + }, }) } @@ -59,21 +59,21 @@ func testDatasourceTwingateConnector(remoteNetworkName, connectorName string) st } func TestAccDatasourceTwingateConnector_negative(t *testing.T) { - t.Run("Test Twingate Datasource : Acc Connector - does not exists", func(t *testing.T) { - connectorID := base64.StdEncoding.EncodeToString([]byte(fmt.Sprintf("Connector:%d", acctest.RandInt()))) + t.Parallel() - resource.Test(t, resource.TestCase{ - ProtoV6ProviderFactories: acctests.ProviderFactories, - PreCheck: func() { - acctests.PreCheck(t) - }, - Steps: []resource.TestStep{ - { - Config: testTwingateConnectorDoesNotExists(connectorID), - ExpectError: regexp.MustCompile("failed to read connector with id"), - }, + connectorID := base64.StdEncoding.EncodeToString([]byte(fmt.Sprintf("Connector:%d", acctest.RandInt()))) + + resource.Test(t, resource.TestCase{ + ProtoV6ProviderFactories: acctests.ProviderFactories, + PreCheck: func() { + acctests.PreCheck(t) + }, + Steps: []resource.TestStep{ + { + Config: testTwingateConnectorDoesNotExists(connectorID), + ExpectError: regexp.MustCompile("failed to read connector with id"), }, - }) + }, }) } @@ -90,20 +90,20 @@ func testTwingateConnectorDoesNotExists(id string) string { } func TestAccDatasourceTwingateConnector_invalidID(t *testing.T) { - t.Run("Test Twingate Datasource : Acc Connector - failed parse ID", func(t *testing.T) { - connectorID := acctest.RandString(10) + t.Parallel() - resource.Test(t, resource.TestCase{ - ProtoV6ProviderFactories: acctests.ProviderFactories, - PreCheck: func() { - acctests.PreCheck(t) - }, - Steps: []resource.TestStep{ - { - Config: testTwingateConnectorDoesNotExists(connectorID), - ExpectError: regexp.MustCompile("failed to read connector with id"), - }, + connectorID := acctest.RandString(10) + + resource.Test(t, resource.TestCase{ + ProtoV6ProviderFactories: acctests.ProviderFactories, + PreCheck: func() { + acctests.PreCheck(t) + }, + Steps: []resource.TestStep{ + { + Config: testTwingateConnectorDoesNotExists(connectorID), + ExpectError: regexp.MustCompile("failed to read connector with id"), }, - }) + }, }) } diff --git a/twingate/internal/test/acctests/datasource/connectors_test.go b/twingate/internal/test/acctests/datasource/connectors_test.go index 9125e413..206bf64d 100644 --- a/twingate/internal/test/acctests/datasource/connectors_test.go +++ b/twingate/internal/test/acctests/datasource/connectors_test.go @@ -19,7 +19,7 @@ var ( ) func TestAccDatasourceTwingateConnectors_basic(t *testing.T) { - acctests.SetPageLimit(1) + t.Parallel() networkName1 := test.RandomName() networkName2 := test.RandomName() @@ -69,6 +69,7 @@ func testDatasourceTwingateConnectors(networkName1, connectorName1, networkName2 } func TestAccDatasourceTwingateConnectors_emptyResult(t *testing.T) { + t.Parallel() prefix := acctest.RandString(10) resource.Test(t, resource.TestCase{ @@ -153,48 +154,6 @@ func testCheckOutputAttr(name string, index int, attr string, expected interface } } -func testCheckOutputNestedLen(name string, index int, attr string, length int) resource.TestCheckFunc { - return func(s *terraform.State) error { - ms := s.RootModule() - - res, ok := ms.Outputs[name] - if !ok || res == nil || res.Value == nil { - return fmt.Errorf("output '%s' not found", name) - } - - list, ok := res.Value.([]interface{}) - if !ok { - return fmt.Errorf("output '%s' is not a list", name) - } - - if index >= len(list) { - return fmt.Errorf("index out of bounds, actual length %d", len(list)) - } - - item := list[index] - obj, ok := item.(map[string]interface{}) - if !ok { - return fmt.Errorf("expected map, actual is %T", item) - } - - actual, ok := obj[attr] - if !ok { - return fmt.Errorf("attribute '%s' not found", attr) - } - - attrList, ok := actual.([]interface{}) - if !ok { - return fmt.Errorf("output '%s' is not a list", attr) - } - - if len(attrList) != length { - return fmt.Errorf("expected length %d, got %d", length, len(attrList)) - } - - return nil - } -} - func TestAccDatasourceTwingateConnectorsFilterByName(t *testing.T) { t.Parallel() diff --git a/twingate/internal/test/acctests/datasource/dns-filtering-profile_test.go b/twingate/internal/test/acctests/datasource/dns-filtering-profile_test.go index 15ffdb1d..540ea965 100644 --- a/twingate/internal/test/acctests/datasource/dns-filtering-profile_test.go +++ b/twingate/internal/test/acctests/datasource/dns-filtering-profile_test.go @@ -11,6 +11,8 @@ import ( ) func TestAccDatasourceTwingateDNSFilteringProfile_basic(t *testing.T) { + t.Parallel() + testName := "t" + acctest.RandString(6) profileName := test.RandomName() diff --git a/twingate/internal/test/acctests/datasource/group_test.go b/twingate/internal/test/acctests/datasource/group_test.go index 3724633b..b1621778 100644 --- a/twingate/internal/test/acctests/datasource/group_test.go +++ b/twingate/internal/test/acctests/datasource/group_test.go @@ -13,32 +13,32 @@ import ( ) func TestAccDatasourceTwingateGroup_basic(t *testing.T) { - t.Run("Test Twingate Datasource : Acc Group Basic", func(t *testing.T) { - groupName := test.RandomName() - - securityPolicies, err := acctests.ListSecurityPolicies() - if err != nil { - t.Skip("can't run test:", err) - } - - testPolicy := securityPolicies[0] - - resource.Test(t, resource.TestCase{ - ProtoV6ProviderFactories: acctests.ProviderFactories, - PreCheck: func() { acctests.PreCheck(t) }, - CheckDestroy: acctests.CheckTwingateGroupDestroy, - Steps: []resource.TestStep{ - { - Config: testDatasourceTwingateGroup(groupName, testPolicy.ID), - Check: acctests.ComposeTestCheckFunc( - resource.TestCheckOutput("my_group_dg1", groupName), - resource.TestCheckOutput("my_group_is_active_dg1", "true"), - resource.TestCheckOutput("my_group_type_dg1", "MANUAL"), - resource.TestCheckOutput("my_group_policy_dg1", testPolicy.ID), - ), - }, + t.Parallel() + + groupName := test.RandomName() + + securityPolicies, err := acctests.ListSecurityPolicies() + if err != nil { + t.Skip("can't run test:", err) + } + + testPolicy := securityPolicies[0] + + resource.Test(t, resource.TestCase{ + ProtoV6ProviderFactories: acctests.ProviderFactories, + PreCheck: func() { acctests.PreCheck(t) }, + CheckDestroy: acctests.CheckTwingateGroupDestroy, + Steps: []resource.TestStep{ + { + Config: testDatasourceTwingateGroup(groupName, testPolicy.ID), + Check: acctests.ComposeTestCheckFunc( + resource.TestCheckOutput("my_group_dg1", groupName), + resource.TestCheckOutput("my_group_is_active_dg1", "true"), + resource.TestCheckOutput("my_group_type_dg1", "MANUAL"), + resource.TestCheckOutput("my_group_policy_dg1", testPolicy.ID), + ), }, - }) + }, }) } @@ -72,21 +72,21 @@ func testDatasourceTwingateGroup(name, securityPolicyID string) string { } func TestAccDatasourceTwingateGroup_negative(t *testing.T) { - t.Run("Test Twingate Datasource : Acc Group - does not exists", func(t *testing.T) { - groupID := base64.StdEncoding.EncodeToString([]byte(fmt.Sprintf("Group:%d", acctest.RandInt()))) - - resource.Test(t, resource.TestCase{ - ProtoV6ProviderFactories: acctests.ProviderFactories, - PreCheck: func() { - acctests.PreCheck(t) - }, - Steps: []resource.TestStep{ - { - Config: testTwingateGroupDoesNotExists(groupID), - ExpectError: regexp.MustCompile("failed to read group with id"), - }, + t.Parallel() + + groupID := base64.StdEncoding.EncodeToString([]byte(fmt.Sprintf("Group:%d", acctest.RandInt()))) + + resource.Test(t, resource.TestCase{ + ProtoV6ProviderFactories: acctests.ProviderFactories, + PreCheck: func() { + acctests.PreCheck(t) + }, + Steps: []resource.TestStep{ + { + Config: testTwingateGroupDoesNotExists(groupID), + ExpectError: regexp.MustCompile("failed to read group with id"), }, - }) + }, }) } @@ -99,20 +99,20 @@ func testTwingateGroupDoesNotExists(id string) string { } func TestAccDatasourceTwingateGroup_invalidGroupID(t *testing.T) { - t.Run("Test Twingate Datasource : Acc Group - failed parse group ID", func(t *testing.T) { - groupID := acctest.RandString(10) - - resource.Test(t, resource.TestCase{ - ProtoV6ProviderFactories: acctests.ProviderFactories, - PreCheck: func() { - acctests.PreCheck(t) - }, - Steps: []resource.TestStep{ - { - Config: testTwingateGroupDoesNotExists(groupID), - ExpectError: regexp.MustCompile("failed to read group with id"), - }, + t.Parallel() + + groupID := acctest.RandString(10) + + resource.Test(t, resource.TestCase{ + ProtoV6ProviderFactories: acctests.ProviderFactories, + PreCheck: func() { + acctests.PreCheck(t) + }, + Steps: []resource.TestStep{ + { + Config: testTwingateGroupDoesNotExists(groupID), + ExpectError: regexp.MustCompile("failed to read group with id"), }, - }) + }, }) } diff --git a/twingate/internal/test/acctests/datasource/groups_test.go b/twingate/internal/test/acctests/datasource/groups_test.go index debc436a..e89c60a8 100644 --- a/twingate/internal/test/acctests/datasource/groups_test.go +++ b/twingate/internal/test/acctests/datasource/groups_test.go @@ -95,7 +95,7 @@ func testTwingateGroupsDoesNotExists(name string) string { } func TestAccDatasourceTwingateGroupsWithFilters_basic(t *testing.T) { - acctests.SetPageLimit(1) + t.Parallel() groupName := test.RandomName() const theDatasource = "data.twingate_groups.out_dgs2" diff --git a/twingate/internal/test/acctests/datasource/remote-network_test.go b/twingate/internal/test/acctests/datasource/remote-network_test.go index 42e949d3..90b2b86f 100644 --- a/twingate/internal/test/acctests/datasource/remote-network_test.go +++ b/twingate/internal/test/acctests/datasource/remote-network_test.go @@ -14,24 +14,23 @@ import ( ) func TestAccDatasourceTwingateRemoteNetwork_basic(t *testing.T) { - t.Run("Test Twingate Datasource : Acc Remote Network Basic", func(t *testing.T) { - - networkName := test.RandomName() - - resource.Test(t, resource.TestCase{ - ProtoV6ProviderFactories: acctests.ProviderFactories, - PreCheck: func() { acctests.PreCheck(t) }, - CheckDestroy: acctests.CheckTwingateRemoteNetworkDestroy, - Steps: []resource.TestStep{ - { - Config: testDatasourceTwingateRemoteNetwork(networkName), - Check: acctests.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("data.twingate_remote_network.test_dn1_2", attr.Name, networkName), - ), - ExpectNonEmptyPlan: true, - }, + t.Parallel() + + networkName := test.RandomName() + + resource.Test(t, resource.TestCase{ + ProtoV6ProviderFactories: acctests.ProviderFactories, + PreCheck: func() { acctests.PreCheck(t) }, + CheckDestroy: acctests.CheckTwingateRemoteNetworkDestroy, + Steps: []resource.TestStep{ + { + Config: testDatasourceTwingateRemoteNetwork(networkName), + Check: acctests.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("data.twingate_remote_network.test_dn1_2", attr.Name, networkName), + ), + ExpectNonEmptyPlan: true, }, - }) + }, }) } @@ -52,23 +51,22 @@ func testDatasourceTwingateRemoteNetwork(name string) string { } func TestAccDatasourceTwingateRemoteNetworkByName_basic(t *testing.T) { - t.Run("Test Twingate Datasource : Acc Remote Network Basic", func(t *testing.T) { - - networkName := test.RandomName() - - resource.Test(t, resource.TestCase{ - ProtoV6ProviderFactories: acctests.ProviderFactories, - PreCheck: func() { acctests.PreCheck(t) }, - CheckDestroy: acctests.CheckTwingateRemoteNetworkDestroy, - Steps: []resource.TestStep{ - { - Config: testDatasourceTwingateRemoteNetworkByName(networkName), - Check: acctests.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("data.twingate_remote_network.test_dn2_2", attr.Name, networkName), - ), - }, + t.Parallel() + + networkName := test.RandomName() + + resource.Test(t, resource.TestCase{ + ProtoV6ProviderFactories: acctests.ProviderFactories, + PreCheck: func() { acctests.PreCheck(t) }, + CheckDestroy: acctests.CheckTwingateRemoteNetworkDestroy, + Steps: []resource.TestStep{ + { + Config: testDatasourceTwingateRemoteNetworkByName(networkName), + Check: acctests.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("data.twingate_remote_network.test_dn2_2", attr.Name, networkName), + ), }, - }) + }, }) } @@ -89,20 +87,19 @@ func testDatasourceTwingateRemoteNetworkByName(name string) string { `, name, name) } -func TestAccDatasourceTwingateRemoteNetwork_negative(t *testing.T) { - t.Run("Test Twingate Datasource : Acc Remote Network - does not exists", func(t *testing.T) { - networkID := base64.StdEncoding.EncodeToString([]byte(fmt.Sprintf("RemoteNetwork:%d", acctest.RandInt()))) - - resource.Test(t, resource.TestCase{ - ProtoV6ProviderFactories: acctests.ProviderFactories, - PreCheck: func() { acctests.PreCheck(t) }, - Steps: []resource.TestStep{ - { - Config: testTwingateRemoteNetworkDoesNotExists(networkID), - ExpectError: regexp.MustCompile("failed to read remote network with id"), - }, +func TestAccDatasourceTwingateRemoteNetwork_NetworkDoesNotExists(t *testing.T) { + t.Parallel() + networkID := base64.StdEncoding.EncodeToString([]byte(fmt.Sprintf("RemoteNetwork:%d", acctest.RandInt()))) + + resource.Test(t, resource.TestCase{ + ProtoV6ProviderFactories: acctests.ProviderFactories, + PreCheck: func() { acctests.PreCheck(t) }, + Steps: []resource.TestStep{ + { + Config: testTwingateRemoteNetworkDoesNotExists(networkID), + ExpectError: regexp.MustCompile("failed to read remote network with id"), }, - }) + }, }) } @@ -119,39 +116,37 @@ func testTwingateRemoteNetworkDoesNotExists(id string) string { } func TestAccDatasourceTwingateRemoteNetwork_invalidNetworkID(t *testing.T) { - t.Run("Test Twingate Datasource : Acc Remote Network - failed parse network ID", func(t *testing.T) { - networkID := acctest.RandString(10) - - resource.Test(t, resource.TestCase{ - ProtoV6ProviderFactories: acctests.ProviderFactories, - PreCheck: func() { acctests.PreCheck(t) }, - Steps: []resource.TestStep{ - { - Config: testTwingateRemoteNetworkDoesNotExists(networkID), - ExpectError: regexp.MustCompile("failed to read remote network with id"), - }, + t.Parallel() + networkID := acctest.RandString(10) + + resource.Test(t, resource.TestCase{ + ProtoV6ProviderFactories: acctests.ProviderFactories, + PreCheck: func() { acctests.PreCheck(t) }, + Steps: []resource.TestStep{ + { + Config: testTwingateRemoteNetworkDoesNotExists(networkID), + ExpectError: regexp.MustCompile("failed to read remote network with id"), }, - }) + }, }) } -func TestAccDatasourceTwingateRemoteNetwork_bothNetworkIDAndName(t *testing.T) { - t.Run("Test Twingate Datasource : Acc Remote Network - failed passing both network ID and name", func(t *testing.T) { - networkID := acctest.RandString(10) - networkName := acctest.RandString(10) - - resource.Test(t, resource.TestCase{ - ProtoV6ProviderFactories: acctests.ProviderFactories, - PreCheck: func() { - acctests.PreCheck(t) - }, - Steps: []resource.TestStep{ - { - Config: testTwingateRemoteNetworkValidationFailed(networkID, networkName), - ExpectError: regexp.MustCompile("Invalid Attribute Combination"), - }, +func TestAccDatasourceTwingateRemoteNetwork_invalidBothNetworkIDAndName(t *testing.T) { + t.Parallel() + networkID := acctest.RandString(10) + networkName := acctest.RandString(10) + + resource.Test(t, resource.TestCase{ + ProtoV6ProviderFactories: acctests.ProviderFactories, + PreCheck: func() { + acctests.PreCheck(t) + }, + Steps: []resource.TestStep{ + { + Config: testTwingateRemoteNetworkValidationFailed(networkID, networkName), + ExpectError: regexp.MustCompile("Invalid Attribute Combination"), }, - }) + }, }) } diff --git a/twingate/internal/test/acctests/datasource/remote-networks_test.go b/twingate/internal/test/acctests/datasource/remote-networks_test.go index 27bceacc..8a79dfe0 100644 --- a/twingate/internal/test/acctests/datasource/remote-networks_test.go +++ b/twingate/internal/test/acctests/datasource/remote-networks_test.go @@ -17,26 +17,24 @@ var ( ) func TestAccDatasourceTwingateRemoteNetworks_read(t *testing.T) { - t.Run("Test Twingate Datasource : Acc Remote Networks Read", func(t *testing.T) { - acctests.SetPageLimit(1) - - prefix := acctest.RandString(10) - networkName1 := test.RandomName(prefix) - networkName2 := test.RandomName(prefix) - - resource.Test(t, resource.TestCase{ - ProtoV6ProviderFactories: acctests.ProviderFactories, - PreCheck: func() { acctests.PreCheck(t) }, - CheckDestroy: acctests.CheckTwingateRemoteNetworkDestroy, - Steps: []resource.TestStep{ - { - Config: testDatasourceTwingateRemoteNetworks2(networkName1, networkName2, prefix), - Check: acctests.ComposeTestCheckFunc( - testCheckOutputLength("test_networks", 2), - ), - }, + t.Parallel() + + prefix := acctest.RandString(10) + networkName1 := test.RandomName(prefix) + networkName2 := test.RandomName(prefix) + + resource.Test(t, resource.TestCase{ + ProtoV6ProviderFactories: acctests.ProviderFactories, + PreCheck: func() { acctests.PreCheck(t) }, + CheckDestroy: acctests.CheckTwingateRemoteNetworkDestroy, + Steps: []resource.TestStep{ + { + Config: testDatasourceTwingateRemoteNetworks2(networkName1, networkName2, prefix), + Check: acctests.ComposeTestCheckFunc( + testCheckOutputLength("test_networks", 2), + ), }, - }) + }, }) } diff --git a/twingate/internal/test/acctests/datasource/resource_test.go b/twingate/internal/test/acctests/datasource/resource_test.go index 8e2a7fea..30daabf4 100644 --- a/twingate/internal/test/acctests/datasource/resource_test.go +++ b/twingate/internal/test/acctests/datasource/resource_test.go @@ -14,23 +14,23 @@ import ( ) func TestAccDatasourceTwingateResource_basic(t *testing.T) { - t.Run("Test Twingate Datasource : Acc Resource Basic", func(t *testing.T) { - networkName := test.RandomName() - resourceName := test.RandomResourceName() - - resource.Test(t, resource.TestCase{ - ProtoV6ProviderFactories: acctests.ProviderFactories, - PreCheck: func() { acctests.PreCheck(t) }, - CheckDestroy: acctests.CheckTwingateResourceDestroy, - Steps: []resource.TestStep{ - { - Config: testDatasourceTwingateResource(networkName, resourceName), - Check: acctests.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("data.twingate_resource.out_dr1", attr.Name, resourceName), - ), - }, + t.Parallel() + + networkName := test.RandomName() + resourceName := test.RandomResourceName() + + resource.Test(t, resource.TestCase{ + ProtoV6ProviderFactories: acctests.ProviderFactories, + PreCheck: func() { acctests.PreCheck(t) }, + CheckDestroy: acctests.CheckTwingateResourceDestroy, + Steps: []resource.TestStep{ + { + Config: testDatasourceTwingateResource(networkName, resourceName), + Check: acctests.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("data.twingate_resource.out_dr1", attr.Name, resourceName), + ), }, - }) + }, }) } @@ -63,22 +63,22 @@ func testDatasourceTwingateResource(networkName, resourceName string) string { `, networkName, resourceName) } -func TestAccDatasourceTwingateResource_negative(t *testing.T) { - t.Run("Test Twingate Datasource : Acc Resource - does not exists", func(t *testing.T) { - resourceID := base64.StdEncoding.EncodeToString([]byte(fmt.Sprintf("Resource:%d", acctest.RandInt()))) +func TestAccDatasourceTwingateResource_ResourceDoesNotExists(t *testing.T) { + t.Parallel() - resource.Test(t, resource.TestCase{ - ProtoV6ProviderFactories: acctests.ProviderFactories, - PreCheck: func() { - acctests.PreCheck(t) - }, - Steps: []resource.TestStep{ - { - Config: testTwingateResourceDoesNotExists(resourceID), - ExpectError: regexp.MustCompile("failed to read resource with id"), - }, + resourceID := base64.StdEncoding.EncodeToString([]byte(fmt.Sprintf("Resource:%d", acctest.RandInt()))) + + resource.Test(t, resource.TestCase{ + ProtoV6ProviderFactories: acctests.ProviderFactories, + PreCheck: func() { + acctests.PreCheck(t) + }, + Steps: []resource.TestStep{ + { + Config: testTwingateResourceDoesNotExists(resourceID), + ExpectError: regexp.MustCompile("failed to read resource with id"), }, - }) + }, }) } @@ -95,20 +95,20 @@ func testTwingateResourceDoesNotExists(id string) string { } func TestAccDatasourceTwingateResource_invalidID(t *testing.T) { - t.Run("Test Twingate Datasource : Acc Resource - failed parse resource ID", func(t *testing.T) { - networkID := acctest.RandString(10) + t.Parallel() - resource.Test(t, resource.TestCase{ - ProtoV6ProviderFactories: acctests.ProviderFactories, - PreCheck: func() { - acctests.PreCheck(t) - }, - Steps: []resource.TestStep{ - { - Config: testTwingateResourceDoesNotExists(networkID), - ExpectError: regexp.MustCompile("failed to read resource with id"), - }, + networkID := acctest.RandString(10) + + resource.Test(t, resource.TestCase{ + ProtoV6ProviderFactories: acctests.ProviderFactories, + PreCheck: func() { + acctests.PreCheck(t) + }, + Steps: []resource.TestStep{ + { + Config: testTwingateResourceDoesNotExists(networkID), + ExpectError: regexp.MustCompile("failed to read resource with id"), }, - }) + }, }) } diff --git a/twingate/internal/test/acctests/datasource/resources_test.go b/twingate/internal/test/acctests/datasource/resources_test.go index 0e6514eb..75d4d28f 100644 --- a/twingate/internal/test/acctests/datasource/resources_test.go +++ b/twingate/internal/test/acctests/datasource/resources_test.go @@ -18,26 +18,25 @@ var ( ) func TestAccDatasourceTwingateResources_basic(t *testing.T) { - t.Run("Test Twingate Datasource : Acc Resources Basic", func(t *testing.T) { - acctests.SetPageLimit(1) - networkName := test.RandomName() - resourceName := test.RandomResourceName() - const theDatasource = "data.twingate_resources.out_drs1" - - resource.Test(t, resource.TestCase{ - ProtoV6ProviderFactories: acctests.ProviderFactories, - PreCheck: func() { acctests.PreCheck(t) }, - CheckDestroy: acctests.CheckTwingateResourceDestroy, - Steps: []resource.TestStep{ - { - Config: testDatasourceTwingateResources(networkName, resourceName), - Check: acctests.ComposeTestCheckFunc( - resource.TestCheckResourceAttr(theDatasource, resourcesLen, "2"), - resource.TestCheckResourceAttr(theDatasource, resourceNamePath, resourceName), - ), - }, + t.Parallel() + + networkName := test.RandomName() + resourceName := test.RandomResourceName() + const theDatasource = "data.twingate_resources.out_drs1" + + resource.Test(t, resource.TestCase{ + ProtoV6ProviderFactories: acctests.ProviderFactories, + PreCheck: func() { acctests.PreCheck(t) }, + CheckDestroy: acctests.CheckTwingateResourceDestroy, + Steps: []resource.TestStep{ + { + Config: testDatasourceTwingateResources(networkName, resourceName), + Check: acctests.ComposeTestCheckFunc( + resource.TestCheckResourceAttr(theDatasource, resourcesLen, "2"), + resource.TestCheckResourceAttr(theDatasource, resourceNamePath, resourceName), + ), }, - }) + }, }) } @@ -90,23 +89,23 @@ func testDatasourceTwingateResources(networkName, resourceName string) string { } func TestAccDatasourceTwingateResources_emptyResult(t *testing.T) { - t.Run("Test Twingate Datasource : Acc Resources - empty result", func(t *testing.T) { - resourceName := test.RandomResourceName() + t.Parallel() - resource.Test(t, resource.TestCase{ - ProtoV6ProviderFactories: acctests.ProviderFactories, - PreCheck: func() { - acctests.PreCheck(t) - }, - Steps: []resource.TestStep{ - { - Config: testTwingateResourcesDoesNotExists(resourceName), - Check: acctests.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("data.twingate_resources.out_drs2", resourcesLen, "0"), - ), - }, + resourceName := test.RandomResourceName() + + resource.Test(t, resource.TestCase{ + ProtoV6ProviderFactories: acctests.ProviderFactories, + PreCheck: func() { + acctests.PreCheck(t) + }, + Steps: []resource.TestStep{ + { + Config: testTwingateResourcesDoesNotExists(resourceName), + Check: acctests.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("data.twingate_resources.out_drs2", resourcesLen, "0"), + ), }, - }) + }, }) } diff --git a/twingate/internal/test/acctests/datasource/security-policies_test.go b/twingate/internal/test/acctests/datasource/security-policies_test.go index 4695f316..714db4b5 100644 --- a/twingate/internal/test/acctests/datasource/security-policies_test.go +++ b/twingate/internal/test/acctests/datasource/security-policies_test.go @@ -12,26 +12,24 @@ import ( var securityPolicyNamePath = attr.Path(attr.SecurityPolicies, attr.Name) func TestAccDatasourceTwingateSecurityPoliciesBasic(t *testing.T) { - t.Run("Test Twingate Datasource : Acc Security Policies - basic", func(t *testing.T) { - acctests.SetPageLimit(1) - - securityPolicies, err := acctests.ListSecurityPolicies() - if err != nil { - t.Skip("can't run test:", err) - } - - sdk.Test(t, sdk.TestCase{ - ProtoV6ProviderFactories: acctests.ProviderFactories, - PreCheck: func() { acctests.PreCheck(t) }, - Steps: []sdk.TestStep{ - { - Config: testDatasourceTwingateSecurityPolicies(), - Check: acctests.ComposeTestCheckFunc( - sdk.TestCheckResourceAttr("data.twingate_security_policies.all", attr.Len(attr.SecurityPolicies), fmt.Sprintf("%d", len(securityPolicies))), - ), - }, + t.Parallel() + + securityPolicies, err := acctests.ListSecurityPolicies() + if err != nil { + t.Skip("can't run test:", err) + } + + sdk.Test(t, sdk.TestCase{ + ProtoV6ProviderFactories: acctests.ProviderFactories, + PreCheck: func() { acctests.PreCheck(t) }, + Steps: []sdk.TestStep{ + { + Config: testDatasourceTwingateSecurityPolicies(), + Check: acctests.ComposeTestCheckFunc( + sdk.TestCheckResourceAttr("data.twingate_security_policies.all", attr.Len(attr.SecurityPolicies), fmt.Sprintf("%d", len(securityPolicies))), + ), }, - }) + }, }) } diff --git a/twingate/internal/test/acctests/datasource/security-policy_test.go b/twingate/internal/test/acctests/datasource/security-policy_test.go index c634df8e..4f8ee988 100644 --- a/twingate/internal/test/acctests/datasource/security-policy_test.go +++ b/twingate/internal/test/acctests/datasource/security-policy_test.go @@ -12,21 +12,21 @@ import ( ) func TestAccDatasourceTwingateSecurityPolicyInvalidID(t *testing.T) { - t.Run("Test Twingate Datasource : Acc Security Policy - failed parse ID", func(t *testing.T) { - randStr := acctest.RandString(10) - - resource.Test(t, resource.TestCase{ - ProtoV6ProviderFactories: acctests.ProviderFactories, - PreCheck: func() { - acctests.PreCheck(t) - }, - Steps: []resource.TestStep{ - { - Config: testDatasourceTwingateSecurityPolicy(randStr), - ExpectError: regexp.MustCompile("failed to read security policy"), - }, + t.Parallel() + + randStr := acctest.RandString(10) + + resource.Test(t, resource.TestCase{ + ProtoV6ProviderFactories: acctests.ProviderFactories, + PreCheck: func() { + acctests.PreCheck(t) + }, + Steps: []resource.TestStep{ + { + Config: testDatasourceTwingateSecurityPolicy(randStr), + ExpectError: regexp.MustCompile("failed to read security policy"), }, - }) + }, }) } @@ -43,21 +43,21 @@ func testDatasourceTwingateSecurityPolicy(id string) string { } func TestAccDatasourceTwingateSecurityPolicyReadWithNameAndID(t *testing.T) { - t.Run("Test Twingate Datasource : Acc Security Policy - read with name and id", func(t *testing.T) { - randStr := acctest.RandString(10) - - resource.Test(t, resource.TestCase{ - ProtoV6ProviderFactories: acctests.ProviderFactories, - PreCheck: func() { - acctests.PreCheck(t) - }, - Steps: []resource.TestStep{ - { - Config: testDatasourceTwingateSecurityPolicyWithNameAndID(randStr, randStr), - ExpectError: regexp.MustCompile("Error: Invalid Attribute Combination"), - }, + t.Parallel() + + randStr := acctest.RandString(10) + + resource.Test(t, resource.TestCase{ + ProtoV6ProviderFactories: acctests.ProviderFactories, + PreCheck: func() { + acctests.PreCheck(t) + }, + Steps: []resource.TestStep{ + { + Config: testDatasourceTwingateSecurityPolicyWithNameAndID(randStr, randStr), + ExpectError: regexp.MustCompile("Error: Invalid Attribute Combination"), }, - }) + }, }) } @@ -75,47 +75,47 @@ func testDatasourceTwingateSecurityPolicyWithNameAndID(id, name string) string { } func TestAccDatasourceTwingateSecurityPolicyDoesNotExists(t *testing.T) { - t.Run("Test Twingate Datasource : Acc Security Policy - does not exists", func(t *testing.T) { - securityPolicyID := base64.StdEncoding.EncodeToString([]byte(fmt.Sprintf("SecurityPolicy:%d", acctest.RandInt()))) - - resource.Test(t, resource.TestCase{ - ProtoV6ProviderFactories: acctests.ProviderFactories, - PreCheck: func() { - acctests.PreCheck(t) - }, - Steps: []resource.TestStep{ - { - Config: testDatasourceTwingateSecurityPolicy(securityPolicyID), - ExpectError: regexp.MustCompile("failed to read security policy with id"), - }, + t.Parallel() + + securityPolicyID := base64.StdEncoding.EncodeToString([]byte(fmt.Sprintf("SecurityPolicy:%d", acctest.RandInt()))) + + resource.Test(t, resource.TestCase{ + ProtoV6ProviderFactories: acctests.ProviderFactories, + PreCheck: func() { + acctests.PreCheck(t) + }, + Steps: []resource.TestStep{ + { + Config: testDatasourceTwingateSecurityPolicy(securityPolicyID), + ExpectError: regexp.MustCompile("failed to read security policy with id"), }, - }) + }, }) } func TestAccDatasourceTwingateSecurityPolicyReadOkByID(t *testing.T) { - t.Run("Test Twingate Datasource : Acc Security Policy - read Ok By ID", func(t *testing.T) { - securityPolicies, err := acctests.ListSecurityPolicies() - if err != nil { - t.Skip("can't run test:", err) - } - - testPolicy := securityPolicies[0] - - resource.Test(t, resource.TestCase{ - ProtoV6ProviderFactories: acctests.ProviderFactories, - PreCheck: func() { - acctests.PreCheck(t) - }, - Steps: []resource.TestStep{ - { - Config: testDatasourceTwingateSecurityPolicyByID(testPolicy.ID), - Check: acctests.ComposeTestCheckFunc( - resource.TestCheckOutput("security_policy_name", testPolicy.Name), - ), - }, + t.Parallel() + + securityPolicies, err := acctests.ListSecurityPolicies() + if err != nil { + t.Skip("can't run test:", err) + } + + testPolicy := securityPolicies[0] + + resource.Test(t, resource.TestCase{ + ProtoV6ProviderFactories: acctests.ProviderFactories, + PreCheck: func() { + acctests.PreCheck(t) + }, + Steps: []resource.TestStep{ + { + Config: testDatasourceTwingateSecurityPolicyByID(testPolicy.ID), + Check: acctests.ComposeTestCheckFunc( + resource.TestCheckOutput("security_policy_name", testPolicy.Name), + ), }, - }) + }, }) } @@ -132,28 +132,28 @@ func testDatasourceTwingateSecurityPolicyByID(id string) string { } func TestAccDatasourceTwingateSecurityPolicyReadOkByName(t *testing.T) { - t.Run("Test Twingate Datasource : Acc Security Policy - read Ok By Name", func(t *testing.T) { - securityPolicies, err := acctests.ListSecurityPolicies() - if err != nil { - t.Skip("can't run test:", err) - } - - testPolicy := securityPolicies[0] - - resource.Test(t, resource.TestCase{ - ProtoV6ProviderFactories: acctests.ProviderFactories, - PreCheck: func() { - acctests.PreCheck(t) - }, - Steps: []resource.TestStep{ - { - Config: testDatasourceTwingateSecurityPolicyByName(testPolicy.Name), - Check: acctests.ComposeTestCheckFunc( - resource.TestCheckOutput("security_policy_id", testPolicy.ID), - ), - }, + t.Parallel() + + securityPolicies, err := acctests.ListSecurityPolicies() + if err != nil { + t.Skip("can't run test:", err) + } + + testPolicy := securityPolicies[0] + + resource.Test(t, resource.TestCase{ + ProtoV6ProviderFactories: acctests.ProviderFactories, + PreCheck: func() { + acctests.PreCheck(t) + }, + Steps: []resource.TestStep{ + { + Config: testDatasourceTwingateSecurityPolicyByName(testPolicy.Name), + Check: acctests.ComposeTestCheckFunc( + resource.TestCheckOutput("security_policy_id", testPolicy.ID), + ), }, - }) + }, }) } diff --git a/twingate/internal/test/acctests/datasource/service-accounts_test.go b/twingate/internal/test/acctests/datasource/service-accounts_test.go index f5675dc4..bc5c815a 100644 --- a/twingate/internal/test/acctests/datasource/service-accounts_test.go +++ b/twingate/internal/test/acctests/datasource/service-accounts_test.go @@ -21,106 +21,104 @@ var ( ) func TestAccDatasourceTwingateServicesFilterByName(t *testing.T) { - t.Run("Test Twingate Datasource : Acc Services - Filter By Name", func(t *testing.T) { + t.Parallel() - name := test.Prefix("orange") + acctest.RandString(5) - const ( - terraformResourceName = "dts_service" - theDatasource = "data.twingate_service_accounts.out" - ) + name := test.Prefix("orange") + acctest.RandString(5) + const ( + terraformResourceName = "dts_service" + theDatasource = "data.twingate_service_accounts.out" + ) - config := []terraformServiceConfig{ - { - serviceName: name, - terraformResourceName: test.TerraformRandName(terraformResourceName), - }, + config := []terraformServiceConfig{ + { + serviceName: name, + terraformResourceName: test.TerraformRandName(terraformResourceName), + }, + { + serviceName: test.Prefix("lemon") + acctest.RandString(5), + terraformResourceName: test.TerraformRandName(terraformResourceName), + }, + } + + resource.Test(t, resource.TestCase{ + ProtoV6ProviderFactories: acctests.ProviderFactories, + PreCheck: func() { acctests.PreCheck(t) }, + CheckDestroy: acctests.CheckTwingateServiceAccountDestroy, + Steps: []resource.TestStep{ { - serviceName: test.Prefix("lemon") + acctest.RandString(5), - terraformResourceName: test.TerraformRandName(terraformResourceName), - }, - } - - resource.Test(t, resource.TestCase{ - ProtoV6ProviderFactories: acctests.ProviderFactories, - PreCheck: func() { acctests.PreCheck(t) }, - CheckDestroy: acctests.CheckTwingateServiceAccountDestroy, - Steps: []resource.TestStep{ - { - Config: terraformConfig( - createServices(config), - datasourceServices(name, config), - ), - Check: acctests.ComposeTestCheckFunc( - resource.TestCheckResourceAttr(theDatasource, serviceAccountsLen, "1"), - resource.TestCheckResourceAttr(theDatasource, keyIDsLen, "1"), - resource.TestCheckResourceAttr(theDatasource, attr.ID, "service-by-name-"+name), - ), - }, + Config: terraformConfig( + createServices(config), + datasourceServices(name, config), + ), + Check: acctests.ComposeTestCheckFunc( + resource.TestCheckResourceAttr(theDatasource, serviceAccountsLen, "1"), + resource.TestCheckResourceAttr(theDatasource, keyIDsLen, "1"), + resource.TestCheckResourceAttr(theDatasource, attr.ID, "service-by-name-"+name), + ), }, - }) + }, }) } func TestAccDatasourceTwingateServicesAll(t *testing.T) { - t.Run("Test Twingate Datasource : Acc Services - All", func(t *testing.T) { - prefix := test.Prefix() + acctest.RandString(4) - const ( - terraformResourceName = "dts_service" - theDatasource = "data.twingate_service_accounts.out" - ) - - config := []terraformServiceConfig{ + t.Parallel() + + prefix := test.Prefix() + acctest.RandString(4) + const ( + terraformResourceName = "dts_service" + theDatasource = "data.twingate_service_accounts.out" + ) + + config := []terraformServiceConfig{ + { + serviceName: prefix + "_orange", + terraformResourceName: test.TerraformRandName(terraformResourceName), + }, + { + serviceName: prefix + "_lemon", + terraformResourceName: test.TerraformRandName(terraformResourceName), + }, + } + + resource.Test(t, resource.TestCase{ + ProtoV6ProviderFactories: acctests.ProviderFactories, + PreCheck: func() { acctests.PreCheck(t) }, + CheckDestroy: acctests.CheckTwingateServiceAccountDestroy, + Steps: []resource.TestStep{ { - serviceName: prefix + "_orange", - terraformResourceName: test.TerraformRandName(terraformResourceName), + Config: filterDatasourceServices(prefix, config), + Check: acctests.ComposeTestCheckFunc( + resource.TestCheckResourceAttr(theDatasource, attr.ID, "all-services"), + ), + ExpectNonEmptyPlan: true, }, { - serviceName: prefix + "_lemon", - terraformResourceName: test.TerraformRandName(terraformResourceName), - }, - } - - resource.Test(t, resource.TestCase{ - ProtoV6ProviderFactories: acctests.ProviderFactories, - PreCheck: func() { acctests.PreCheck(t) }, - CheckDestroy: acctests.CheckTwingateServiceAccountDestroy, - Steps: []resource.TestStep{ - { - Config: filterDatasourceServices(prefix, config), - Check: acctests.ComposeTestCheckFunc( - resource.TestCheckResourceAttr(theDatasource, attr.ID, "all-services"), - ), - ExpectNonEmptyPlan: true, - }, - { - Config: filterDatasourceServices(prefix, config), - Check: acctests.ComposeTestCheckFunc( - testCheckOutputLength("my_services", 2), - ), - }, + Config: filterDatasourceServices(prefix, config), + Check: acctests.ComposeTestCheckFunc( + testCheckOutputLength("my_services", 2), + ), }, - }) + }, }) } func TestAccDatasourceTwingateServicesEmptyResult(t *testing.T) { - t.Run("Test Twingate Datasource : Acc Services - Empty Result", func(t *testing.T) { - - const theDatasource = "data.twingate_service_accounts.out" - - resource.Test(t, resource.TestCase{ - ProtoV6ProviderFactories: acctests.ProviderFactories, - PreCheck: func() { acctests.PreCheck(t) }, - CheckDestroy: acctests.CheckTwingateServiceAccountDestroy, - Steps: []resource.TestStep{ - { - Config: datasourceServices(test.RandomName(), nil), - Check: acctests.ComposeTestCheckFunc( - resource.TestCheckResourceAttr(theDatasource, serviceAccountsLen, "0"), - ), - }, + t.Parallel() + + const theDatasource = "data.twingate_service_accounts.out" + + resource.Test(t, resource.TestCase{ + ProtoV6ProviderFactories: acctests.ProviderFactories, + PreCheck: func() { acctests.PreCheck(t) }, + CheckDestroy: acctests.CheckTwingateServiceAccountDestroy, + Steps: []resource.TestStep{ + { + Config: datasourceServices(test.RandomName(), nil), + Check: acctests.ComposeTestCheckFunc( + resource.TestCheckResourceAttr(theDatasource, serviceAccountsLen, "0"), + ), }, - }) + }, }) } @@ -200,23 +198,22 @@ func filterDatasourceServices(prefix string, configs []terraformServiceConfig) s } func TestAccDatasourceTwingateServicesAllCursors(t *testing.T) { - t.Run("Test Twingate Datasource : Acc Services - All Cursors", func(t *testing.T) { - acctests.SetPageLimit(1) - prefix := test.Prefix() + acctest.RandString(4) - - resource.Test(t, resource.TestCase{ - ProtoV6ProviderFactories: acctests.ProviderFactories, - PreCheck: func() { acctests.PreCheck(t) }, - CheckDestroy: acctests.CheckTwingateServiceAccountDestroy, - Steps: []resource.TestStep{ - { - Config: datasourceServicesConfig(prefix), - Check: acctests.ComposeTestCheckFunc( - testCheckOutputLength("my_services", 2), - ), - }, + t.Parallel() + + prefix := test.Prefix() + acctest.RandString(4) + + resource.Test(t, resource.TestCase{ + ProtoV6ProviderFactories: acctests.ProviderFactories, + PreCheck: func() { acctests.PreCheck(t) }, + CheckDestroy: acctests.CheckTwingateServiceAccountDestroy, + Steps: []resource.TestStep{ + { + Config: datasourceServicesConfig(prefix), + Check: acctests.ComposeTestCheckFunc( + testCheckOutputLength("my_services", 2), + ), }, - }) + }, }) } diff --git a/twingate/internal/test/acctests/datasource/user_test.go b/twingate/internal/test/acctests/datasource/user_test.go index 922e50aa..45e6e4c0 100644 --- a/twingate/internal/test/acctests/datasource/user_test.go +++ b/twingate/internal/test/acctests/datasource/user_test.go @@ -12,24 +12,24 @@ import ( ) func TestAccDatasourceTwingateUser_basic(t *testing.T) { - t.Run("Test Twingate Datasource : Acc User Basic", func(t *testing.T) { - user, err := acctests.GetTestUser() - if err != nil { - t.Skip("can't run test:", err) - } + t.Parallel() - resource.Test(t, resource.TestCase{ - ProtoV6ProviderFactories: acctests.ProviderFactories, - PreCheck: func() { acctests.PreCheck(t) }, - Steps: []resource.TestStep{ - { - Config: testDatasourceTwingateUser(user.ID), - Check: acctests.ComposeTestCheckFunc( - resource.TestCheckOutput("my_user_email_du1", user.Email), - ), - }, + user, err := acctests.GetTestUser() + if err != nil { + t.Skip("can't run test:", err) + } + + resource.Test(t, resource.TestCase{ + ProtoV6ProviderFactories: acctests.ProviderFactories, + PreCheck: func() { acctests.PreCheck(t) }, + Steps: []resource.TestStep{ + { + Config: testDatasourceTwingateUser(user.ID), + Check: acctests.ComposeTestCheckFunc( + resource.TestCheckOutput("my_user_email_du1", user.Email), + ), }, - }) + }, }) } @@ -46,22 +46,23 @@ func testDatasourceTwingateUser(userID string) string { } func TestAccDatasourceTwingateUser_negative(t *testing.T) { - t.Run("Test Twingate Datasource : Acc User - does not exists", func(t *testing.T) { - userID := base64.StdEncoding.EncodeToString([]byte(fmt.Sprintf("User:%d", acctest.RandInt()))) + t.Parallel() - resource.Test(t, resource.TestCase{ - ProtoV6ProviderFactories: acctests.ProviderFactories, - PreCheck: func() { - acctests.PreCheck(t) - }, - Steps: []resource.TestStep{ - { - Config: testTwingateUserDoesNotExists(userID), - ExpectError: regexp.MustCompile("failed to read user with id"), - }, + userID := base64.StdEncoding.EncodeToString([]byte(fmt.Sprintf("User:%d", acctest.RandInt()))) + + resource.Test(t, resource.TestCase{ + ProtoV6ProviderFactories: acctests.ProviderFactories, + PreCheck: func() { + acctests.PreCheck(t) + }, + Steps: []resource.TestStep{ + { + Config: testTwingateUserDoesNotExists(userID), + ExpectError: regexp.MustCompile("failed to read user with id"), }, - }) + }, }) + } func testTwingateUserDoesNotExists(id string) string { @@ -73,20 +74,20 @@ func testTwingateUserDoesNotExists(id string) string { } func TestAccDatasourceTwingateUser_invalidID(t *testing.T) { - t.Run("Test Twingate Datasource : Acc User - failed parse ID", func(t *testing.T) { - userID := acctest.RandString(10) + t.Parallel() - resource.Test(t, resource.TestCase{ - ProtoV6ProviderFactories: acctests.ProviderFactories, - PreCheck: func() { - acctests.PreCheck(t) - }, - Steps: []resource.TestStep{ - { - Config: testTwingateUserDoesNotExists(userID), - ExpectError: regexp.MustCompile("failed to read user with id"), - }, + userID := acctest.RandString(10) + + resource.Test(t, resource.TestCase{ + ProtoV6ProviderFactories: acctests.ProviderFactories, + PreCheck: func() { + acctests.PreCheck(t) + }, + Steps: []resource.TestStep{ + { + Config: testTwingateUserDoesNotExists(userID), + ExpectError: regexp.MustCompile("failed to read user with id"), }, - }) + }, }) } diff --git a/twingate/internal/test/acctests/datasource/users_test.go b/twingate/internal/test/acctests/datasource/users_test.go index 25c47341..ad0d08b4 100644 --- a/twingate/internal/test/acctests/datasource/users_test.go +++ b/twingate/internal/test/acctests/datasource/users_test.go @@ -15,27 +15,26 @@ import ( ) func TestAccDatasourceTwingateUsers_basic(t *testing.T) { - t.Run("Test Twingate Datasource : Acc Users Basic", func(t *testing.T) { - users, err := acctests.GetTestUsers() - if err != nil && !errors.Is(err, acctests.ErrResourceNotFound) { - t.Skip("can't run test:", err) - } + t.Parallel() + + users, err := acctests.GetTestUsers() + if err != nil && !errors.Is(err, acctests.ErrResourceNotFound) { + t.Skip("can't run test:", err) + } - acctests.SetPageLimit(len(users)/3 + 1) - - resource.Test(t, resource.TestCase{ - ProtoV6ProviderFactories: acctests.ProviderFactories, - PreCheck: func() { acctests.PreCheck(t) }, - Steps: []resource.TestStep{ - { - Config: testDatasourceTwingateUsers(), - Check: acctests.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("data.twingate_users.all", attr.Len(attr.Users), fmt.Sprintf("%d", len(users))), - ), - }, + resource.Test(t, resource.TestCase{ + ProtoV6ProviderFactories: acctests.ProviderFactories, + PreCheck: func() { acctests.PreCheck(t) }, + Steps: []resource.TestStep{ + { + Config: testDatasourceTwingateUsers(), + Check: acctests.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("data.twingate_users.all", attr.Len(attr.Users), fmt.Sprintf("%d", len(users))), + ), }, - }) + }, }) + } func testDatasourceTwingateUsers() string { diff --git a/twingate/internal/test/acctests/resource/connector-tokens_test.go b/twingate/internal/test/acctests/resource/connector-tokens_test.go index b66820e9..cc203252 100644 --- a/twingate/internal/test/acctests/resource/connector-tokens_test.go +++ b/twingate/internal/test/acctests/resource/connector-tokens_test.go @@ -12,24 +12,24 @@ import ( ) func TestAccRemoteConnectorWithTokens(t *testing.T) { - t.Run("Test Twingate Resource : Acc Remote Connector With Tokens", func(t *testing.T) { - const terraformResourceName = "test_t1" - theResource := acctests.TerraformConnectorTokens(terraformResourceName) - remoteNetworkName := test.RandomName() + t.Parallel() - sdk.Test(t, sdk.TestCase{ - ProtoV6ProviderFactories: acctests.ProviderFactories, - PreCheck: func() { acctests.PreCheck(t) }, - CheckDestroy: acctests.CheckTwingateConnectorTokensInvalidated, - Steps: []sdk.TestStep{ - { - Config: terraformResourceTwingateConnectorTokens(terraformResourceName, remoteNetworkName), - Check: acctests.ComposeTestCheckFunc( - checkTwingateConnectorTokensSet(theResource), - ), - }, + const terraformResourceName = "test_t1" + theResource := acctests.TerraformConnectorTokens(terraformResourceName) + remoteNetworkName := test.RandomName() + + sdk.Test(t, sdk.TestCase{ + ProtoV6ProviderFactories: acctests.ProviderFactories, + PreCheck: func() { acctests.PreCheck(t) }, + CheckDestroy: acctests.CheckTwingateConnectorTokensInvalidated, + Steps: []sdk.TestStep{ + { + Config: terraformResourceTwingateConnectorTokens(terraformResourceName, remoteNetworkName), + Check: acctests.ComposeTestCheckFunc( + checkTwingateConnectorTokensSet(theResource), + ), }, - }) + }, }) } diff --git a/twingate/internal/test/acctests/resource/connector_test.go b/twingate/internal/test/acctests/resource/connector_test.go index 933e9b20..9996c396 100644 --- a/twingate/internal/test/acctests/resource/connector_test.go +++ b/twingate/internal/test/acctests/resource/connector_test.go @@ -14,139 +14,139 @@ import ( ) func TestAccRemoteConnectorCreate(t *testing.T) { - t.Run("Test Twingate Resource : Acc Remote Connector", func(t *testing.T) { - const terraformResourceName = "test_c1" - theResource := acctests.TerraformConnector(terraformResourceName) - remoteNetworkName := test.RandomName() - - sdk.Test(t, sdk.TestCase{ - ProtoV6ProviderFactories: acctests.ProviderFactories, - PreCheck: func() { acctests.PreCheck(t) }, - CheckDestroy: acctests.CheckTwingateConnectorAndRemoteNetworkDestroy, - Steps: []sdk.TestStep{ - { - Config: terraformResourceTwingateConnector(terraformResourceName, terraformResourceName, remoteNetworkName), - Check: acctests.ComposeTestCheckFunc( - checkTwingateConnectorSetWithRemoteNetwork(theResource, acctests.TerraformRemoteNetwork(terraformResourceName)), - sdk.TestCheckResourceAttrSet(theResource, attr.Name), - ), - }, + t.Parallel() + + const terraformResourceName = "test_c1" + theResource := acctests.TerraformConnector(terraformResourceName) + remoteNetworkName := test.RandomName() + + sdk.Test(t, sdk.TestCase{ + ProtoV6ProviderFactories: acctests.ProviderFactories, + PreCheck: func() { acctests.PreCheck(t) }, + CheckDestroy: acctests.CheckTwingateConnectorAndRemoteNetworkDestroy, + Steps: []sdk.TestStep{ + { + Config: terraformResourceTwingateConnector(terraformResourceName, terraformResourceName, remoteNetworkName), + Check: acctests.ComposeTestCheckFunc( + checkTwingateConnectorSetWithRemoteNetwork(theResource, acctests.TerraformRemoteNetwork(terraformResourceName)), + sdk.TestCheckResourceAttrSet(theResource, attr.Name), + ), }, - }) + }, }) } func TestAccRemoteConnectorWithCustomName(t *testing.T) { - t.Run("Test Twingate Resource : Acc Remote Connector With Custom Name", func(t *testing.T) { - const terraformResourceName = "test_c2" - theResource := acctests.TerraformConnector(terraformResourceName) - remoteNetworkName := test.RandomName() - connectorName := test.RandomConnectorName() - - sdk.Test(t, sdk.TestCase{ - ProtoV6ProviderFactories: acctests.ProviderFactories, - PreCheck: func() { acctests.PreCheck(t) }, - CheckDestroy: acctests.CheckTwingateConnectorAndRemoteNetworkDestroy, - Steps: []sdk.TestStep{ - { - Config: terraformResourceTwingateConnectorWithName(terraformResourceName, remoteNetworkName, connectorName), - Check: acctests.ComposeTestCheckFunc( - checkTwingateConnectorSetWithRemoteNetwork(theResource, acctests.TerraformRemoteNetwork(terraformResourceName)), - sdk.TestMatchResourceAttr(theResource, attr.Name, regexp.MustCompile(connectorName)), - ), - }, + t.Parallel() + + const terraformResourceName = "test_c2" + theResource := acctests.TerraformConnector(terraformResourceName) + remoteNetworkName := test.RandomName() + connectorName := test.RandomConnectorName() + + sdk.Test(t, sdk.TestCase{ + ProtoV6ProviderFactories: acctests.ProviderFactories, + PreCheck: func() { acctests.PreCheck(t) }, + CheckDestroy: acctests.CheckTwingateConnectorAndRemoteNetworkDestroy, + Steps: []sdk.TestStep{ + { + Config: terraformResourceTwingateConnectorWithName(terraformResourceName, remoteNetworkName, connectorName), + Check: acctests.ComposeTestCheckFunc( + checkTwingateConnectorSetWithRemoteNetwork(theResource, acctests.TerraformRemoteNetwork(terraformResourceName)), + sdk.TestMatchResourceAttr(theResource, attr.Name, regexp.MustCompile(connectorName)), + ), }, - }) + }, }) } func TestAccRemoteConnectorImport(t *testing.T) { - t.Run("Test Twingate Resource : Acc Remote Connector - Import", func(t *testing.T) { - const terraformResourceName = "test_c3" - theResource := acctests.TerraformConnector(terraformResourceName) - remoteNetworkName := test.RandomName() - connectorName := test.RandomConnectorName() - - sdk.Test(t, sdk.TestCase{ - ProtoV6ProviderFactories: acctests.ProviderFactories, - PreCheck: func() { acctests.PreCheck(t) }, - CheckDestroy: acctests.CheckTwingateConnectorAndRemoteNetworkDestroy, - Steps: []sdk.TestStep{ - { - Config: terraformResourceTwingateConnectorWithName(terraformResourceName, remoteNetworkName, connectorName), - Check: acctests.ComposeTestCheckFunc( - checkTwingateConnectorSetWithRemoteNetwork(theResource, acctests.TerraformRemoteNetwork(terraformResourceName)), - sdk.TestMatchResourceAttr(theResource, attr.Name, regexp.MustCompile(connectorName[:len(connectorName)-3]+".*")), - ), - }, - { - ResourceName: theResource, - ImportState: true, - ImportStateVerify: true, - }, + t.Parallel() + + const terraformResourceName = "test_c3" + theResource := acctests.TerraformConnector(terraformResourceName) + remoteNetworkName := test.RandomName() + connectorName := test.RandomConnectorName() + + sdk.Test(t, sdk.TestCase{ + ProtoV6ProviderFactories: acctests.ProviderFactories, + PreCheck: func() { acctests.PreCheck(t) }, + CheckDestroy: acctests.CheckTwingateConnectorAndRemoteNetworkDestroy, + Steps: []sdk.TestStep{ + { + Config: terraformResourceTwingateConnectorWithName(terraformResourceName, remoteNetworkName, connectorName), + Check: acctests.ComposeTestCheckFunc( + checkTwingateConnectorSetWithRemoteNetwork(theResource, acctests.TerraformRemoteNetwork(terraformResourceName)), + sdk.TestMatchResourceAttr(theResource, attr.Name, regexp.MustCompile(connectorName[:len(connectorName)-3]+".*")), + ), }, - }) + { + ResourceName: theResource, + ImportState: true, + ImportStateVerify: true, + }, + }, }) } func TestAccRemoteConnectorNotAllowedToChangeRemoteNetworkId(t *testing.T) { - t.Run("Test Twingate Resource : Acc Remote Connector - should fail on remote_network_id update", func(t *testing.T) { - const ( - terraformConnectorName = "test_c4" - terraformRemoteNetworkName1 = "test_c4_1" - terraformRemoteNetworkName2 = "test_c4_2" - ) - theResource := acctests.TerraformConnector(terraformConnectorName) - remoteNetworkName1 := test.RandomName() - remoteNetworkName2 := test.RandomName() - - sdk.Test(t, sdk.TestCase{ - ProtoV6ProviderFactories: acctests.ProviderFactories, - PreCheck: func() { acctests.PreCheck(t) }, - CheckDestroy: acctests.CheckTwingateConnectorAndRemoteNetworkDestroy, - Steps: []sdk.TestStep{ - { - Config: terraformResourceTwingateConnector(terraformRemoteNetworkName1, terraformConnectorName, remoteNetworkName1), - Check: acctests.ComposeTestCheckFunc( - checkTwingateConnectorSetWithRemoteNetwork(theResource, acctests.TerraformRemoteNetwork(terraformRemoteNetworkName1)), - ), - }, - { - Config: terraformResourceTwingateConnector(terraformRemoteNetworkName2, terraformConnectorName, remoteNetworkName2), - ExpectError: regexp.MustCompile(resource.ErrNotAllowChangeRemoteNetworkID.Error()), - }, + t.Parallel() + + const ( + terraformConnectorName = "test_c4" + terraformRemoteNetworkName1 = "test_c4_1" + terraformRemoteNetworkName2 = "test_c4_2" + ) + theResource := acctests.TerraformConnector(terraformConnectorName) + remoteNetworkName1 := test.RandomName() + remoteNetworkName2 := test.RandomName() + + sdk.Test(t, sdk.TestCase{ + ProtoV6ProviderFactories: acctests.ProviderFactories, + PreCheck: func() { acctests.PreCheck(t) }, + CheckDestroy: acctests.CheckTwingateConnectorAndRemoteNetworkDestroy, + Steps: []sdk.TestStep{ + { + Config: terraformResourceTwingateConnector(terraformRemoteNetworkName1, terraformConnectorName, remoteNetworkName1), + Check: acctests.ComposeTestCheckFunc( + checkTwingateConnectorSetWithRemoteNetwork(theResource, acctests.TerraformRemoteNetwork(terraformRemoteNetworkName1)), + ), + }, + { + Config: terraformResourceTwingateConnector(terraformRemoteNetworkName2, terraformConnectorName, remoteNetworkName2), + ExpectError: regexp.MustCompile(resource.ErrNotAllowChangeRemoteNetworkID.Error()), }, - }) + }, }) } func TestAccTwingateConnectorReCreateAfterDeletion(t *testing.T) { - t.Run("Test Twingate Resource : Acc Remote Connector ReCreate After Deletion", func(t *testing.T) { - const terraformResourceName = "test_c5" - theResource := acctests.TerraformConnector(terraformResourceName) - remoteNetworkName := test.RandomName() - - sdk.Test(t, sdk.TestCase{ - ProtoV6ProviderFactories: acctests.ProviderFactories, - PreCheck: func() { acctests.PreCheck(t) }, - CheckDestroy: acctests.CheckTwingateConnectorAndRemoteNetworkDestroy, - Steps: []sdk.TestStep{ - { - Config: terraformResourceTwingateConnector(terraformResourceName, terraformResourceName, remoteNetworkName), - Check: acctests.ComposeTestCheckFunc( - checkTwingateConnectorSetWithRemoteNetwork(theResource, acctests.TerraformRemoteNetwork(terraformResourceName)), - acctests.DeleteTwingateResource(theResource, resource.TwingateConnector), - ), - ExpectNonEmptyPlan: true, - }, - { - Config: terraformResourceTwingateConnector(terraformResourceName, terraformResourceName, remoteNetworkName), - Check: acctests.ComposeTestCheckFunc( - checkTwingateConnectorSetWithRemoteNetwork(theResource, acctests.TerraformRemoteNetwork(terraformResourceName)), - ), - }, + t.Parallel() + + const terraformResourceName = "test_c5" + theResource := acctests.TerraformConnector(terraformResourceName) + remoteNetworkName := test.RandomName() + + sdk.Test(t, sdk.TestCase{ + ProtoV6ProviderFactories: acctests.ProviderFactories, + PreCheck: func() { acctests.PreCheck(t) }, + CheckDestroy: acctests.CheckTwingateConnectorAndRemoteNetworkDestroy, + Steps: []sdk.TestStep{ + { + Config: terraformResourceTwingateConnector(terraformResourceName, terraformResourceName, remoteNetworkName), + Check: acctests.ComposeTestCheckFunc( + checkTwingateConnectorSetWithRemoteNetwork(theResource, acctests.TerraformRemoteNetwork(terraformResourceName)), + acctests.DeleteTwingateResource(theResource, resource.TwingateConnector), + ), + ExpectNonEmptyPlan: true, }, - }) + { + Config: terraformResourceTwingateConnector(terraformResourceName, terraformResourceName, remoteNetworkName), + Check: acctests.ComposeTestCheckFunc( + checkTwingateConnectorSetWithRemoteNetwork(theResource, acctests.TerraformRemoteNetwork(terraformResourceName)), + ), + }, + }, }) } @@ -196,77 +196,77 @@ func checkTwingateConnectorSetWithRemoteNetwork(connectorResource, remoteNetwork } func TestAccRemoteConnectorUpdateName(t *testing.T) { - t.Run("Test Twingate Resource : Acc Remote Connector Update Name", func(t *testing.T) { - const terraformResourceName = "test_c6" - theResource := acctests.TerraformConnector(terraformResourceName) - remoteNetworkName := test.RandomName() - connectorName := test.RandomConnectorName() - - sdk.Test(t, sdk.TestCase{ - ProtoV6ProviderFactories: acctests.ProviderFactories, - PreCheck: func() { acctests.PreCheck(t) }, - CheckDestroy: acctests.CheckTwingateConnectorAndRemoteNetworkDestroy, - Steps: []sdk.TestStep{ - { - Config: terraformResourceTwingateConnector(terraformResourceName, terraformResourceName, remoteNetworkName), - Check: acctests.ComposeTestCheckFunc( - checkTwingateConnectorSetWithRemoteNetwork(theResource, acctests.TerraformRemoteNetwork(terraformResourceName)), - sdk.TestCheckResourceAttrSet(theResource, attr.Name), - ), - }, - { - Config: terraformResourceTwingateConnectorWithName(terraformResourceName, remoteNetworkName, connectorName), - Check: acctests.ComposeTestCheckFunc( - sdk.TestCheckResourceAttr(theResource, attr.Name, connectorName), - ), - }, + t.Parallel() + + const terraformResourceName = "test_c6" + theResource := acctests.TerraformConnector(terraformResourceName) + remoteNetworkName := test.RandomName() + connectorName := test.RandomConnectorName() + + sdk.Test(t, sdk.TestCase{ + ProtoV6ProviderFactories: acctests.ProviderFactories, + PreCheck: func() { acctests.PreCheck(t) }, + CheckDestroy: acctests.CheckTwingateConnectorAndRemoteNetworkDestroy, + Steps: []sdk.TestStep{ + { + Config: terraformResourceTwingateConnector(terraformResourceName, terraformResourceName, remoteNetworkName), + Check: acctests.ComposeTestCheckFunc( + checkTwingateConnectorSetWithRemoteNetwork(theResource, acctests.TerraformRemoteNetwork(terraformResourceName)), + sdk.TestCheckResourceAttrSet(theResource, attr.Name), + ), }, - }) + { + Config: terraformResourceTwingateConnectorWithName(terraformResourceName, remoteNetworkName, connectorName), + Check: acctests.ComposeTestCheckFunc( + sdk.TestCheckResourceAttr(theResource, attr.Name, connectorName), + ), + }, + }, }) } func TestAccRemoteConnectorCreateWithNotificationStatus(t *testing.T) { - t.Run("Test Twingate Resource : Acc Remote Connector With Notification Status", func(t *testing.T) { - const terraformResourceName = "test_c7" - theResource := acctests.TerraformConnector(terraformResourceName) - remoteNetworkName := test.RandomName() - - sdk.Test(t, sdk.TestCase{ - ProtoV6ProviderFactories: acctests.ProviderFactories, - PreCheck: func() { acctests.PreCheck(t) }, - CheckDestroy: acctests.CheckTwingateConnectorAndRemoteNetworkDestroy, - Steps: []sdk.TestStep{ - { - Config: terraformResourceTwingateConnector(terraformResourceName, terraformResourceName, remoteNetworkName), - Check: acctests.ComposeTestCheckFunc( - checkTwingateConnectorSetWithRemoteNetwork(theResource, acctests.TerraformRemoteNetwork(terraformResourceName)), - sdk.TestCheckResourceAttrSet(theResource, attr.Name), - ), - }, - { - // expecting no changes, as by default notifications enabled - PlanOnly: true, - Config: terraformResourceTwingateConnectorWithNotificationStatus(terraformResourceName, terraformResourceName, remoteNetworkName, true), - Check: acctests.ComposeTestCheckFunc( - sdk.TestCheckResourceAttr(theResource, attr.StatusUpdatesEnabled, "true"), - ), - }, - { - Config: terraformResourceTwingateConnectorWithNotificationStatus(terraformResourceName, terraformResourceName, remoteNetworkName, false), - Check: acctests.ComposeTestCheckFunc( - sdk.TestCheckResourceAttr(theResource, attr.StatusUpdatesEnabled, "false"), - ), - }, - { - // expecting no changes, when user removes `status_updates_enabled` field from terraform - PlanOnly: true, - Config: terraformResourceTwingateConnector(terraformResourceName, terraformResourceName, remoteNetworkName), - Check: acctests.ComposeTestCheckFunc( - sdk.TestCheckResourceAttr(theResource, attr.StatusUpdatesEnabled, "false"), - ), - }, + t.Parallel() + + const terraformResourceName = "test_c7" + theResource := acctests.TerraformConnector(terraformResourceName) + remoteNetworkName := test.RandomName() + + sdk.Test(t, sdk.TestCase{ + ProtoV6ProviderFactories: acctests.ProviderFactories, + PreCheck: func() { acctests.PreCheck(t) }, + CheckDestroy: acctests.CheckTwingateConnectorAndRemoteNetworkDestroy, + Steps: []sdk.TestStep{ + { + Config: terraformResourceTwingateConnector(terraformResourceName, terraformResourceName, remoteNetworkName), + Check: acctests.ComposeTestCheckFunc( + checkTwingateConnectorSetWithRemoteNetwork(theResource, acctests.TerraformRemoteNetwork(terraformResourceName)), + sdk.TestCheckResourceAttrSet(theResource, attr.Name), + ), }, - }) + { + // expecting no changes, as by default notifications enabled + PlanOnly: true, + Config: terraformResourceTwingateConnectorWithNotificationStatus(terraformResourceName, terraformResourceName, remoteNetworkName, true), + Check: acctests.ComposeTestCheckFunc( + sdk.TestCheckResourceAttr(theResource, attr.StatusUpdatesEnabled, "true"), + ), + }, + { + Config: terraformResourceTwingateConnectorWithNotificationStatus(terraformResourceName, terraformResourceName, remoteNetworkName, false), + Check: acctests.ComposeTestCheckFunc( + sdk.TestCheckResourceAttr(theResource, attr.StatusUpdatesEnabled, "false"), + ), + }, + { + // expecting no changes, when user removes `status_updates_enabled` field from terraform + PlanOnly: true, + Config: terraformResourceTwingateConnector(terraformResourceName, terraformResourceName, remoteNetworkName), + Check: acctests.ComposeTestCheckFunc( + sdk.TestCheckResourceAttr(theResource, attr.StatusUpdatesEnabled, "false"), + ), + }, + }, }) } @@ -282,6 +282,8 @@ func terraformResourceTwingateConnectorWithNotificationStatus(terraformRemoteNet } func TestAccRemoteConnectorCreateWithNotificationStatusFalse(t *testing.T) { + t.Parallel() + const terraformResourceName = "test_c8" theResource := acctests.TerraformConnector(terraformResourceName) remoteNetworkName := test.RandomName() diff --git a/twingate/internal/test/acctests/resource/group_test.go b/twingate/internal/test/acctests/resource/group_test.go index 531b063d..d92de38b 100644 --- a/twingate/internal/test/acctests/resource/group_test.go +++ b/twingate/internal/test/acctests/resource/group_test.go @@ -18,33 +18,33 @@ var ( ) func TestAccTwingateGroupCreateUpdate(t *testing.T) { - t.Run("Test Twingate Resource : Acc Group Create/Update", func(t *testing.T) { - const terraformResourceName = "test001" - theResource := acctests.TerraformGroup(terraformResourceName) - nameBefore := test.RandomName() - nameAfter := test.RandomName() - - sdk.Test(t, sdk.TestCase{ - ProtoV6ProviderFactories: acctests.ProviderFactories, - PreCheck: func() { acctests.PreCheck(t) }, - CheckDestroy: acctests.CheckTwingateGroupDestroy, - Steps: []sdk.TestStep{ - { - Config: terraformResourceTwingateGroup(terraformResourceName, nameBefore), - Check: acctests.ComposeTestCheckFunc( - acctests.CheckTwingateResourceExists(theResource), - sdk.TestCheckResourceAttr(theResource, attr.Name, nameBefore), - ), - }, - { - Config: terraformResourceTwingateGroup(terraformResourceName, nameAfter), - Check: acctests.ComposeTestCheckFunc( - acctests.CheckTwingateResourceExists(theResource), - sdk.TestCheckResourceAttr(theResource, attr.Name, nameAfter), - ), - }, + t.Parallel() + + const terraformResourceName = "test001" + theResource := acctests.TerraformGroup(terraformResourceName) + nameBefore := test.RandomName() + nameAfter := test.RandomName() + + sdk.Test(t, sdk.TestCase{ + ProtoV6ProviderFactories: acctests.ProviderFactories, + PreCheck: func() { acctests.PreCheck(t) }, + CheckDestroy: acctests.CheckTwingateGroupDestroy, + Steps: []sdk.TestStep{ + { + Config: terraformResourceTwingateGroup(terraformResourceName, nameBefore), + Check: acctests.ComposeTestCheckFunc( + acctests.CheckTwingateResourceExists(theResource), + sdk.TestCheckResourceAttr(theResource, attr.Name, nameBefore), + ), }, - }) + { + Config: terraformResourceTwingateGroup(terraformResourceName, nameAfter), + Check: acctests.ComposeTestCheckFunc( + acctests.CheckTwingateResourceExists(theResource), + sdk.TestCheckResourceAttr(theResource, attr.Name, nameAfter), + ), + }, + }, }) } @@ -57,107 +57,107 @@ func terraformResourceTwingateGroup(terraformResourceName, name string) string { } func TestAccTwingateGroupDeleteNonExisting(t *testing.T) { - t.Run("Test Twingate Resource : Acc Group Delete NonExisting", func(t *testing.T) { - const terraformResourceName = "test002" - theResource := acctests.TerraformGroup(terraformResourceName) - groupName := test.RandomName() - - sdk.Test(t, sdk.TestCase{ - ProtoV6ProviderFactories: acctests.ProviderFactories, - PreCheck: func() { acctests.PreCheck(t) }, - CheckDestroy: acctests.CheckTwingateGroupDestroy, - Steps: []sdk.TestStep{ - { - Config: terraformResourceTwingateGroup(terraformResourceName, groupName), - Destroy: true, - }, - { - Config: terraformResourceTwingateGroup(terraformResourceName, groupName), - ConfigPlanChecks: sdk.ConfigPlanChecks{ - PreApply: []plancheck.PlanCheck{ - plancheck.ExpectResourceAction(theResource, plancheck.ResourceActionCreate), - }, + t.Parallel() + + const terraformResourceName = "test002" + theResource := acctests.TerraformGroup(terraformResourceName) + groupName := test.RandomName() + + sdk.Test(t, sdk.TestCase{ + ProtoV6ProviderFactories: acctests.ProviderFactories, + PreCheck: func() { acctests.PreCheck(t) }, + CheckDestroy: acctests.CheckTwingateGroupDestroy, + Steps: []sdk.TestStep{ + { + Config: terraformResourceTwingateGroup(terraformResourceName, groupName), + Destroy: true, + }, + { + Config: terraformResourceTwingateGroup(terraformResourceName, groupName), + ConfigPlanChecks: sdk.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(theResource, plancheck.ResourceActionCreate), }, }, }, - }) + }, }) } func TestAccTwingateGroupReCreateAfterDeletion(t *testing.T) { - t.Run("Test Twingate Resource : Acc Group Create After Deletion", func(t *testing.T) { - const terraformResourceName = "test003" - theResource := acctests.TerraformGroup(terraformResourceName) - groupName := test.RandomName() - - sdk.Test(t, sdk.TestCase{ - ProtoV6ProviderFactories: acctests.ProviderFactories, - PreCheck: func() { acctests.PreCheck(t) }, - CheckDestroy: acctests.CheckTwingateGroupDestroy, - Steps: []sdk.TestStep{ - { - Config: terraformResourceTwingateGroup(terraformResourceName, groupName), - Check: acctests.ComposeTestCheckFunc( - acctests.CheckTwingateResourceExists(theResource), - acctests.DeleteTwingateResource(theResource, resource.TwingateGroup), - ), - ExpectNonEmptyPlan: true, - }, - { - Config: terraformResourceTwingateGroup(terraformResourceName, groupName), - Check: acctests.ComposeTestCheckFunc( - acctests.CheckTwingateResourceExists(theResource), - ), - }, + t.Parallel() + + const terraformResourceName = "test003" + theResource := acctests.TerraformGroup(terraformResourceName) + groupName := test.RandomName() + + sdk.Test(t, sdk.TestCase{ + ProtoV6ProviderFactories: acctests.ProviderFactories, + PreCheck: func() { acctests.PreCheck(t) }, + CheckDestroy: acctests.CheckTwingateGroupDestroy, + Steps: []sdk.TestStep{ + { + Config: terraformResourceTwingateGroup(terraformResourceName, groupName), + Check: acctests.ComposeTestCheckFunc( + acctests.CheckTwingateResourceExists(theResource), + acctests.DeleteTwingateResource(theResource, resource.TwingateGroup), + ), + ExpectNonEmptyPlan: true, + }, + { + Config: terraformResourceTwingateGroup(terraformResourceName, groupName), + Check: acctests.ComposeTestCheckFunc( + acctests.CheckTwingateResourceExists(theResource), + ), }, - }) + }, }) } func TestAccTwingateGroupWithSecurityPolicy(t *testing.T) { - t.Run("Test Twingate Resource : Acc Group Create/Update - With Security Policy", func(t *testing.T) { - const terraformResourceName = "test004" - theResource := acctests.TerraformGroup(terraformResourceName) - name := test.RandomName() - - securityPolicies, err := acctests.ListSecurityPolicies() - if err != nil { - t.Skip("can't run test:", err) - } - - testPolicy := securityPolicies[0] - - sdk.Test(t, sdk.TestCase{ - ProtoV6ProviderFactories: acctests.ProviderFactories, - PreCheck: func() { acctests.PreCheck(t) }, - CheckDestroy: acctests.CheckTwingateGroupDestroy, - Steps: []sdk.TestStep{ - { - Config: terraformResourceTwingateGroup(terraformResourceName, name), - Check: acctests.ComposeTestCheckFunc( - acctests.CheckTwingateResourceExists(theResource), - sdk.TestCheckResourceAttr(theResource, attr.Name, name), - ), - }, - { - Config: terraformResourceTwingateGroupWithSecurityPolicy(terraformResourceName, name, testPolicy.ID), - Check: acctests.ComposeTestCheckFunc( - acctests.CheckTwingateResourceExists(theResource), - sdk.TestCheckResourceAttr(theResource, attr.Name, name), - sdk.TestCheckResourceAttr(theResource, attr.SecurityPolicyID, testPolicy.ID), - ), - }, - { - // expecting no changes - PlanOnly: true, - Config: terraformResourceTwingateGroup(terraformResourceName, name), - Check: acctests.ComposeTestCheckFunc( - acctests.CheckTwingateResourceExists(theResource), - sdk.TestCheckResourceAttr(theResource, attr.Name, name), - ), - }, + t.Parallel() + + const terraformResourceName = "test004" + theResource := acctests.TerraformGroup(terraformResourceName) + name := test.RandomName() + + securityPolicies, err := acctests.ListSecurityPolicies() + if err != nil { + t.Skip("can't run test:", err) + } + + testPolicy := securityPolicies[0] + + sdk.Test(t, sdk.TestCase{ + ProtoV6ProviderFactories: acctests.ProviderFactories, + PreCheck: func() { acctests.PreCheck(t) }, + CheckDestroy: acctests.CheckTwingateGroupDestroy, + Steps: []sdk.TestStep{ + { + Config: terraformResourceTwingateGroup(terraformResourceName, name), + Check: acctests.ComposeTestCheckFunc( + acctests.CheckTwingateResourceExists(theResource), + sdk.TestCheckResourceAttr(theResource, attr.Name, name), + ), + }, + { + Config: terraformResourceTwingateGroupWithSecurityPolicy(terraformResourceName, name, testPolicy.ID), + Check: acctests.ComposeTestCheckFunc( + acctests.CheckTwingateResourceExists(theResource), + sdk.TestCheckResourceAttr(theResource, attr.Name, name), + sdk.TestCheckResourceAttr(theResource, attr.SecurityPolicyID, testPolicy.ID), + ), + }, + { + // expecting no changes + PlanOnly: true, + Config: terraformResourceTwingateGroup(terraformResourceName, name), + Check: acctests.ComposeTestCheckFunc( + acctests.CheckTwingateResourceExists(theResource), + sdk.TestCheckResourceAttr(theResource, attr.Name, name), + ), }, - }) + }, }) } @@ -171,92 +171,92 @@ func terraformResourceTwingateGroupWithSecurityPolicy(terraformResourceName, nam } func TestAccTwingateGroupUsersAuthoritativeByDefault(t *testing.T) { - t.Run("Test Twingate Resource : Acc Group Users Authoritative By Default", func(t *testing.T) { - const terraformResourceName = "test005" - theResource := acctests.TerraformGroup(terraformResourceName) - groupName := test.RandomName() - - users, userIDs := genNewUsers("u005", 3) - - sdk.Test(t, sdk.TestCase{ - ProtoV6ProviderFactories: acctests.ProviderFactories, - PreCheck: func() { acctests.PreCheck(t) }, - CheckDestroy: acctests.CheckTwingateGroupDestroy, - Steps: []sdk.TestStep{ - { - Config: terraformResourceTwingateGroupWithUsers(terraformResourceName, groupName, users, userIDs[:1]), - Check: acctests.ComposeTestCheckFunc( - sdk.TestCheckResourceAttr(theResource, userIdsLen, "1"), - acctests.CheckGroupUsersLen(theResource, 1), - ), - }, - { - Config: terraformResourceTwingateGroupWithUsers(terraformResourceName, groupName, users, userIDs[:1]), - Check: acctests.ComposeTestCheckFunc( - // added new user to the group though API - acctests.AddGroupUser(theResource, groupName, userIDs[1]), - acctests.WaitTestFunc(), - acctests.CheckGroupUsersLen(theResource, 2), - ), - // expecting drift - terraform going to remove unknown user - ExpectNonEmptyPlan: true, - }, - { - Config: terraformResourceTwingateGroupWithUsers(terraformResourceName, groupName, users, userIDs[:1]), - Check: acctests.ComposeTestCheckFunc( - sdk.TestCheckResourceAttr(theResource, userIdsLen, "1"), - acctests.CheckGroupUsersLen(theResource, 1), - ), - }, - { - // added 2 new users to the group though terraform - Config: terraformResourceTwingateGroupWithUsers(terraformResourceName, groupName, users, userIDs[:3]), - Check: acctests.ComposeTestCheckFunc( - sdk.TestCheckResourceAttr(theResource, userIdsLen, "3"), - acctests.CheckGroupUsersLen(theResource, 3), - ), - }, - { - Config: terraformResourceTwingateGroupWithUsers(terraformResourceName, groupName, users, userIDs[:3]), - Check: acctests.ComposeTestCheckFunc( - // delete one user from the group though API - acctests.DeleteGroupUser(theResource, userIDs[2]), - acctests.WaitTestFunc(), - sdk.TestCheckResourceAttr(theResource, userIdsLen, "3"), - acctests.CheckGroupUsersLen(theResource, 2), - ), - // expecting drift - terraform going to restore deleted user - ExpectNonEmptyPlan: true, - }, - { - Config: terraformResourceTwingateGroupWithUsers(terraformResourceName, groupName, users, userIDs[:3]), - Check: acctests.ComposeTestCheckFunc( - sdk.TestCheckResourceAttr(theResource, userIdsLen, "3"), - acctests.CheckGroupUsersLen(theResource, 3), - ), - }, - { - // remove 2 users from the group though terraform - Config: terraformResourceTwingateGroupWithUsers(terraformResourceName, groupName, users, userIDs[:1]), - Check: acctests.ComposeTestCheckFunc( - sdk.TestCheckResourceAttr(theResource, userIdsLen, "1"), - acctests.CheckGroupUsersLen(theResource, 1), - ), - }, - { - // expecting no drift - Config: terraformResourceTwingateGroupWithUsersAuthoritative(terraformResourceName, groupName, users, userIDs[:1], true), - PlanOnly: true, - }, - { - Config: terraformResourceTwingateGroupWithUsersAuthoritative(terraformResourceName, groupName, users, userIDs[:2], true), - Check: acctests.ComposeTestCheckFunc( - sdk.TestCheckResourceAttr(theResource, userIdsLen, "2"), - acctests.CheckGroupUsersLen(theResource, 2), - ), - }, + t.Parallel() + + const terraformResourceName = "test005" + theResource := acctests.TerraformGroup(terraformResourceName) + groupName := test.RandomName() + + users, userIDs := genNewUsers("u005", 3) + + sdk.Test(t, sdk.TestCase{ + ProtoV6ProviderFactories: acctests.ProviderFactories, + PreCheck: func() { acctests.PreCheck(t) }, + CheckDestroy: acctests.CheckTwingateGroupDestroy, + Steps: []sdk.TestStep{ + { + Config: terraformResourceTwingateGroupWithUsers(terraformResourceName, groupName, users, userIDs[:1]), + Check: acctests.ComposeTestCheckFunc( + sdk.TestCheckResourceAttr(theResource, userIdsLen, "1"), + acctests.CheckGroupUsersLen(theResource, 1), + ), + }, + { + Config: terraformResourceTwingateGroupWithUsers(terraformResourceName, groupName, users, userIDs[:1]), + Check: acctests.ComposeTestCheckFunc( + // added new user to the group though API + acctests.AddGroupUser(theResource, groupName, userIDs[1]), + acctests.WaitTestFunc(), + acctests.CheckGroupUsersLen(theResource, 2), + ), + // expecting drift - terraform going to remove unknown user + ExpectNonEmptyPlan: true, + }, + { + Config: terraformResourceTwingateGroupWithUsers(terraformResourceName, groupName, users, userIDs[:1]), + Check: acctests.ComposeTestCheckFunc( + sdk.TestCheckResourceAttr(theResource, userIdsLen, "1"), + acctests.CheckGroupUsersLen(theResource, 1), + ), + }, + { + // added 2 new users to the group though terraform + Config: terraformResourceTwingateGroupWithUsers(terraformResourceName, groupName, users, userIDs[:3]), + Check: acctests.ComposeTestCheckFunc( + sdk.TestCheckResourceAttr(theResource, userIdsLen, "3"), + acctests.CheckGroupUsersLen(theResource, 3), + ), }, - }) + { + Config: terraformResourceTwingateGroupWithUsers(terraformResourceName, groupName, users, userIDs[:3]), + Check: acctests.ComposeTestCheckFunc( + // delete one user from the group though API + acctests.DeleteGroupUser(theResource, userIDs[2]), + acctests.WaitTestFunc(), + sdk.TestCheckResourceAttr(theResource, userIdsLen, "3"), + acctests.CheckGroupUsersLen(theResource, 2), + ), + // expecting drift - terraform going to restore deleted user + ExpectNonEmptyPlan: true, + }, + { + Config: terraformResourceTwingateGroupWithUsers(terraformResourceName, groupName, users, userIDs[:3]), + Check: acctests.ComposeTestCheckFunc( + sdk.TestCheckResourceAttr(theResource, userIdsLen, "3"), + acctests.CheckGroupUsersLen(theResource, 3), + ), + }, + { + // remove 2 users from the group though terraform + Config: terraformResourceTwingateGroupWithUsers(terraformResourceName, groupName, users, userIDs[:1]), + Check: acctests.ComposeTestCheckFunc( + sdk.TestCheckResourceAttr(theResource, userIdsLen, "1"), + acctests.CheckGroupUsersLen(theResource, 1), + ), + }, + { + // expecting no drift + Config: terraformResourceTwingateGroupWithUsersAuthoritative(terraformResourceName, groupName, users, userIDs[:1], true), + PlanOnly: true, + }, + { + Config: terraformResourceTwingateGroupWithUsersAuthoritative(terraformResourceName, groupName, users, userIDs[:2], true), + Check: acctests.ComposeTestCheckFunc( + sdk.TestCheckResourceAttr(theResource, userIdsLen, "2"), + acctests.CheckGroupUsersLen(theResource, 2), + ), + }, + }, }) } @@ -284,93 +284,91 @@ func terraformResourceTwingateGroupWithUsersAuthoritative(terraformResourceName, } func TestAccTwingateGroupUsersNotAuthoritative(t *testing.T) { - t.Run("Test Twingate Resource : Acc Group Users Not Authoritative", func(t *testing.T) { - const terraformResourceName = "test006" - theResource := acctests.TerraformGroup(terraformResourceName) - groupName := test.RandomName() - - users, userIDs := genNewUsers("u006", 3) - - sdk.Test(t, sdk.TestCase{ - ProtoV6ProviderFactories: acctests.ProviderFactories, - PreCheck: func() { acctests.PreCheck(t) }, - CheckDestroy: acctests.CheckTwingateGroupDestroy, - Steps: []sdk.TestStep{ - { - Config: terraformResourceTwingateGroupWithUsersAuthoritative(terraformResourceName, groupName, users, userIDs[:1], false), - Check: acctests.ComposeTestCheckFunc( - sdk.TestCheckResourceAttr(theResource, userIdsLen, "1"), - acctests.CheckGroupUsersLen(theResource, 1), - ), - }, - { - Config: terraformResourceTwingateGroupWithUsersAuthoritative(terraformResourceName, groupName, users, userIDs[:1], false), - Check: acctests.ComposeTestCheckFunc( - // added new user to the group though API - acctests.AddGroupUser(theResource, groupName, userIDs[2]), - acctests.WaitTestFunc(), - acctests.CheckGroupUsersLen(theResource, 2), - ), - }, - { - // added new user to the group though terraform - Config: terraformResourceTwingateGroupWithUsersAuthoritative(terraformResourceName, groupName, users, userIDs[:2], false), - Check: acctests.ComposeTestCheckFunc( - sdk.TestCheckResourceAttr(theResource, userIdsLen, "2"), - acctests.CheckGroupUsersLen(theResource, 3), - ), - }, - { - // remove one user from the group though terraform - Config: terraformResourceTwingateGroupWithUsersAuthoritative(terraformResourceName, groupName, users, userIDs[:1], false), - Check: acctests.ComposeTestCheckFunc( - sdk.TestCheckResourceAttr(theResource, userIdsLen, "1"), - acctests.CheckGroupUsersLen(theResource, 2), - // remove one user from the group though API - acctests.DeleteGroupUser(theResource, userIDs[2]), - acctests.WaitTestFunc(), - acctests.CheckGroupUsersLen(theResource, 1), - ), - }, - { - // expecting no drift - empty plan - Config: terraformResourceTwingateGroupWithUsersAuthoritative(terraformResourceName, groupName, users, userIDs[:1], false), - PlanOnly: true, - }, + t.Parallel() + + const terraformResourceName = "test006" + theResource := acctests.TerraformGroup(terraformResourceName) + groupName := test.RandomName() + + users, userIDs := genNewUsers("u006", 3) + + sdk.Test(t, sdk.TestCase{ + ProtoV6ProviderFactories: acctests.ProviderFactories, + PreCheck: func() { acctests.PreCheck(t) }, + CheckDestroy: acctests.CheckTwingateGroupDestroy, + Steps: []sdk.TestStep{ + { + Config: terraformResourceTwingateGroupWithUsersAuthoritative(terraformResourceName, groupName, users, userIDs[:1], false), + Check: acctests.ComposeTestCheckFunc( + sdk.TestCheckResourceAttr(theResource, userIdsLen, "1"), + acctests.CheckGroupUsersLen(theResource, 1), + ), + }, + { + Config: terraformResourceTwingateGroupWithUsersAuthoritative(terraformResourceName, groupName, users, userIDs[:1], false), + Check: acctests.ComposeTestCheckFunc( + // added new user to the group though API + acctests.AddGroupUser(theResource, groupName, userIDs[2]), + acctests.WaitTestFunc(), + acctests.CheckGroupUsersLen(theResource, 2), + ), + }, + { + // added new user to the group though terraform + Config: terraformResourceTwingateGroupWithUsersAuthoritative(terraformResourceName, groupName, users, userIDs[:2], false), + Check: acctests.ComposeTestCheckFunc( + sdk.TestCheckResourceAttr(theResource, userIdsLen, "2"), + acctests.CheckGroupUsersLen(theResource, 3), + ), + }, + { + // remove one user from the group though terraform + Config: terraformResourceTwingateGroupWithUsersAuthoritative(terraformResourceName, groupName, users, userIDs[:1], false), + Check: acctests.ComposeTestCheckFunc( + sdk.TestCheckResourceAttr(theResource, userIdsLen, "1"), + acctests.CheckGroupUsersLen(theResource, 2), + // remove one user from the group though API + acctests.DeleteGroupUser(theResource, userIDs[2]), + acctests.WaitTestFunc(), + acctests.CheckGroupUsersLen(theResource, 1), + ), }, - }) + { + // expecting no drift - empty plan + Config: terraformResourceTwingateGroupWithUsersAuthoritative(terraformResourceName, groupName, users, userIDs[:1], false), + PlanOnly: true, + }, + }, }) } func TestAccTwingateGroupUsersCursor(t *testing.T) { - t.Run("Test Twingate Resource : Acc Group Users Cursor", func(t *testing.T) { - acctests.SetPageLimit(1) - - const terraformResourceName = "test007" - theResource := acctests.TerraformGroup(terraformResourceName) - groupName := test.RandomName() - - users, userIDs := genNewUsers("u007", 3) - - sdk.Test(t, sdk.TestCase{ - ProtoV6ProviderFactories: acctests.ProviderFactories, - PreCheck: func() { acctests.PreCheck(t) }, - CheckDestroy: acctests.CheckTwingateGroupDestroy, - Steps: []sdk.TestStep{ - { - Config: terraformResourceTwingateGroupAndUsers(terraformResourceName, groupName, users, userIDs), - Check: acctests.ComposeTestCheckFunc( - acctests.CheckGroupUsersLen(theResource, len(users)), - ), - }, - { - Config: terraformResourceTwingateGroupAndUsers(terraformResourceName, groupName, users, userIDs[:2]), - Check: acctests.ComposeTestCheckFunc( - acctests.CheckGroupUsersLen(theResource, 2), - ), - }, + t.Parallel() + + const terraformResourceName = "test007" + theResource := acctests.TerraformGroup(terraformResourceName) + groupName := test.RandomName() + + users, userIDs := genNewUsers("u007", 3) + + sdk.Test(t, sdk.TestCase{ + ProtoV6ProviderFactories: acctests.ProviderFactories, + PreCheck: func() { acctests.PreCheck(t) }, + CheckDestroy: acctests.CheckTwingateGroupDestroy, + Steps: []sdk.TestStep{ + { + Config: terraformResourceTwingateGroupAndUsers(terraformResourceName, groupName, users, userIDs), + Check: acctests.ComposeTestCheckFunc( + acctests.CheckGroupUsersLen(theResource, len(users)), + ), + }, + { + Config: terraformResourceTwingateGroupAndUsers(terraformResourceName, groupName, users, userIDs[:2]), + Check: acctests.ComposeTestCheckFunc( + acctests.CheckGroupUsersLen(theResource, 2), + ), }, - }) + }, }) } diff --git a/twingate/internal/test/acctests/resource/remote-network_test.go b/twingate/internal/test/acctests/resource/remote-network_test.go index 09185429..60f1d037 100644 --- a/twingate/internal/test/acctests/resource/remote-network_test.go +++ b/twingate/internal/test/acctests/resource/remote-network_test.go @@ -14,27 +14,27 @@ import ( ) func TestAccTwingateRemoteNetworkCreate(t *testing.T) { - t.Run("Test Twingate Resource : Acc Remote Network Create", func(t *testing.T) { - const terraformResourceName = "test000" - theResource := acctests.TerraformRemoteNetwork(terraformResourceName) - networkName := test.RandomName() - networkLocation := model.LocationAzure - - sdk.Test(t, sdk.TestCase{ - ProtoV6ProviderFactories: acctests.ProviderFactories, - PreCheck: func() { acctests.PreCheck(t) }, - CheckDestroy: acctests.CheckTwingateRemoteNetworkDestroy, - Steps: []sdk.TestStep{ - { - Config: createRemoteNetworkWithLocation(terraformResourceName, networkName, networkLocation), - Check: acctests.ComposeTestCheckFunc( - acctests.CheckTwingateResourceExists(theResource), - sdk.TestCheckResourceAttr(theResource, attr.Name, networkName), - sdk.TestCheckResourceAttr(theResource, attr.Location, networkLocation), - ), - }, + t.Parallel() + + const terraformResourceName = "test000" + theResource := acctests.TerraformRemoteNetwork(terraformResourceName) + networkName := test.RandomName() + networkLocation := model.LocationAzure + + sdk.Test(t, sdk.TestCase{ + ProtoV6ProviderFactories: acctests.ProviderFactories, + PreCheck: func() { acctests.PreCheck(t) }, + CheckDestroy: acctests.CheckTwingateRemoteNetworkDestroy, + Steps: []sdk.TestStep{ + { + Config: createRemoteNetworkWithLocation(terraformResourceName, networkName, networkLocation), + Check: acctests.ComposeTestCheckFunc( + acctests.CheckTwingateResourceExists(theResource), + sdk.TestCheckResourceAttr(theResource, attr.Name, networkName), + sdk.TestCheckResourceAttr(theResource, attr.Location, networkLocation), + ), }, - }) + }, }) } @@ -48,35 +48,35 @@ func createRemoteNetworkWithLocation(terraformResourceName, name, location strin } func TestAccTwingateRemoteNetworkUpdate(t *testing.T) { - t.Run("Test Twingate Resource : Acc Remote Network Update", func(t *testing.T) { - const terraformResourceName = "test001" - theResource := acctests.TerraformRemoteNetwork(terraformResourceName) - nameBefore := test.RandomName() - nameAfter := test.RandomName() - - sdk.Test(t, sdk.TestCase{ - ProtoV6ProviderFactories: acctests.ProviderFactories, - PreCheck: func() { acctests.PreCheck(t) }, - CheckDestroy: acctests.CheckTwingateRemoteNetworkDestroy, - Steps: []sdk.TestStep{ - { - Config: terraformResourceRemoteNetwork(terraformResourceName, nameBefore), - Check: acctests.ComposeTestCheckFunc( - acctests.CheckTwingateResourceExists(theResource), - sdk.TestCheckResourceAttr(theResource, attr.Name, nameBefore), - sdk.TestCheckResourceAttr(theResource, attr.Location, model.LocationOther), - ), - }, - { - Config: createRemoteNetworkWithLocation(terraformResourceName, nameAfter, model.LocationAWS), - Check: acctests.ComposeTestCheckFunc( - acctests.CheckTwingateResourceExists(theResource), - sdk.TestCheckResourceAttr(theResource, attr.Name, nameAfter), - sdk.TestCheckResourceAttr(theResource, attr.Location, model.LocationAWS), - ), - }, + t.Parallel() + + const terraformResourceName = "test001" + theResource := acctests.TerraformRemoteNetwork(terraformResourceName) + nameBefore := test.RandomName() + nameAfter := test.RandomName() + + sdk.Test(t, sdk.TestCase{ + ProtoV6ProviderFactories: acctests.ProviderFactories, + PreCheck: func() { acctests.PreCheck(t) }, + CheckDestroy: acctests.CheckTwingateRemoteNetworkDestroy, + Steps: []sdk.TestStep{ + { + Config: terraformResourceRemoteNetwork(terraformResourceName, nameBefore), + Check: acctests.ComposeTestCheckFunc( + acctests.CheckTwingateResourceExists(theResource), + sdk.TestCheckResourceAttr(theResource, attr.Name, nameBefore), + sdk.TestCheckResourceAttr(theResource, attr.Location, model.LocationOther), + ), + }, + { + Config: createRemoteNetworkWithLocation(terraformResourceName, nameAfter, model.LocationAWS), + Check: acctests.ComposeTestCheckFunc( + acctests.CheckTwingateResourceExists(theResource), + sdk.TestCheckResourceAttr(theResource, attr.Name, nameAfter), + sdk.TestCheckResourceAttr(theResource, attr.Location, model.LocationAWS), + ), }, - }) + }, }) } @@ -89,91 +89,91 @@ func terraformResourceRemoteNetwork(terraformResourceName, name string) string { } func TestAccTwingateRemoteNetworkDeleteNonExisting(t *testing.T) { - t.Run("Test Twingate Resource : Acc Remote Network Delete NonExisting", func(t *testing.T) { - const terraformResourceName = "test002" - theResource := acctests.TerraformRemoteNetwork(terraformResourceName) - networkName := test.RandomName() - - sdk.Test(t, sdk.TestCase{ - ProtoV6ProviderFactories: acctests.ProviderFactories, - PreCheck: func() { acctests.PreCheck(t) }, - CheckDestroy: acctests.CheckTwingateRemoteNetworkDestroy, - Steps: []sdk.TestStep{ - { - Config: terraformResourceRemoteNetwork(terraformResourceName, networkName), - Destroy: true, - }, - { - Config: terraformResourceRemoteNetwork(terraformResourceName, networkName), - ConfigPlanChecks: sdk.ConfigPlanChecks{ - PreApply: []plancheck.PlanCheck{ - plancheck.ExpectResourceAction(theResource, plancheck.ResourceActionCreate), - }, + t.Parallel() + + const terraformResourceName = "test002" + theResource := acctests.TerraformRemoteNetwork(terraformResourceName) + networkName := test.RandomName() + + sdk.Test(t, sdk.TestCase{ + ProtoV6ProviderFactories: acctests.ProviderFactories, + PreCheck: func() { acctests.PreCheck(t) }, + CheckDestroy: acctests.CheckTwingateRemoteNetworkDestroy, + Steps: []sdk.TestStep{ + { + Config: terraformResourceRemoteNetwork(terraformResourceName, networkName), + Destroy: true, + }, + { + Config: terraformResourceRemoteNetwork(terraformResourceName, networkName), + ConfigPlanChecks: sdk.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(theResource, plancheck.ResourceActionCreate), }, }, }, - }) + }, }) } func TestAccTwingateRemoteNetworkReCreateAfterDeletion(t *testing.T) { - t.Run("Test Twingate Resource : Acc Remote Network Re Create After Deletion", func(t *testing.T) { - const terraformResourceName = "test003" - theResource := acctests.TerraformRemoteNetwork(terraformResourceName) - remoteNetworkName := test.RandomName() - - sdk.Test(t, sdk.TestCase{ - ProtoV6ProviderFactories: acctests.ProviderFactories, - PreCheck: func() { acctests.PreCheck(t) }, - CheckDestroy: acctests.CheckTwingateRemoteNetworkDestroy, - Steps: []sdk.TestStep{ - { - Config: terraformResourceRemoteNetwork(terraformResourceName, remoteNetworkName), - Check: acctests.ComposeTestCheckFunc( - acctests.CheckTwingateResourceExists(theResource), - acctests.DeleteTwingateResource(theResource, resource.TwingateRemoteNetwork), - ), - ExpectNonEmptyPlan: true, - }, - { - Config: terraformResourceRemoteNetwork(terraformResourceName, remoteNetworkName), - Check: acctests.ComposeTestCheckFunc( - acctests.CheckTwingateResourceExists(theResource), - ), - }, + t.Parallel() + + const terraformResourceName = "test003" + theResource := acctests.TerraformRemoteNetwork(terraformResourceName) + remoteNetworkName := test.RandomName() + + sdk.Test(t, sdk.TestCase{ + ProtoV6ProviderFactories: acctests.ProviderFactories, + PreCheck: func() { acctests.PreCheck(t) }, + CheckDestroy: acctests.CheckTwingateRemoteNetworkDestroy, + Steps: []sdk.TestStep{ + { + Config: terraformResourceRemoteNetwork(terraformResourceName, remoteNetworkName), + Check: acctests.ComposeTestCheckFunc( + acctests.CheckTwingateResourceExists(theResource), + acctests.DeleteTwingateResource(theResource, resource.TwingateRemoteNetwork), + ), + ExpectNonEmptyPlan: true, + }, + { + Config: terraformResourceRemoteNetwork(terraformResourceName, remoteNetworkName), + Check: acctests.ComposeTestCheckFunc( + acctests.CheckTwingateResourceExists(theResource), + ), }, - }) + }, }) } func TestAccTwingateRemoteNetworkUpdateWithTheSameName(t *testing.T) { - t.Run("Test Twingate Resource : Acc Remote Network Update With The Same Name", func(t *testing.T) { - const terraformResourceName = "test004" - theResource := acctests.TerraformRemoteNetwork(terraformResourceName) - name := test.RandomName() - - sdk.Test(t, sdk.TestCase{ - ProtoV6ProviderFactories: acctests.ProviderFactories, - PreCheck: func() { acctests.PreCheck(t) }, - CheckDestroy: acctests.CheckTwingateRemoteNetworkDestroy, - Steps: []sdk.TestStep{ - { - Config: terraformResourceRemoteNetwork(terraformResourceName, name), - Check: acctests.ComposeTestCheckFunc( - acctests.CheckTwingateResourceExists(theResource), - sdk.TestCheckResourceAttr(theResource, attr.Name, name), - sdk.TestCheckResourceAttr(theResource, attr.Location, model.LocationOther), - ), - }, - { - Config: createRemoteNetworkWithLocation(terraformResourceName, name, model.LocationAWS), - Check: acctests.ComposeTestCheckFunc( - acctests.CheckTwingateResourceExists(theResource), - sdk.TestCheckResourceAttr(theResource, attr.Name, name), - sdk.TestCheckResourceAttr(theResource, attr.Location, model.LocationAWS), - ), - }, + t.Parallel() + + const terraformResourceName = "test004" + theResource := acctests.TerraformRemoteNetwork(terraformResourceName) + name := test.RandomName() + + sdk.Test(t, sdk.TestCase{ + ProtoV6ProviderFactories: acctests.ProviderFactories, + PreCheck: func() { acctests.PreCheck(t) }, + CheckDestroy: acctests.CheckTwingateRemoteNetworkDestroy, + Steps: []sdk.TestStep{ + { + Config: terraformResourceRemoteNetwork(terraformResourceName, name), + Check: acctests.ComposeTestCheckFunc( + acctests.CheckTwingateResourceExists(theResource), + sdk.TestCheckResourceAttr(theResource, attr.Name, name), + sdk.TestCheckResourceAttr(theResource, attr.Location, model.LocationOther), + ), + }, + { + Config: createRemoteNetworkWithLocation(terraformResourceName, name, model.LocationAWS), + Check: acctests.ComposeTestCheckFunc( + acctests.CheckTwingateResourceExists(theResource), + sdk.TestCheckResourceAttr(theResource, attr.Name, name), + sdk.TestCheckResourceAttr(theResource, attr.Location, model.LocationAWS), + ), }, - }) + }, }) } diff --git a/twingate/internal/test/acctests/resource/resource_test.go b/twingate/internal/test/acctests/resource/resource_test.go index ec07f6ef..3c6a1e91 100644 --- a/twingate/internal/test/acctests/resource/resource_test.go +++ b/twingate/internal/test/acctests/resource/resource_test.go @@ -30,6 +30,8 @@ var ( ) func TestAccTwingateResourceCreate(t *testing.T) { + t.Parallel() + const terraformResourceName = "test1" theResource := acctests.TerraformResource(terraformResourceName) remoteNetworkName := test.RandomName() @@ -55,6 +57,8 @@ func TestAccTwingateResourceCreate(t *testing.T) { } func TestAccTwingateResourceUpdateProtocols(t *testing.T) { + t.Parallel() + const terraformResourceName = "test1u" theResource := acctests.TerraformResource(terraformResourceName) remoteNetworkName := test.RandomName() @@ -124,6 +128,8 @@ func createResourceWithSimpleProtocols(terraformResourceName, networkName, resou } func TestAccTwingateResourceCreateWithProtocolsAndGroups(t *testing.T) { + t.Parallel() + const theResource = "twingate_resource.test2" remoteNetworkName := test.RandomName() groupName1 := test.RandomGroupName() @@ -190,6 +196,8 @@ func createResourceWithProtocolsAndGroups(networkName, groupName1, groupName2, r } func TestAccTwingateResourceFullCreationFlow(t *testing.T) { + t.Parallel() + const theResource = "twingate_resource.test3" remoteNetworkName := test.RandomName() groupName := test.RandomGroupName() @@ -262,6 +270,8 @@ func resourceFullCreationFlow(networkName, groupName, resourceName string) strin } func TestAccTwingateResourceWithInvalidGroupId(t *testing.T) { + t.Parallel() + resourceName := test.RandomResourceName() networkName := test.RandomResourceName() @@ -299,6 +309,8 @@ func createResourceWithInvalidGroupId(networkName, resourceName string) string { } func TestAccTwingateResourceWithTcpDenyAllPolicy(t *testing.T) { + t.Parallel() + const theResource = "twingate_resource.test5" resourceName := test.RandomResourceName() networkName := test.RandomResourceName() @@ -356,6 +368,8 @@ func createResourceWithTcpDenyAllPolicy(networkName, groupName, resourceName str } func TestAccTwingateResourceWithUdpDenyAllPolicy(t *testing.T) { + t.Parallel() + const theResource = "twingate_resource.test6" remoteNetworkName := test.RandomName() groupName := test.RandomGroupName() @@ -413,6 +427,8 @@ func createResourceWithUdpDenyAllPolicy(networkName, groupName, resourceName str } func TestAccTwingateResourceWithDenyAllPolicyAndEmptyPortsList(t *testing.T) { + t.Parallel() + const theResource = "twingate_resource.test7" remoteNetworkName := test.RandomName() groupName := test.RandomGroupName() @@ -473,6 +489,8 @@ func createResourceWithDenyAllPolicyAndEmptyPortsList(networkName, groupName, re } func TestAccTwingateResourceWithInvalidPortRange(t *testing.T) { + t.Parallel() + remoteNetworkName := test.RandomName() resourceName := test.RandomResourceName() expectedError := regexp.MustCompile("failed to parse protocols port range") @@ -546,6 +564,8 @@ func createResourceWithRestrictedPolicyAndPortRange(networkName, resourceName, p } func TestAccTwingateResourcePortReorderingCreatesNoChanges(t *testing.T) { + t.Parallel() + const theResource = "twingate_resource.test9" remoteNetworkName := test.RandomName() resourceName := test.RandomResourceName() @@ -612,6 +632,8 @@ func createResourceWithPortRange(networkName, resourceName, portRange string) st } func TestAccTwingateResourcePortsRepresentationChanged(t *testing.T) { + t.Parallel() + const theResource = "twingate_resource.test9" remoteNetworkName := test.RandomName() resourceName := test.RandomResourceName() @@ -633,6 +655,8 @@ func TestAccTwingateResourcePortsRepresentationChanged(t *testing.T) { } func TestAccTwingateResourcePortsNotChanged(t *testing.T) { + t.Parallel() + const theResource = "twingate_resource.test9" remoteNetworkName := test.RandomName() resourceName := test.RandomResourceName() @@ -662,6 +686,8 @@ func TestAccTwingateResourcePortsNotChanged(t *testing.T) { } func TestAccTwingateResourcePortReorderingNoChanges(t *testing.T) { + t.Parallel() + const theResource = "twingate_resource.test9" remoteNetworkName := test.RandomName() resourceName := test.RandomResourceName() @@ -706,6 +732,8 @@ func TestAccTwingateResourcePortReorderingNoChanges(t *testing.T) { } func TestAccTwingateResourceSetActiveStateOnUpdate(t *testing.T) { + t.Parallel() + const terraformResourceName = "test10" theResource := acctests.TerraformResource(terraformResourceName) remoteNetworkName := test.RandomName() @@ -738,6 +766,8 @@ func TestAccTwingateResourceSetActiveStateOnUpdate(t *testing.T) { } func TestAccTwingateResourceReCreateAfterDeletion(t *testing.T) { + t.Parallel() + const terraformResourceName = "test10" theResource := acctests.TerraformResource(terraformResourceName) remoteNetworkName := test.RandomName() @@ -767,6 +797,8 @@ func TestAccTwingateResourceReCreateAfterDeletion(t *testing.T) { } func TestAccTwingateResourceImport(t *testing.T) { + t.Parallel() + const theResource = "twingate_resource.test12" remoteNetworkName := test.RandomName() groupName := test.RandomGroupName() @@ -885,6 +917,8 @@ func newTerraformGroup(resourceName, groupName string) string { } func TestAccTwingateResourceAddAccessServiceAccounts(t *testing.T) { + t.Parallel() + const theResource = "twingate_resource.test15" remoteNetworkName := test.RandomName() resourceName := test.RandomResourceName() @@ -942,6 +976,8 @@ func createResource15(networkName, resourceName string, terraformServiceAccount } func TestAccTwingateResourceAddAccessGroupsAndServiceAccounts(t *testing.T) { + t.Parallel() + const theResource = "twingate_resource.test16" remoteNetworkName := test.RandomName() resourceName := test.RandomResourceName() @@ -1101,6 +1137,7 @@ func createResource16WithoutGroups(networkName, resourceName string, groups, gro func TestAccTwingateResourceAccessServiceAccountsNotAuthoritative(t *testing.T) { t.Parallel() + const theResource = "twingate_resource.test17" remoteNetworkName := test.RandomName() resourceName := test.RandomResourceName() @@ -1214,6 +1251,7 @@ func createResource17(networkName, resourceName string, serviceAccounts, service func TestAccTwingateResourceAccessServiceAccountsAuthoritative(t *testing.T) { t.Parallel() + const theResource = "twingate_resource.test13" remoteNetworkName := test.RandomName() resourceName := test.RandomResourceName() @@ -1324,6 +1362,8 @@ func createResource13(networkName, resourceName string, serviceAccounts, service } func TestAccTwingateResourceAccessWithEmptyGroups(t *testing.T) { + t.Parallel() + remoteNetworkName := test.RandomName() resourceName := test.RandomResourceName() @@ -1371,6 +1411,8 @@ func createResource18(networkName, resourceName string) string { } func TestAccTwingateResourceAccessWithEmptyServiceAccounts(t *testing.T) { + t.Parallel() + remoteNetworkName := test.RandomName() resourceName := test.RandomResourceName() @@ -1418,6 +1460,8 @@ func createResource19(networkName, resourceName string) string { } func TestAccTwingateResourceAccessWithEmptyBlock(t *testing.T) { + t.Parallel() + remoteNetworkName := test.RandomName() resourceName := test.RandomResourceName() @@ -1465,6 +1509,7 @@ func createResource20(networkName, resourceName string) string { func TestAccTwingateResourceAccessGroupsNotAuthoritative(t *testing.T) { t.Parallel() + const theResource = "twingate_resource.test22" remoteNetworkName := test.RandomName() resourceName := test.RandomResourceName() @@ -1578,6 +1623,7 @@ func createResource22(networkName, resourceName string, groups, groupsID []strin func TestAccTwingateResourceAccessGroupsAuthoritative(t *testing.T) { t.Parallel() + const theResource = "twingate_resource.test23" remoteNetworkName := test.RandomName() resourceName := test.RandomResourceName() @@ -1687,6 +1733,8 @@ func createResource23(networkName, resourceName string, groups, groupsID []strin } func TestGetResourceNameFromID(t *testing.T) { + t.Parallel() + cases := []struct { input string expected string @@ -1712,6 +1760,8 @@ func TestGetResourceNameFromID(t *testing.T) { } func TestAccTwingateCreateResourceWithFlagIsVisible(t *testing.T) { + t.Parallel() + const terraformResourceName = "test24" theResource := acctests.TerraformResource(terraformResourceName) remoteNetworkName := test.RandomName() @@ -1784,6 +1834,8 @@ func createResourceWithFlagIsVisible(terraformResourceName, networkName, resourc } func TestAccTwingateCreateResourceWithFlagIsBrowserShortcutEnabled(t *testing.T) { + t.Parallel() + const terraformResourceName = "test25" theResource := acctests.TerraformResource(terraformResourceName) remoteNetworkName := test.RandomName() @@ -1854,6 +1906,7 @@ func createResourceWithFlagIsBrowserShortcutEnabled(terraformResourceName, netwo func TestAccTwingateResourceGroupsAuthoritativeByDefault(t *testing.T) { t.Parallel() + const theResource = "twingate_resource.test26" remoteNetworkName := test.RandomName() resourceName := test.RandomResourceName() @@ -1962,6 +2015,8 @@ func createResource26(networkName, resourceName string, groups, groupsID []strin } func TestAccTwingateResourceDoesNotSupportOldGroups(t *testing.T) { + t.Parallel() + remoteNetworkName := test.RandomName() resourceName := test.RandomResourceName() @@ -2011,6 +2066,8 @@ func createResource28(networkName, resourceName string, groups, groupsID []strin } func TestAccTwingateResourceCreateWithAlias(t *testing.T) { + t.Parallel() + const terraformResourceName = "test29" theResource := acctests.TerraformResource(terraformResourceName) remoteNetworkName := test.RandomName() @@ -2049,6 +2106,8 @@ func TestAccTwingateResourceCreateWithAlias(t *testing.T) { } func TestAccTwingateResourceUpdateWithInvalidAlias(t *testing.T) { + t.Parallel() + const terraformResourceName = "test29_update_invalid" theResource := acctests.TerraformResource(terraformResourceName) remoteNetworkName := test.RandomName() @@ -2074,6 +2133,8 @@ func TestAccTwingateResourceUpdateWithInvalidAlias(t *testing.T) { } func TestAccTwingateResourceCreateWithInvalidAlias(t *testing.T) { + t.Parallel() + const terraformResourceName = "test29_create_invalid" remoteNetworkName := test.RandomName() resourceName := test.RandomResourceName() @@ -2120,7 +2181,7 @@ func createResource29WithoutAlias(terraformResourceName, networkName, resourceNa } func TestAccTwingateResourceGroupsCursor(t *testing.T) { - acctests.SetPageLimit(1) + t.Parallel() const terraformResourceName = "test27" theResource := acctests.TerraformResource(terraformResourceName) @@ -2199,6 +2260,8 @@ func createResourceWithGroupsAndServiceAccounts(name, networkName, resourceName } func TestAccTwingateResourceCreateWithPort(t *testing.T) { + t.Parallel() + remoteNetworkName := test.RandomName() resourceName := test.RandomResourceName() @@ -2251,6 +2314,8 @@ func createResourceWithPort(networkName, resourceName, port string) string { } func TestAccTwingateResourceUpdateWithPort(t *testing.T) { + t.Parallel() + theResource := acctests.TerraformResource("test30") remoteNetworkName := test.RandomName() resourceName := test.RandomResourceName() @@ -2275,6 +2340,8 @@ func TestAccTwingateResourceUpdateWithPort(t *testing.T) { } func TestAccTwingateResourceWithPortsFailsForAllowAllAndDenyAllPolicy(t *testing.T) { + t.Parallel() + const terraformResourceName = "test28" remoteNetworkName := test.RandomName() resourceName := test.RandomResourceName() @@ -2321,6 +2388,8 @@ func createResourceWithPorts(name, networkName, resourceName, policy string) str } func TestAccTwingateResourceWithoutPortsOkForAllowAllAndDenyAllPolicy(t *testing.T) { + t.Parallel() + const terraformResourceName = "test29" remoteNetworkName := test.RandomName() resourceName := test.RandomResourceName() @@ -2375,6 +2444,8 @@ func createResourceWithoutPorts(name, networkName, resourceName, policy string) } func TestAccTwingateResourceWithRestrictedPolicy(t *testing.T) { + t.Parallel() + const terraformResourceName = "test30" remoteNetworkName := test.RandomName() resourceName := test.RandomResourceName() @@ -2398,6 +2469,8 @@ func TestAccTwingateResourceWithRestrictedPolicy(t *testing.T) { } func TestAccTwingateResourcePolicyTransitionDenyAllToRestricted(t *testing.T) { + t.Parallel() + const terraformResourceName = "test31" theResource := acctests.TerraformResource(terraformResourceName) remoteNetworkName := test.RandomName() @@ -2429,6 +2502,8 @@ func TestAccTwingateResourcePolicyTransitionDenyAllToRestricted(t *testing.T) { } func TestAccTwingateResourcePolicyTransitionDenyAllToAllowAll(t *testing.T) { + t.Parallel() + const terraformResourceName = "test32" theResource := acctests.TerraformResource(terraformResourceName) remoteNetworkName := test.RandomName() @@ -2460,6 +2535,8 @@ func TestAccTwingateResourcePolicyTransitionDenyAllToAllowAll(t *testing.T) { } func TestAccTwingateResourcePolicyTransitionRestrictedToDenyAll(t *testing.T) { + t.Parallel() + const terraformResourceName = "test33" theResource := acctests.TerraformResource(terraformResourceName) remoteNetworkName := test.RandomName() @@ -2491,6 +2568,8 @@ func TestAccTwingateResourcePolicyTransitionRestrictedToDenyAll(t *testing.T) { } func TestAccTwingateResourcePolicyTransitionRestrictedToAllowAll(t *testing.T) { + t.Parallel() + const terraformResourceName = "test34" theResource := acctests.TerraformResource(terraformResourceName) remoteNetworkName := test.RandomName() @@ -2522,6 +2601,8 @@ func TestAccTwingateResourcePolicyTransitionRestrictedToAllowAll(t *testing.T) { } func TestAccTwingateResourcePolicyTransitionRestrictedToAllowAllWithPortsShouldFail(t *testing.T) { + t.Parallel() + const terraformResourceName = "test35" theResource := acctests.TerraformResource(terraformResourceName) remoteNetworkName := test.RandomName() @@ -2549,6 +2630,8 @@ func TestAccTwingateResourcePolicyTransitionRestrictedToAllowAllWithPortsShouldF } func TestAccTwingateResourcePolicyTransitionAllowAllToRestricted(t *testing.T) { + t.Parallel() + const terraformResourceName = "test36" theResource := acctests.TerraformResource(terraformResourceName) remoteNetworkName := test.RandomName() @@ -2580,6 +2663,8 @@ func TestAccTwingateResourcePolicyTransitionAllowAllToRestricted(t *testing.T) { } func TestAccTwingateResourcePolicyTransitionAllowAllToDenyAll(t *testing.T) { + t.Parallel() + const terraformResourceName = "test37" theResource := acctests.TerraformResource(terraformResourceName) remoteNetworkName := test.RandomName() @@ -2611,6 +2696,8 @@ func TestAccTwingateResourcePolicyTransitionAllowAllToDenyAll(t *testing.T) { } func TestAccTwingateResourceTestCaseInsensitiveAlias(t *testing.T) { + t.Parallel() + const terraformResourceName = "test38" theResource := acctests.TerraformResource(terraformResourceName) remoteNetworkName := test.RandomName() @@ -2643,6 +2730,8 @@ func TestAccTwingateResourceTestCaseInsensitiveAlias(t *testing.T) { } func TestAccTwingateResourceWithBrowserOption(t *testing.T) { + t.Parallel() + const terraformResourceName = "test40" theResource := acctests.TerraformResource(terraformResourceName) remoteNetworkName := test.RandomName() @@ -2675,6 +2764,8 @@ func TestAccTwingateResourceWithBrowserOption(t *testing.T) { } func TestAccTwingateResourceWithBrowserOptionFailOnUpdate(t *testing.T) { + t.Parallel() + const terraformResourceName = "test41" theResource := acctests.TerraformResource(terraformResourceName) remoteNetworkName := test.RandomName() @@ -2708,6 +2799,8 @@ func TestAccTwingateResourceWithBrowserOptionFailOnUpdate(t *testing.T) { } func TestAccTwingateResourceWithBrowserOptionRecovered(t *testing.T) { + t.Parallel() + const terraformResourceName = "test42" theResource := acctests.TerraformResource(terraformResourceName) remoteNetworkName := test.RandomName() @@ -2737,6 +2830,8 @@ func TestAccTwingateResourceWithBrowserOptionRecovered(t *testing.T) { } func TestAccTwingateResourceWithBrowserOptionIP(t *testing.T) { + t.Parallel() + const terraformResourceName = "testIPWithBrowserOption" theResource := acctests.TerraformResource(terraformResourceName) remoteNetworkName := test.RandomName() @@ -2771,6 +2866,8 @@ func TestAccTwingateResourceWithBrowserOptionIP(t *testing.T) { } func TestAccTwingateResourceWithBrowserOptionCIDR(t *testing.T) { + t.Parallel() + const terraformResourceName = "testCIDRWithBrowserOption" theResource := acctests.TerraformResource(terraformResourceName) remoteNetworkName := test.RandomName() @@ -2857,6 +2954,8 @@ func createResourceWithoutSecurityPolicy(remoteNetwork, resource string) string } func TestAccTwingateResourceUpdateWithDefaultProtocols(t *testing.T) { + t.Parallel() + remoteNetworkName := test.RandomName() resourceName := test.RandomResourceName() theResource := acctests.TerraformResource(resourceName) @@ -2920,6 +3019,8 @@ func createResourceWithoutProtocols(remoteNetwork, resource string) string { } func TestAccTwingateResourceUpdatePortsFromEmptyListToNull(t *testing.T) { + t.Parallel() + remoteNetworkName := test.RandomName() resourceName := test.RandomResourceName() theResource := acctests.TerraformResource(resourceName) @@ -2945,6 +3046,8 @@ func TestAccTwingateResourceUpdatePortsFromEmptyListToNull(t *testing.T) { } func TestAccTwingateResourceUpdatePortsFromNullToEmptyList(t *testing.T) { + t.Parallel() + remoteNetworkName := test.RandomName() resourceName := test.RandomResourceName() theResource := acctests.TerraformResource(resourceName) diff --git a/twingate/internal/test/acctests/resource/service-account_test.go b/twingate/internal/test/acctests/resource/service-account_test.go index 5b7ed5b4..36dae3fa 100644 --- a/twingate/internal/test/acctests/resource/service-account_test.go +++ b/twingate/internal/test/acctests/resource/service-account_test.go @@ -21,91 +21,91 @@ func createServiceAccount(resourceName, serviceAccountName string) string { } func TestAccTwingateServiceAccountCreateUpdate(t *testing.T) { - t.Run("Test Twingate Resource : Acc Service Account Create/Update", func(t *testing.T) { - const terraformResourceName = "test01" - theResource := acctests.TerraformServiceAccount(terraformResourceName) - nameBefore := test.RandomName() - nameAfter := test.RandomName() + t.Parallel() - sdk.Test(t, sdk.TestCase{ - ProtoV6ProviderFactories: acctests.ProviderFactories, - PreCheck: func() { acctests.PreCheck(t) }, - CheckDestroy: acctests.CheckTwingateServiceAccountDestroy, - Steps: []sdk.TestStep{ - { - Config: createServiceAccount(terraformResourceName, nameBefore), - Check: acctests.ComposeTestCheckFunc( - acctests.CheckTwingateResourceExists(theResource), - sdk.TestCheckResourceAttr(theResource, attr.Name, nameBefore), - ), - }, - { - Config: createServiceAccount(terraformResourceName, nameAfter), - Check: acctests.ComposeTestCheckFunc( - acctests.CheckTwingateResourceExists(theResource), - sdk.TestCheckResourceAttr(theResource, attr.Name, nameAfter), - ), - }, + const terraformResourceName = "test01" + theResource := acctests.TerraformServiceAccount(terraformResourceName) + nameBefore := test.RandomName() + nameAfter := test.RandomName() + + sdk.Test(t, sdk.TestCase{ + ProtoV6ProviderFactories: acctests.ProviderFactories, + PreCheck: func() { acctests.PreCheck(t) }, + CheckDestroy: acctests.CheckTwingateServiceAccountDestroy, + Steps: []sdk.TestStep{ + { + Config: createServiceAccount(terraformResourceName, nameBefore), + Check: acctests.ComposeTestCheckFunc( + acctests.CheckTwingateResourceExists(theResource), + sdk.TestCheckResourceAttr(theResource, attr.Name, nameBefore), + ), }, - }) + { + Config: createServiceAccount(terraformResourceName, nameAfter), + Check: acctests.ComposeTestCheckFunc( + acctests.CheckTwingateResourceExists(theResource), + sdk.TestCheckResourceAttr(theResource, attr.Name, nameAfter), + ), + }, + }, }) } func TestAccTwingateServiceAccountDeleteNonExisting(t *testing.T) { - t.Run("Test Twingate Resource : Acc Service Account Delete NonExisting", func(t *testing.T) { - const terraformResourceName = "test02" - theResource := acctests.TerraformServiceAccount(terraformResourceName) - name := test.RandomName() + t.Parallel() - sdk.Test(t, sdk.TestCase{ - ProtoV6ProviderFactories: acctests.ProviderFactories, - PreCheck: func() { acctests.PreCheck(t) }, - CheckDestroy: acctests.CheckTwingateServiceAccountDestroy, - Steps: []sdk.TestStep{ - { - Config: createServiceAccount(terraformResourceName, name), - Destroy: true, - }, - { - Config: createServiceAccount(terraformResourceName, name), - ConfigPlanChecks: sdk.ConfigPlanChecks{ - PreApply: []plancheck.PlanCheck{ - plancheck.ExpectResourceAction(theResource, plancheck.ResourceActionCreate), - }, + const terraformResourceName = "test02" + theResource := acctests.TerraformServiceAccount(terraformResourceName) + name := test.RandomName() + + sdk.Test(t, sdk.TestCase{ + ProtoV6ProviderFactories: acctests.ProviderFactories, + PreCheck: func() { acctests.PreCheck(t) }, + CheckDestroy: acctests.CheckTwingateServiceAccountDestroy, + Steps: []sdk.TestStep{ + { + Config: createServiceAccount(terraformResourceName, name), + Destroy: true, + }, + { + Config: createServiceAccount(terraformResourceName, name), + ConfigPlanChecks: sdk.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(theResource, plancheck.ResourceActionCreate), }, }, }, - }) + }, }) } func TestAccTwingateServiceAccountReCreateAfterDeletion(t *testing.T) { - t.Run("Test Twingate Resource : Acc Service Account Create After Deletion", func(t *testing.T) { - const terraformResourceName = "test03" - theResource := acctests.TerraformServiceAccount(terraformResourceName) - name := test.RandomName() + t.Parallel() - sdk.Test(t, sdk.TestCase{ - ProtoV6ProviderFactories: acctests.ProviderFactories, - PreCheck: func() { acctests.PreCheck(t) }, - CheckDestroy: acctests.CheckTwingateServiceAccountDestroy, - Steps: []sdk.TestStep{ - { - Config: createServiceAccount(terraformResourceName, name), - Check: acctests.ComposeTestCheckFunc( - acctests.CheckTwingateResourceExists(theResource), - acctests.DeleteTwingateResource(theResource, resource.TwingateServiceAccount), - acctests.WaitTestFunc(), - ), - ExpectNonEmptyPlan: true, - }, - { - Config: createServiceAccount(terraformResourceName, name), - Check: acctests.ComposeTestCheckFunc( - acctests.CheckTwingateResourceExists(theResource), - ), - }, + const terraformResourceName = "test03" + theResource := acctests.TerraformServiceAccount(terraformResourceName) + name := test.RandomName() + + sdk.Test(t, sdk.TestCase{ + ProtoV6ProviderFactories: acctests.ProviderFactories, + PreCheck: func() { acctests.PreCheck(t) }, + CheckDestroy: acctests.CheckTwingateServiceAccountDestroy, + Steps: []sdk.TestStep{ + { + Config: createServiceAccount(terraformResourceName, name), + Check: acctests.ComposeTestCheckFunc( + acctests.CheckTwingateResourceExists(theResource), + acctests.DeleteTwingateResource(theResource, resource.TwingateServiceAccount), + acctests.WaitTestFunc(), + ), + ExpectNonEmptyPlan: true, + }, + { + Config: createServiceAccount(terraformResourceName, name), + Check: acctests.ComposeTestCheckFunc( + acctests.CheckTwingateResourceExists(theResource), + ), }, - }) + }, }) } diff --git a/twingate/internal/test/acctests/resource/service-key_test.go b/twingate/internal/test/acctests/resource/service-key_test.go index 9f676e2a..95a75768 100644 --- a/twingate/internal/test/acctests/resource/service-key_test.go +++ b/twingate/internal/test/acctests/resource/service-key_test.go @@ -58,347 +58,347 @@ func nonEmptyValue(value string) error { } func TestAccTwingateServiceKeyCreateUpdate(t *testing.T) { - t.Run("Test Twingate Resource : Acc Service Key Create/Update", func(t *testing.T) { - serviceAccountName := test.RandomName() - terraformResourceName := test.TerraformRandName("test_key") - serviceAccount := acctests.TerraformServiceAccount(terraformResourceName) - serviceKey := acctests.TerraformServiceKey(terraformResourceName) - - sdk.Test(t, sdk.TestCase{ - ProtoV6ProviderFactories: acctests.ProviderFactories, - PreCheck: func() { acctests.PreCheck(t) }, - CheckDestroy: acctests.CheckTwingateServiceAccountDestroy, - Steps: []sdk.TestStep{ - { - Config: createServiceKey(terraformResourceName, serviceAccountName), - Check: acctests.ComposeTestCheckFunc( - acctests.CheckTwingateResourceExists(serviceAccount), - sdk.TestCheckResourceAttr(serviceAccount, attr.Name, serviceAccountName), - acctests.CheckTwingateResourceExists(serviceKey), - sdk.TestCheckResourceAttrWith(serviceKey, attr.Token, nonEmptyValue), - ), - }, - { - Config: createServiceKey(terraformResourceName, serviceAccountName), - Check: acctests.ComposeTestCheckFunc( - acctests.CheckTwingateResourceExists(serviceAccount), - sdk.TestCheckResourceAttr(serviceAccount, attr.Name, serviceAccountName), - acctests.CheckTwingateResourceExists(serviceKey), - sdk.TestCheckResourceAttrWith(serviceKey, attr.Token, nonEmptyValue), - ), - }, + t.Parallel() + + serviceAccountName := test.RandomName() + terraformResourceName := test.TerraformRandName("test_key") + serviceAccount := acctests.TerraformServiceAccount(terraformResourceName) + serviceKey := acctests.TerraformServiceKey(terraformResourceName) + + sdk.Test(t, sdk.TestCase{ + ProtoV6ProviderFactories: acctests.ProviderFactories, + PreCheck: func() { acctests.PreCheck(t) }, + CheckDestroy: acctests.CheckTwingateServiceAccountDestroy, + Steps: []sdk.TestStep{ + { + Config: createServiceKey(terraformResourceName, serviceAccountName), + Check: acctests.ComposeTestCheckFunc( + acctests.CheckTwingateResourceExists(serviceAccount), + sdk.TestCheckResourceAttr(serviceAccount, attr.Name, serviceAccountName), + acctests.CheckTwingateResourceExists(serviceKey), + sdk.TestCheckResourceAttrWith(serviceKey, attr.Token, nonEmptyValue), + ), + }, + { + Config: createServiceKey(terraformResourceName, serviceAccountName), + Check: acctests.ComposeTestCheckFunc( + acctests.CheckTwingateResourceExists(serviceAccount), + sdk.TestCheckResourceAttr(serviceAccount, attr.Name, serviceAccountName), + acctests.CheckTwingateResourceExists(serviceKey), + sdk.TestCheckResourceAttrWith(serviceKey, attr.Token, nonEmptyValue), + ), }, - }) + }, }) } func TestAccTwingateServiceKeyCreateUpdateWithName(t *testing.T) { - t.Run("Test Twingate Resource : Acc Service Key Create/Update With Name", func(t *testing.T) { - serviceAccountName := test.RandomName() - terraformResourceName := test.TerraformRandName("test_key") - serviceAccount := acctests.TerraformServiceAccount(terraformResourceName) - serviceKey := acctests.TerraformServiceKey(terraformResourceName) - beforeName := test.RandomName() - afterName := test.RandomName() - - sdk.Test(t, sdk.TestCase{ - ProtoV6ProviderFactories: acctests.ProviderFactories, - PreCheck: func() { acctests.PreCheck(t) }, - CheckDestroy: acctests.CheckTwingateServiceAccountDestroy, - Steps: []sdk.TestStep{ - { - Config: createServiceKeyWithName(terraformResourceName, serviceAccountName, beforeName), - Check: acctests.ComposeTestCheckFunc( - acctests.CheckTwingateResourceExists(serviceAccount), - sdk.TestCheckResourceAttr(serviceAccount, attr.Name, serviceAccountName), - acctests.CheckTwingateResourceExists(serviceKey), - sdk.TestCheckResourceAttr(serviceKey, attr.Name, beforeName), - sdk.TestCheckResourceAttrWith(serviceKey, attr.Token, nonEmptyValue), - ), - }, - { - Config: createServiceKeyWithName(terraformResourceName, serviceAccountName, afterName), - Check: acctests.ComposeTestCheckFunc( - acctests.CheckTwingateResourceExists(serviceAccount), - sdk.TestCheckResourceAttr(serviceAccount, attr.Name, serviceAccountName), - acctests.CheckTwingateResourceExists(serviceKey), - sdk.TestCheckResourceAttr(serviceKey, attr.Name, afterName), - sdk.TestCheckResourceAttrWith(serviceKey, attr.Token, nonEmptyValue), - acctests.WaitTestFunc(), - ), - }, + t.Parallel() + + serviceAccountName := test.RandomName() + terraformResourceName := test.TerraformRandName("test_key") + serviceAccount := acctests.TerraformServiceAccount(terraformResourceName) + serviceKey := acctests.TerraformServiceKey(terraformResourceName) + beforeName := test.RandomName() + afterName := test.RandomName() + + sdk.Test(t, sdk.TestCase{ + ProtoV6ProviderFactories: acctests.ProviderFactories, + PreCheck: func() { acctests.PreCheck(t) }, + CheckDestroy: acctests.CheckTwingateServiceAccountDestroy, + Steps: []sdk.TestStep{ + { + Config: createServiceKeyWithName(terraformResourceName, serviceAccountName, beforeName), + Check: acctests.ComposeTestCheckFunc( + acctests.CheckTwingateResourceExists(serviceAccount), + sdk.TestCheckResourceAttr(serviceAccount, attr.Name, serviceAccountName), + acctests.CheckTwingateResourceExists(serviceKey), + sdk.TestCheckResourceAttr(serviceKey, attr.Name, beforeName), + sdk.TestCheckResourceAttrWith(serviceKey, attr.Token, nonEmptyValue), + ), + }, + { + Config: createServiceKeyWithName(terraformResourceName, serviceAccountName, afterName), + Check: acctests.ComposeTestCheckFunc( + acctests.CheckTwingateResourceExists(serviceAccount), + sdk.TestCheckResourceAttr(serviceAccount, attr.Name, serviceAccountName), + acctests.CheckTwingateResourceExists(serviceKey), + sdk.TestCheckResourceAttr(serviceKey, attr.Name, afterName), + sdk.TestCheckResourceAttrWith(serviceKey, attr.Token, nonEmptyValue), + acctests.WaitTestFunc(), + ), }, - }) + }, }) } func TestAccTwingateServiceKeyWontReCreateAfterInactive(t *testing.T) { - t.Run("Test Twingate Resource : Acc Service Key Won't ReCreate After Inactive", func(t *testing.T) { - serviceAccountName := test.RandomName() - terraformResourceName := test.TerraformRandName("test_key") - serviceKey := acctests.TerraformServiceKey(terraformResourceName) - - resourceID := new(string) - - sdk.Test(t, sdk.TestCase{ - ProtoV6ProviderFactories: acctests.ProviderFactories, - PreCheck: func() { acctests.PreCheck(t) }, - CheckDestroy: acctests.CheckTwingateServiceAccountDestroy, - Steps: []sdk.TestStep{ - { - Config: createServiceKey(terraformResourceName, serviceAccountName), - Check: acctests.ComposeTestCheckFunc( - acctests.CheckTwingateResourceExists(serviceKey), - acctests.GetTwingateResourceID(serviceKey, &resourceID), - sdk.TestCheckResourceAttrWith(serviceKey, attr.Token, nonEmptyValue), - acctests.RevokeTwingateServiceKey(serviceKey), - acctests.WaitTestFunc(), - acctests.CheckTwingateServiceKeyStatus(serviceKey, model.StatusRevoked), - ), - }, - { - Config: createServiceKey(terraformResourceName, serviceAccountName), - Check: acctests.ComposeTestCheckFunc( - acctests.CheckTwingateResourceExists(serviceKey), - sdk.TestCheckResourceAttr(serviceKey, attr.IsActive, "false"), - sdk.TestCheckResourceAttrWith(serviceKey, attr.Token, nonEmptyValue), - sdk.TestCheckResourceAttrWith(serviceKey, attr.ID, func(value string) error { - if *resourceID == "" { - return errors.New("failed to fetch resource id") - } - - if value != *resourceID { - return errors.New("resource was re-created") - } - - return nil - }), - ), - }, + t.Parallel() + + serviceAccountName := test.RandomName() + terraformResourceName := test.TerraformRandName("test_key") + serviceKey := acctests.TerraformServiceKey(terraformResourceName) + + resourceID := new(string) + + sdk.Test(t, sdk.TestCase{ + ProtoV6ProviderFactories: acctests.ProviderFactories, + PreCheck: func() { acctests.PreCheck(t) }, + CheckDestroy: acctests.CheckTwingateServiceAccountDestroy, + Steps: []sdk.TestStep{ + { + Config: createServiceKey(terraformResourceName, serviceAccountName), + Check: acctests.ComposeTestCheckFunc( + acctests.CheckTwingateResourceExists(serviceKey), + acctests.GetTwingateResourceID(serviceKey, &resourceID), + sdk.TestCheckResourceAttrWith(serviceKey, attr.Token, nonEmptyValue), + acctests.RevokeTwingateServiceKey(serviceKey), + acctests.WaitTestFunc(), + acctests.CheckTwingateServiceKeyStatus(serviceKey, model.StatusRevoked), + ), + }, + { + Config: createServiceKey(terraformResourceName, serviceAccountName), + Check: acctests.ComposeTestCheckFunc( + acctests.CheckTwingateResourceExists(serviceKey), + sdk.TestCheckResourceAttr(serviceKey, attr.IsActive, "false"), + sdk.TestCheckResourceAttrWith(serviceKey, attr.Token, nonEmptyValue), + sdk.TestCheckResourceAttrWith(serviceKey, attr.ID, func(value string) error { + if *resourceID == "" { + return errors.New("failed to fetch resource id") + } + + if value != *resourceID { + return errors.New("resource was re-created") + } + + return nil + }), + ), }, - }) + }, }) } func TestAccTwingateServiceKeyDelete(t *testing.T) { - t.Run("Test Twingate Resource : Acc Service Key Delete", func(t *testing.T) { - serviceAccountName := test.RandomName() - terraformResourceName := test.TerraformRandName("test_key") - serviceKey := acctests.TerraformServiceKey(terraformResourceName) - - sdk.Test(t, sdk.TestCase{ - ProtoV6ProviderFactories: acctests.ProviderFactories, - PreCheck: func() { acctests.PreCheck(t) }, - CheckDestroy: acctests.CheckTwingateServiceAccountDestroy, - Steps: []sdk.TestStep{ - { - Config: createServiceKey(terraformResourceName, serviceAccountName), - Destroy: true, - }, - { - Config: createServiceKey(terraformResourceName, serviceAccountName), - ConfigPlanChecks: sdk.ConfigPlanChecks{ - PreApply: []plancheck.PlanCheck{ - plancheck.ExpectResourceAction(serviceKey, plancheck.ResourceActionCreate), - }, + t.Parallel() + + serviceAccountName := test.RandomName() + terraformResourceName := test.TerraformRandName("test_key") + serviceKey := acctests.TerraformServiceKey(terraformResourceName) + + sdk.Test(t, sdk.TestCase{ + ProtoV6ProviderFactories: acctests.ProviderFactories, + PreCheck: func() { acctests.PreCheck(t) }, + CheckDestroy: acctests.CheckTwingateServiceAccountDestroy, + Steps: []sdk.TestStep{ + { + Config: createServiceKey(terraformResourceName, serviceAccountName), + Destroy: true, + }, + { + Config: createServiceKey(terraformResourceName, serviceAccountName), + ConfigPlanChecks: sdk.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(serviceKey, plancheck.ResourceActionCreate), }, }, }, - }) + }, }) } func TestAccTwingateServiceKeyReCreateAfterDeletion(t *testing.T) { - t.Run("Test Twingate Resource : Acc Service Key ReCreate After Delete", func(t *testing.T) { - serviceAccountName := test.RandomName() - terraformResourceName := test.TerraformRandName("test_key") - serviceKey := acctests.TerraformServiceKey(terraformResourceName) - - sdk.Test(t, sdk.TestCase{ - ProtoV6ProviderFactories: acctests.ProviderFactories, - PreCheck: func() { acctests.PreCheck(t) }, - CheckDestroy: acctests.CheckTwingateServiceAccountDestroy, - Steps: []sdk.TestStep{ - { - Config: createServiceKey(terraformResourceName, serviceAccountName), - Check: acctests.ComposeTestCheckFunc( - acctests.CheckTwingateResourceExists(serviceKey), - acctests.RevokeTwingateServiceKey(serviceKey), - acctests.DeleteTwingateResource(serviceKey, resource.TwingateServiceAccountKey), - ), - ExpectNonEmptyPlan: true, - }, - { - Config: createServiceKey(terraformResourceName, serviceAccountName), - Check: acctests.ComposeTestCheckFunc( - acctests.CheckTwingateResourceExists(serviceKey), - sdk.TestCheckResourceAttrWith(serviceKey, attr.Token, nonEmptyValue), - ), - }, + t.Parallel() + + serviceAccountName := test.RandomName() + terraformResourceName := test.TerraformRandName("test_key") + serviceKey := acctests.TerraformServiceKey(terraformResourceName) + + sdk.Test(t, sdk.TestCase{ + ProtoV6ProviderFactories: acctests.ProviderFactories, + PreCheck: func() { acctests.PreCheck(t) }, + CheckDestroy: acctests.CheckTwingateServiceAccountDestroy, + Steps: []sdk.TestStep{ + { + Config: createServiceKey(terraformResourceName, serviceAccountName), + Check: acctests.ComposeTestCheckFunc( + acctests.CheckTwingateResourceExists(serviceKey), + acctests.RevokeTwingateServiceKey(serviceKey), + acctests.DeleteTwingateResource(serviceKey, resource.TwingateServiceAccountKey), + ), + ExpectNonEmptyPlan: true, + }, + { + Config: createServiceKey(terraformResourceName, serviceAccountName), + Check: acctests.ComposeTestCheckFunc( + acctests.CheckTwingateResourceExists(serviceKey), + sdk.TestCheckResourceAttrWith(serviceKey, attr.Token, nonEmptyValue), + ), }, - }) + }, }) } func TestAccTwingateServiceKeyCreateWithInvalidExpiration(t *testing.T) { - t.Run("Test Twingate Resource : Acc Service Key Create With Invalid Expiration", func(t *testing.T) { - serviceAccountName := test.RandomName() - terraformResourceName := test.TerraformRandName("test_key") - - sdk.Test(t, sdk.TestCase{ - ProtoV6ProviderFactories: acctests.ProviderFactories, - PreCheck: func() { acctests.PreCheck(t) }, - CheckDestroy: acctests.CheckTwingateServiceAccountDestroy, - Steps: []sdk.TestStep{ - { - Config: createServiceKeyWithExpiration(terraformResourceName, serviceAccountName, -1), - ExpectError: regexp.MustCompile(resource.ErrInvalidExpirationTime.Error()), - }, - { - Config: createServiceKeyWithExpiration(terraformResourceName, serviceAccountName, 366), - ExpectError: regexp.MustCompile(resource.ErrInvalidExpirationTime.Error()), - }, + t.Parallel() + + serviceAccountName := test.RandomName() + terraformResourceName := test.TerraformRandName("test_key") + + sdk.Test(t, sdk.TestCase{ + ProtoV6ProviderFactories: acctests.ProviderFactories, + PreCheck: func() { acctests.PreCheck(t) }, + CheckDestroy: acctests.CheckTwingateServiceAccountDestroy, + Steps: []sdk.TestStep{ + { + Config: createServiceKeyWithExpiration(terraformResourceName, serviceAccountName, -1), + ExpectError: regexp.MustCompile(resource.ErrInvalidExpirationTime.Error()), + }, + { + Config: createServiceKeyWithExpiration(terraformResourceName, serviceAccountName, 366), + ExpectError: regexp.MustCompile(resource.ErrInvalidExpirationTime.Error()), }, - }) + }, }) } func TestAccTwingateServiceKeyCreateWithExpiration(t *testing.T) { - t.Run("Test Twingate Resource : Acc Service Key Create With Expiration", func(t *testing.T) { - serviceAccountName := test.RandomName() - terraformResourceName := test.TerraformRandName("test_key") - serviceAccount := acctests.TerraformServiceAccount(terraformResourceName) - serviceKey := acctests.TerraformServiceKey(terraformResourceName) - - sdk.Test(t, sdk.TestCase{ - ProtoV6ProviderFactories: acctests.ProviderFactories, - PreCheck: func() { acctests.PreCheck(t) }, - CheckDestroy: acctests.CheckTwingateServiceAccountDestroy, - Steps: []sdk.TestStep{ - { - Config: createServiceKeyWithExpiration(terraformResourceName, serviceAccountName, 365), - Check: acctests.ComposeTestCheckFunc( - acctests.CheckTwingateResourceExists(serviceAccount), - sdk.TestCheckResourceAttr(serviceAccount, attr.Name, serviceAccountName), - acctests.CheckTwingateResourceExists(serviceKey), - sdk.TestCheckResourceAttr(serviceKey, attr.IsActive, "true"), - sdk.TestCheckResourceAttrWith(serviceKey, attr.Token, nonEmptyValue), - ), - }, + t.Parallel() + + serviceAccountName := test.RandomName() + terraformResourceName := test.TerraformRandName("test_key") + serviceAccount := acctests.TerraformServiceAccount(terraformResourceName) + serviceKey := acctests.TerraformServiceKey(terraformResourceName) + + sdk.Test(t, sdk.TestCase{ + ProtoV6ProviderFactories: acctests.ProviderFactories, + PreCheck: func() { acctests.PreCheck(t) }, + CheckDestroy: acctests.CheckTwingateServiceAccountDestroy, + Steps: []sdk.TestStep{ + { + Config: createServiceKeyWithExpiration(terraformResourceName, serviceAccountName, 365), + Check: acctests.ComposeTestCheckFunc( + acctests.CheckTwingateResourceExists(serviceAccount), + sdk.TestCheckResourceAttr(serviceAccount, attr.Name, serviceAccountName), + acctests.CheckTwingateResourceExists(serviceKey), + sdk.TestCheckResourceAttr(serviceKey, attr.IsActive, "true"), + sdk.TestCheckResourceAttrWith(serviceKey, attr.Token, nonEmptyValue), + ), }, - }) + }, }) } func TestAccTwingateServiceKeyReCreateAfterChangingExpirationTime(t *testing.T) { - t.Run("Test Twingate Resource : Acc Service Key ReCreate After Changing Expiration Time", func(t *testing.T) { - serviceAccountName := test.RandomName() - terraformResourceName := test.TerraformRandName("test_key") - serviceKey := acctests.TerraformServiceKey(terraformResourceName) - - resourceID := new(string) - - sdk.Test(t, sdk.TestCase{ - ProtoV6ProviderFactories: acctests.ProviderFactories, - PreCheck: func() { acctests.PreCheck(t) }, - CheckDestroy: acctests.CheckTwingateServiceAccountDestroy, - Steps: []sdk.TestStep{ - { - Config: createServiceKeyWithExpiration(terraformResourceName, serviceAccountName, 1), - Check: acctests.ComposeTestCheckFunc( - acctests.CheckTwingateResourceExists(serviceKey), - acctests.GetTwingateResourceID(serviceKey, &resourceID), - sdk.TestCheckResourceAttrWith(serviceKey, attr.Token, nonEmptyValue), - ), - }, - { - Config: createServiceKeyWithExpiration(terraformResourceName, serviceAccountName, 2), - Check: acctests.ComposeTestCheckFunc( - acctests.CheckTwingateResourceExists(serviceKey), - sdk.TestCheckResourceAttrWith(serviceKey, attr.ID, func(value string) error { - if *resourceID == "" { - return errors.New("failed to fetch resource id") - } - - if value == *resourceID { - return errors.New("resource was not re-created") - } - - return nil - }), - ), - }, + t.Parallel() + + serviceAccountName := test.RandomName() + terraformResourceName := test.TerraformRandName("test_key") + serviceKey := acctests.TerraformServiceKey(terraformResourceName) + + resourceID := new(string) + + sdk.Test(t, sdk.TestCase{ + ProtoV6ProviderFactories: acctests.ProviderFactories, + PreCheck: func() { acctests.PreCheck(t) }, + CheckDestroy: acctests.CheckTwingateServiceAccountDestroy, + Steps: []sdk.TestStep{ + { + Config: createServiceKeyWithExpiration(terraformResourceName, serviceAccountName, 1), + Check: acctests.ComposeTestCheckFunc( + acctests.CheckTwingateResourceExists(serviceKey), + acctests.GetTwingateResourceID(serviceKey, &resourceID), + sdk.TestCheckResourceAttrWith(serviceKey, attr.Token, nonEmptyValue), + ), + }, + { + Config: createServiceKeyWithExpiration(terraformResourceName, serviceAccountName, 2), + Check: acctests.ComposeTestCheckFunc( + acctests.CheckTwingateResourceExists(serviceKey), + sdk.TestCheckResourceAttrWith(serviceKey, attr.ID, func(value string) error { + if *resourceID == "" { + return errors.New("failed to fetch resource id") + } + + if value == *resourceID { + return errors.New("resource was not re-created") + } + + return nil + }), + ), }, - }) + }, }) } func TestAccTwingateServiceKeyAndServiceAccountLifecycle(t *testing.T) { - t.Run("Test Twingate Resource : Acc Service Key and Service Account Lifecycle", func(t *testing.T) { - serviceAccountName := test.RandomName() - serviceAccountNameV2 := test.RandomName() - terraformServiceAccountName := test.TerraformRandName("test_acc") - terraformServiceAccountNameV2 := test.TerraformRandName("test_acc_v2") - terraformServiceAccountKeyName := test.TerraformRandName("test_key") - serviceAccount := acctests.TerraformServiceAccount(terraformServiceAccountName) - serviceAccountV2 := acctests.TerraformServiceAccount(terraformServiceAccountNameV2) - serviceKey := acctests.TerraformServiceKey(terraformServiceAccountKeyName) - - serviceKeyResourceID := new(string) - serviceAccountResourceID := new(string) - - sdk.Test(t, sdk.TestCase{ - ProtoV6ProviderFactories: acctests.ProviderFactories, - PreCheck: func() { acctests.PreCheck(t) }, - CheckDestroy: acctests.CheckTwingateServiceAccountDestroy, - Steps: []sdk.TestStep{ - { - Config: createServiceKeyV1(terraformServiceAccountName, serviceAccountName, terraformServiceAccountNameV2, serviceAccountNameV2, terraformServiceAccountKeyName, terraformServiceAccountName), - Check: acctests.ComposeTestCheckFunc( - acctests.CheckTwingateResourceExists(serviceAccount), - sdk.TestCheckResourceAttr(serviceAccount, attr.Name, serviceAccountName), - acctests.CheckTwingateResourceExists(serviceKey), - sdk.TestCheckResourceAttrWith(serviceKey, attr.Token, nonEmptyValue), - acctests.GetTwingateResourceID(serviceKey, &serviceKeyResourceID), - acctests.GetTwingateResourceID(serviceKey, &serviceAccountResourceID), - ), - }, - { - Config: createServiceKeyV1(terraformServiceAccountName, serviceAccountName, terraformServiceAccountNameV2, serviceAccountNameV2, terraformServiceAccountKeyName, terraformServiceAccountNameV2), - Check: acctests.ComposeTestCheckFunc( - acctests.CheckTwingateResourceExists(serviceAccountV2), - sdk.TestCheckResourceAttr(serviceAccountV2, attr.Name, serviceAccountNameV2), - acctests.CheckTwingateResourceExists(serviceKey), - sdk.TestCheckResourceAttrWith(serviceKey, attr.Token, nonEmptyValue), - - // test resources were re-created - sdk.TestCheckResourceAttrWith(serviceKey, attr.ID, func(value string) error { - if *serviceKeyResourceID == "" { - return errors.New("failed to fetch service_key resource id") - } - - if value == *serviceKeyResourceID { - return errors.New("service_key resource was not re-created") - } - - return nil - }), - - sdk.TestCheckResourceAttrWith(serviceAccountV2, attr.ID, func(value string) error { - if *serviceAccountResourceID == "" { - return errors.New("failed to fetch service_account resource id") - } - - if value == *serviceAccountResourceID { - return errors.New("service_account resource was not re-created") - } - - return nil - }), - ), - }, + t.Parallel() + + serviceAccountName := test.RandomName() + serviceAccountNameV2 := test.RandomName() + terraformServiceAccountName := test.TerraformRandName("test_acc") + terraformServiceAccountNameV2 := test.TerraformRandName("test_acc_v2") + terraformServiceAccountKeyName := test.TerraformRandName("test_key") + serviceAccount := acctests.TerraformServiceAccount(terraformServiceAccountName) + serviceAccountV2 := acctests.TerraformServiceAccount(terraformServiceAccountNameV2) + serviceKey := acctests.TerraformServiceKey(terraformServiceAccountKeyName) + + serviceKeyResourceID := new(string) + serviceAccountResourceID := new(string) + + sdk.Test(t, sdk.TestCase{ + ProtoV6ProviderFactories: acctests.ProviderFactories, + PreCheck: func() { acctests.PreCheck(t) }, + CheckDestroy: acctests.CheckTwingateServiceAccountDestroy, + Steps: []sdk.TestStep{ + { + Config: createServiceKeyV1(terraformServiceAccountName, serviceAccountName, terraformServiceAccountNameV2, serviceAccountNameV2, terraformServiceAccountKeyName, terraformServiceAccountName), + Check: acctests.ComposeTestCheckFunc( + acctests.CheckTwingateResourceExists(serviceAccount), + sdk.TestCheckResourceAttr(serviceAccount, attr.Name, serviceAccountName), + acctests.CheckTwingateResourceExists(serviceKey), + sdk.TestCheckResourceAttrWith(serviceKey, attr.Token, nonEmptyValue), + acctests.GetTwingateResourceID(serviceKey, &serviceKeyResourceID), + acctests.GetTwingateResourceID(serviceKey, &serviceAccountResourceID), + ), + }, + { + Config: createServiceKeyV1(terraformServiceAccountName, serviceAccountName, terraformServiceAccountNameV2, serviceAccountNameV2, terraformServiceAccountKeyName, terraformServiceAccountNameV2), + Check: acctests.ComposeTestCheckFunc( + acctests.CheckTwingateResourceExists(serviceAccountV2), + sdk.TestCheckResourceAttr(serviceAccountV2, attr.Name, serviceAccountNameV2), + acctests.CheckTwingateResourceExists(serviceKey), + sdk.TestCheckResourceAttrWith(serviceKey, attr.Token, nonEmptyValue), + + // test resources were re-created + sdk.TestCheckResourceAttrWith(serviceKey, attr.ID, func(value string) error { + if *serviceKeyResourceID == "" { + return errors.New("failed to fetch service_key resource id") + } + + if value == *serviceKeyResourceID { + return errors.New("service_key resource was not re-created") + } + + return nil + }), + + sdk.TestCheckResourceAttrWith(serviceAccountV2, attr.ID, func(value string) error { + if *serviceAccountResourceID == "" { + return errors.New("failed to fetch service_account resource id") + } + + if value == *serviceAccountResourceID { + return errors.New("service_account resource was not re-created") + } + + return nil + }), + ), }, - }) + }, }) } diff --git a/twingate/internal/test/acctests/resource/user_test.go b/twingate/internal/test/acctests/resource/user_test.go index 46864d47..74f1ee42 100644 --- a/twingate/internal/test/acctests/resource/user_test.go +++ b/twingate/internal/test/acctests/resource/user_test.go @@ -15,55 +15,55 @@ import ( ) func TestAccTwingateUserCreateUpdate(t *testing.T) { - t.Run("Test Twingate Resource : Acc User Create/Update", func(t *testing.T) { - const terraformResourceName = "test001" - theResource := acctests.TerraformUser(terraformResourceName) - email := test.RandomEmail() - firstName := test.RandomName() - lastName := test.RandomName() - role := model.UserRoleSupport - - sdk.Test(t, sdk.TestCase{ - ProtoV6ProviderFactories: acctests.ProviderFactories, - PreCheck: func() { acctests.PreCheck(t) }, - CheckDestroy: acctests.CheckTwingateUserDestroy, - Steps: []sdk.TestStep{ - { - Config: terraformResourceTwingateUser(terraformResourceName, email), - Check: acctests.ComposeTestCheckFunc( - acctests.CheckTwingateResourceExists(theResource), - sdk.TestCheckResourceAttr(theResource, attr.Email, email), - ), - }, - { - Config: terraformResourceTwingateUserWithFirstName(terraformResourceName, email, firstName), - Check: acctests.ComposeTestCheckFunc( - acctests.CheckTwingateResourceExists(theResource), - sdk.TestCheckResourceAttr(theResource, attr.Email, email), - sdk.TestCheckResourceAttr(theResource, attr.FirstName, firstName), - ), - }, - { - Config: terraformResourceTwingateUserWithLastName(terraformResourceName, email, lastName), - Check: acctests.ComposeTestCheckFunc( - acctests.CheckTwingateResourceExists(theResource), - sdk.TestCheckResourceAttr(theResource, attr.Email, email), - sdk.TestCheckResourceAttr(theResource, attr.FirstName, firstName), - sdk.TestCheckResourceAttr(theResource, attr.LastName, lastName), - ), - }, - { - Config: terraformResourceTwingateUserWithRole(terraformResourceName, email, role), - Check: acctests.ComposeTestCheckFunc( - acctests.CheckTwingateResourceExists(theResource), - sdk.TestCheckResourceAttr(theResource, attr.Email, email), - sdk.TestCheckResourceAttr(theResource, attr.FirstName, firstName), - sdk.TestCheckResourceAttr(theResource, attr.LastName, lastName), - sdk.TestCheckResourceAttr(theResource, attr.Role, role), - ), - }, + t.Parallel() + + const terraformResourceName = "test001" + theResource := acctests.TerraformUser(terraformResourceName) + email := test.RandomEmail() + firstName := test.RandomName() + lastName := test.RandomName() + role := model.UserRoleSupport + + sdk.Test(t, sdk.TestCase{ + ProtoV6ProviderFactories: acctests.ProviderFactories, + PreCheck: func() { acctests.PreCheck(t) }, + CheckDestroy: acctests.CheckTwingateUserDestroy, + Steps: []sdk.TestStep{ + { + Config: terraformResourceTwingateUser(terraformResourceName, email), + Check: acctests.ComposeTestCheckFunc( + acctests.CheckTwingateResourceExists(theResource), + sdk.TestCheckResourceAttr(theResource, attr.Email, email), + ), + }, + { + Config: terraformResourceTwingateUserWithFirstName(terraformResourceName, email, firstName), + Check: acctests.ComposeTestCheckFunc( + acctests.CheckTwingateResourceExists(theResource), + sdk.TestCheckResourceAttr(theResource, attr.Email, email), + sdk.TestCheckResourceAttr(theResource, attr.FirstName, firstName), + ), + }, + { + Config: terraformResourceTwingateUserWithLastName(terraformResourceName, email, lastName), + Check: acctests.ComposeTestCheckFunc( + acctests.CheckTwingateResourceExists(theResource), + sdk.TestCheckResourceAttr(theResource, attr.Email, email), + sdk.TestCheckResourceAttr(theResource, attr.FirstName, firstName), + sdk.TestCheckResourceAttr(theResource, attr.LastName, lastName), + ), }, - }) + { + Config: terraformResourceTwingateUserWithRole(terraformResourceName, email, role), + Check: acctests.ComposeTestCheckFunc( + acctests.CheckTwingateResourceExists(theResource), + sdk.TestCheckResourceAttr(theResource, attr.Email, email), + sdk.TestCheckResourceAttr(theResource, attr.FirstName, firstName), + sdk.TestCheckResourceAttr(theResource, attr.LastName, lastName), + sdk.TestCheckResourceAttr(theResource, attr.Role, role), + ), + }, + }, }) } @@ -107,31 +107,31 @@ func terraformResourceTwingateUserWithRole(terraformResourceName, email, role st } func TestAccTwingateUserFullCreate(t *testing.T) { - t.Run("Test Twingate Resource : Acc User Full Create", func(t *testing.T) { - const terraformResourceName = "test002" - theResource := acctests.TerraformUser(terraformResourceName) - email := test.RandomEmail() - firstName := test.RandomName() - lastName := test.RandomName() - role := test.RandomUserRole() - - sdk.Test(t, sdk.TestCase{ - ProtoV6ProviderFactories: acctests.ProviderFactories, - PreCheck: func() { acctests.PreCheck(t) }, - CheckDestroy: acctests.CheckTwingateUserDestroy, - Steps: []sdk.TestStep{ - { - Config: terraformResourceTwingateUserFull(terraformResourceName, email, firstName, lastName, role), - Check: acctests.ComposeTestCheckFunc( - acctests.CheckTwingateResourceExists(theResource), - sdk.TestCheckResourceAttr(theResource, attr.Email, email), - sdk.TestCheckResourceAttr(theResource, attr.FirstName, firstName), - sdk.TestCheckResourceAttr(theResource, attr.LastName, lastName), - sdk.TestCheckResourceAttr(theResource, attr.Role, role), - ), - }, + t.Parallel() + + const terraformResourceName = "test002" + theResource := acctests.TerraformUser(terraformResourceName) + email := test.RandomEmail() + firstName := test.RandomName() + lastName := test.RandomName() + role := test.RandomUserRole() + + sdk.Test(t, sdk.TestCase{ + ProtoV6ProviderFactories: acctests.ProviderFactories, + PreCheck: func() { acctests.PreCheck(t) }, + CheckDestroy: acctests.CheckTwingateUserDestroy, + Steps: []sdk.TestStep{ + { + Config: terraformResourceTwingateUserFull(terraformResourceName, email, firstName, lastName, role), + Check: acctests.ComposeTestCheckFunc( + acctests.CheckTwingateResourceExists(theResource), + sdk.TestCheckResourceAttr(theResource, attr.Email, email), + sdk.TestCheckResourceAttr(theResource, attr.FirstName, firstName), + sdk.TestCheckResourceAttr(theResource, attr.LastName, lastName), + sdk.TestCheckResourceAttr(theResource, attr.Role, role), + ), }, - }) + }, }) } @@ -148,60 +148,60 @@ func terraformResourceTwingateUserFull(terraformResourceName, email, firstName, } func TestAccTwingateUserReCreation(t *testing.T) { - t.Run("Test Twingate Resource : Acc User ReCreation", func(t *testing.T) { - const terraformResourceName = "test003" - theResource := acctests.TerraformUser(terraformResourceName) - email1 := test.RandomEmail() - email2 := test.RandomEmail() - - sdk.Test(t, sdk.TestCase{ - ProtoV6ProviderFactories: acctests.ProviderFactories, - PreCheck: func() { acctests.PreCheck(t) }, - CheckDestroy: acctests.CheckTwingateUserDestroy, - Steps: []sdk.TestStep{ - { - Config: terraformResourceTwingateUser(terraformResourceName, email1), - Check: acctests.ComposeTestCheckFunc( - acctests.CheckTwingateResourceExists(theResource), - sdk.TestCheckResourceAttr(theResource, attr.Email, email1), - ), - }, - { - Config: terraformResourceTwingateUser(terraformResourceName, email2), - Check: acctests.ComposeTestCheckFunc( - acctests.CheckTwingateResourceExists(theResource), - sdk.TestCheckResourceAttr(theResource, attr.Email, email2), - ), - }, + t.Parallel() + + const terraformResourceName = "test003" + theResource := acctests.TerraformUser(terraformResourceName) + email1 := test.RandomEmail() + email2 := test.RandomEmail() + + sdk.Test(t, sdk.TestCase{ + ProtoV6ProviderFactories: acctests.ProviderFactories, + PreCheck: func() { acctests.PreCheck(t) }, + CheckDestroy: acctests.CheckTwingateUserDestroy, + Steps: []sdk.TestStep{ + { + Config: terraformResourceTwingateUser(terraformResourceName, email1), + Check: acctests.ComposeTestCheckFunc( + acctests.CheckTwingateResourceExists(theResource), + sdk.TestCheckResourceAttr(theResource, attr.Email, email1), + ), + }, + { + Config: terraformResourceTwingateUser(terraformResourceName, email2), + Check: acctests.ComposeTestCheckFunc( + acctests.CheckTwingateResourceExists(theResource), + sdk.TestCheckResourceAttr(theResource, attr.Email, email2), + ), }, - }) + }, }) } func TestAccTwingateUserUpdateState(t *testing.T) { - t.Run("Test Twingate Resource : Acc User Update State", func(t *testing.T) { - const terraformResourceName = "test004" - theResource := acctests.TerraformUser(terraformResourceName) - email := test.RandomEmail() - - sdk.Test(t, sdk.TestCase{ - ProtoV6ProviderFactories: acctests.ProviderFactories, - PreCheck: func() { acctests.PreCheck(t) }, - CheckDestroy: acctests.CheckTwingateUserDestroy, - Steps: []sdk.TestStep{ - { - Config: terraformResourceTwingateUser(terraformResourceName, email), - Check: acctests.ComposeTestCheckFunc( - acctests.CheckTwingateResourceExists(theResource), - sdk.TestCheckResourceAttr(theResource, attr.Email, email), - ), - }, - { - Config: terraformResourceTwingateUserDisabled(terraformResourceName, email), - ExpectError: regexp.MustCompile(`User in PENDING state`), - }, + t.Parallel() + + const terraformResourceName = "test004" + theResource := acctests.TerraformUser(terraformResourceName) + email := test.RandomEmail() + + sdk.Test(t, sdk.TestCase{ + ProtoV6ProviderFactories: acctests.ProviderFactories, + PreCheck: func() { acctests.PreCheck(t) }, + CheckDestroy: acctests.CheckTwingateUserDestroy, + Steps: []sdk.TestStep{ + { + Config: terraformResourceTwingateUser(terraformResourceName, email), + Check: acctests.ComposeTestCheckFunc( + acctests.CheckTwingateResourceExists(theResource), + sdk.TestCheckResourceAttr(theResource, attr.Email, email), + ), + }, + { + Config: terraformResourceTwingateUserDisabled(terraformResourceName, email), + ExpectError: regexp.MustCompile(`User in PENDING state`), }, - }) + }, }) } @@ -216,96 +216,96 @@ func terraformResourceTwingateUserDisabled(terraformResourceName, email string) } func TestAccTwingateUserDelete(t *testing.T) { - t.Run("Test Twingate Resource : Acc User Delete", func(t *testing.T) { - const terraformResourceName = "test005" - theResource := acctests.TerraformUser(terraformResourceName) - userEmail := test.RandomEmail() - - sdk.Test(t, sdk.TestCase{ - ProtoV6ProviderFactories: acctests.ProviderFactories, - PreCheck: func() { acctests.PreCheck(t) }, - CheckDestroy: acctests.CheckTwingateUserDestroy, - Steps: []sdk.TestStep{ - { - Config: terraformResourceTwingateUser(terraformResourceName, userEmail), - Destroy: true, - }, - { - Config: terraformResourceTwingateUser(terraformResourceName, userEmail), - ConfigPlanChecks: sdk.ConfigPlanChecks{ - PreApply: []plancheck.PlanCheck{ - plancheck.ExpectResourceAction(theResource, plancheck.ResourceActionCreate), - }, + t.Parallel() + + const terraformResourceName = "test005" + theResource := acctests.TerraformUser(terraformResourceName) + userEmail := test.RandomEmail() + + sdk.Test(t, sdk.TestCase{ + ProtoV6ProviderFactories: acctests.ProviderFactories, + PreCheck: func() { acctests.PreCheck(t) }, + CheckDestroy: acctests.CheckTwingateUserDestroy, + Steps: []sdk.TestStep{ + { + Config: terraformResourceTwingateUser(terraformResourceName, userEmail), + Destroy: true, + }, + { + Config: terraformResourceTwingateUser(terraformResourceName, userEmail), + ConfigPlanChecks: sdk.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(theResource, plancheck.ResourceActionCreate), }, }, }, - }) + }, }) } func TestAccTwingateUserReCreateAfterDeletion(t *testing.T) { - t.Run("Test Twingate Resource : Acc User Create After Deletion", func(t *testing.T) { - const terraformResourceName = "test006" - theResource := acctests.TerraformUser(terraformResourceName) - email := test.RandomEmail() - - sdk.Test(t, sdk.TestCase{ - ProtoV6ProviderFactories: acctests.ProviderFactories, - PreCheck: func() { acctests.PreCheck(t) }, - CheckDestroy: acctests.CheckTwingateUserDestroy, - Steps: []sdk.TestStep{ - { - Config: terraformResourceTwingateUser(terraformResourceName, email), - Check: acctests.ComposeTestCheckFunc( - acctests.CheckTwingateResourceExists(theResource), - acctests.DeleteTwingateResource(theResource, resource.TwingateUser), - ), - ExpectNonEmptyPlan: true, - }, - { - Config: terraformResourceTwingateUser(terraformResourceName, email), - Check: acctests.ComposeTestCheckFunc( - acctests.CheckTwingateResourceExists(theResource), - ), - }, + t.Parallel() + + const terraformResourceName = "test006" + theResource := acctests.TerraformUser(terraformResourceName) + email := test.RandomEmail() + + sdk.Test(t, sdk.TestCase{ + ProtoV6ProviderFactories: acctests.ProviderFactories, + PreCheck: func() { acctests.PreCheck(t) }, + CheckDestroy: acctests.CheckTwingateUserDestroy, + Steps: []sdk.TestStep{ + { + Config: terraformResourceTwingateUser(terraformResourceName, email), + Check: acctests.ComposeTestCheckFunc( + acctests.CheckTwingateResourceExists(theResource), + acctests.DeleteTwingateResource(theResource, resource.TwingateUser), + ), + ExpectNonEmptyPlan: true, + }, + { + Config: terraformResourceTwingateUser(terraformResourceName, email), + Check: acctests.ComposeTestCheckFunc( + acctests.CheckTwingateResourceExists(theResource), + ), }, - }) + }, }) } func TestAccTwingateUserCreateWithUnknownRole(t *testing.T) { - t.Run("Test Twingate Resource : Acc User Create With Unknown Role", func(t *testing.T) { - const terraformResourceName = "test007" - - sdk.Test(t, sdk.TestCase{ - ProtoV6ProviderFactories: acctests.ProviderFactories, - PreCheck: func() { acctests.PreCheck(t) }, - CheckDestroy: acctests.CheckTwingateUserDestroy, - Steps: []sdk.TestStep{ - { - Config: terraformResourceTwingateUserWithRole(terraformResourceName, test.RandomEmail(), "UnknownRole"), - ExpectError: regexp.MustCompile(`Attribute role value must be one of`), - }, + t.Parallel() + + const terraformResourceName = "test007" + + sdk.Test(t, sdk.TestCase{ + ProtoV6ProviderFactories: acctests.ProviderFactories, + PreCheck: func() { acctests.PreCheck(t) }, + CheckDestroy: acctests.CheckTwingateUserDestroy, + Steps: []sdk.TestStep{ + { + Config: terraformResourceTwingateUserWithRole(terraformResourceName, test.RandomEmail(), "UnknownRole"), + ExpectError: regexp.MustCompile(`Attribute role value must be one of`), }, - }) + }, }) } func TestAccTwingateUserCreateWithoutEmail(t *testing.T) { - t.Run("Test Twingate Resource : Acc User Create Without Email", func(t *testing.T) { - const terraformResourceName = "test008" - - sdk.Test(t, sdk.TestCase{ - ProtoV6ProviderFactories: acctests.ProviderFactories, - PreCheck: func() { acctests.PreCheck(t) }, - CheckDestroy: acctests.CheckTwingateUserDestroy, - Steps: []sdk.TestStep{ - { - Config: terraformResourceTwingateUserWithoutEmail(terraformResourceName), - ExpectError: regexp.MustCompile("Error: Missing required argument"), - }, + t.Parallel() + + const terraformResourceName = "test008" + + sdk.Test(t, sdk.TestCase{ + ProtoV6ProviderFactories: acctests.ProviderFactories, + PreCheck: func() { acctests.PreCheck(t) }, + CheckDestroy: acctests.CheckTwingateUserDestroy, + Steps: []sdk.TestStep{ + { + Config: terraformResourceTwingateUserWithoutEmail(terraformResourceName), + ExpectError: regexp.MustCompile("Error: Missing required argument"), }, - }) + }, }) } From 24432c7da5f0c6aec3060a62d32cb653f20d16ee Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Nov 2024 21:01:03 +0100 Subject: [PATCH 09/15] Bump github.com/hashicorp/terraform-plugin-framework-validators from 0.14.0 to 0.15.0 (#592) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: bertekintw <101608051+bertekintw@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index d3e34ef3..1eceb97d 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/hashicorp/go-uuid v1.0.3 github.com/hashicorp/terraform-plugin-docs v0.19.4 github.com/hashicorp/terraform-plugin-framework v1.13.0 - github.com/hashicorp/terraform-plugin-framework-validators v0.14.0 + github.com/hashicorp/terraform-plugin-framework-validators v0.15.0 github.com/hashicorp/terraform-plugin-go v0.25.0 github.com/hashicorp/terraform-plugin-testing v1.10.0 github.com/hasura/go-graphql-client v0.13.1 diff --git a/go.sum b/go.sum index 7f35c9e0..5ccb682a 100644 --- a/go.sum +++ b/go.sum @@ -178,8 +178,8 @@ github.com/hashicorp/terraform-plugin-docs v0.19.4 h1:G3Bgo7J22OMtegIgn8Cd/CaSey github.com/hashicorp/terraform-plugin-docs v0.19.4/go.mod h1:4pLASsatTmRynVzsjEhbXZ6s7xBlUw/2Kt0zfrq8HxA= github.com/hashicorp/terraform-plugin-framework v1.13.0 h1:8OTG4+oZUfKgnfTdPTJwZ532Bh2BobF4H+yBiYJ/scw= github.com/hashicorp/terraform-plugin-framework v1.13.0/go.mod h1:j64rwMGpgM3NYXTKuxrCnyubQb/4VKldEKlcG8cvmjU= -github.com/hashicorp/terraform-plugin-framework-validators v0.14.0 h1:3PCn9iyzdVOgHYOBmncpSSOxjQhCTYmc+PGvbdlqSaI= -github.com/hashicorp/terraform-plugin-framework-validators v0.14.0/go.mod h1:LwDKNdzxrDY/mHBrlC6aYfE2fQ3Dk3gaJD64vNiXvo4= +github.com/hashicorp/terraform-plugin-framework-validators v0.15.0 h1:RXMmu7JgpFjnI1a5QjMCBb11usrW2OtAG+iOTIj5c9Y= +github.com/hashicorp/terraform-plugin-framework-validators v0.15.0/go.mod h1:Bh89/hNmqsEWug4/XWKYBwtnw3tbz5BAy1L1OgvbIaY= github.com/hashicorp/terraform-plugin-go v0.25.0 h1:oi13cx7xXA6QciMcpcFi/rwA974rdTxjqEhXJjbAyks= github.com/hashicorp/terraform-plugin-go v0.25.0/go.mod h1:+SYagMYadJP86Kvn+TGeV+ofr/R3g4/If0O5sO96MVw= github.com/hashicorp/terraform-plugin-log v0.9.0 h1:i7hOA+vdAItN1/7UrfBqBwvYPQ9TFvymaRGZED3FCV0= From e1999fa727ed697186812e2caab5fcb61d2afbe4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 7 Nov 2024 05:24:01 -0800 Subject: [PATCH 10/15] Bump github.com/hashicorp/terraform-plugin-docs from 0.19.4 to 0.20.0 (#599) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 12 ++++++------ go.sum | 28 ++++++++++++++-------------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/go.mod b/go.mod index 1eceb97d..6ccfcc5e 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( github.com/google/go-cmp v0.6.0 github.com/hashicorp/go-retryablehttp v0.7.7 github.com/hashicorp/go-uuid v1.0.3 - github.com/hashicorp/terraform-plugin-docs v0.19.4 + github.com/hashicorp/terraform-plugin-docs v0.20.0 github.com/hashicorp/terraform-plugin-framework v1.13.0 github.com/hashicorp/terraform-plugin-framework-validators v0.15.0 github.com/hashicorp/terraform-plugin-go v0.25.0 @@ -41,7 +41,7 @@ require ( github.com/armon/go-radix v1.0.0 // indirect github.com/bgentry/speakeasy v0.1.0 // indirect github.com/bitfield/gotestdox v0.2.2 // indirect - github.com/bmatcuk/doublestar/v4 v4.6.1 // indirect + github.com/bmatcuk/doublestar/v4 v4.7.1 // indirect github.com/ccojocar/zxcvbn-go v1.0.2 // indirect github.com/cloudflare/circl v1.3.7 // indirect github.com/coder/websocket v1.8.12 // indirect @@ -70,11 +70,11 @@ require ( github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/go-plugin v1.6.2 // indirect github.com/hashicorp/go-version v1.7.0 // indirect - github.com/hashicorp/hc-install v0.8.0 // indirect + github.com/hashicorp/hc-install v0.9.0 // indirect github.com/hashicorp/hcl/v2 v2.21.0 // indirect github.com/hashicorp/logutils v1.0.0 // indirect github.com/hashicorp/terraform-exec v0.21.0 // indirect - github.com/hashicorp/terraform-json v0.22.1 // indirect + github.com/hashicorp/terraform-json v0.23.0 // indirect github.com/hashicorp/terraform-plugin-log v0.9.0 // indirect github.com/hashicorp/terraform-plugin-sdk/v2 v2.34.0 // indirect github.com/hashicorp/terraform-registry-address v0.2.3 // indirect @@ -98,7 +98,7 @@ require ( github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 // indirect - github.com/yuin/goldmark v1.7.1 // indirect + github.com/yuin/goldmark v1.7.7 // indirect github.com/yuin/goldmark-meta v1.1.0 // indirect github.com/zclconf/go-cty v1.15.0 // indirect go.abhg.dev/goldmark/frontmatter v0.2.0 // indirect @@ -115,7 +115,7 @@ require ( golang.org/x/oauth2 v0.23.0 // indirect golang.org/x/sys v0.25.0 // indirect golang.org/x/term v0.24.0 // indirect - golang.org/x/text v0.18.0 // indirect + golang.org/x/text v0.19.0 // indirect golang.org/x/time v0.6.0 // indirect golang.org/x/tools v0.25.0 // indirect google.golang.org/api v0.198.0 // indirect diff --git a/go.sum b/go.sum index 5ccb682a..0727c76d 100644 --- a/go.sum +++ b/go.sum @@ -39,8 +39,8 @@ github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQ github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bitfield/gotestdox v0.2.2 h1:x6RcPAbBbErKLnapz1QeAlf3ospg8efBsedU93CDsnE= github.com/bitfield/gotestdox v0.2.2/go.mod h1:D+gwtS0urjBrzguAkTM2wodsTQYFHdpx8eqRJ3N+9pY= -github.com/bmatcuk/doublestar/v4 v4.6.1 h1:FH9SifrbvJhnlQpztAx++wlkk70QBf0iBWDwNy7PA4I= -github.com/bmatcuk/doublestar/v4 v4.6.1/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc= +github.com/bmatcuk/doublestar/v4 v4.7.1 h1:fdDeAqgT47acgwd9bd9HxJRDmc9UAmPpc+2m0CXv75Q= +github.com/bmatcuk/doublestar/v4 v4.7.1/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc= github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA= github.com/bufbuild/protocompile v0.4.0/go.mod h1:3v93+mbWn/v3xzN+31nwkJfrEpAUwp+BagBSZWx+TP8= github.com/ccojocar/zxcvbn-go v1.0.2 h1:na/czXU8RrhXO4EZme6eQJLR4PzcGsahsBOAwU6I3Vg= @@ -164,18 +164,18 @@ github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/C github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY= github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/hc-install v0.8.0 h1:LdpZeXkZYMQhoKPCecJHlKvUkQFixN/nvyR1CdfOLjI= -github.com/hashicorp/hc-install v0.8.0/go.mod h1:+MwJYjDfCruSD/udvBmRB22Nlkwwkwf5sAB6uTIhSaU= +github.com/hashicorp/hc-install v0.9.0 h1:2dIk8LcvANwtv3QZLckxcjyF5w8KVtiMxu6G6eLhghE= +github.com/hashicorp/hc-install v0.9.0/go.mod h1:+6vOP+mf3tuGgMApVYtmsnDoKWMDcFXeTxCACYZ8SFg= github.com/hashicorp/hcl/v2 v2.21.0 h1:lve4q/o/2rqwYOgUg3y3V2YPyD1/zkCLGjIV74Jit14= github.com/hashicorp/hcl/v2 v2.21.0/go.mod h1:62ZYHrXgPoX8xBnzl8QzbWq4dyDsDtfCRgIq1rbJEvA= github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI65Y= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/terraform-exec v0.21.0 h1:uNkLAe95ey5Uux6KJdua6+cv8asgILFVWkd/RG0D2XQ= github.com/hashicorp/terraform-exec v0.21.0/go.mod h1:1PPeMYou+KDUSSeRE9szMZ/oHf4fYUmB923Wzbq1ICg= -github.com/hashicorp/terraform-json v0.22.1 h1:xft84GZR0QzjPVWs4lRUwvTcPnegqlyS7orfb5Ltvec= -github.com/hashicorp/terraform-json v0.22.1/go.mod h1:JbWSQCLFSXFFhg42T7l9iJwdGXBYV8fmmD6o/ML4p3A= -github.com/hashicorp/terraform-plugin-docs v0.19.4 h1:G3Bgo7J22OMtegIgn8Cd/CaSeyEljqjH3G39w28JK4c= -github.com/hashicorp/terraform-plugin-docs v0.19.4/go.mod h1:4pLASsatTmRynVzsjEhbXZ6s7xBlUw/2Kt0zfrq8HxA= +github.com/hashicorp/terraform-json v0.23.0 h1:sniCkExU4iKtTADReHzACkk8fnpQXrdD2xoR+lppBkI= +github.com/hashicorp/terraform-json v0.23.0/go.mod h1:MHdXbBAbSg0GvzuWazEGKAn/cyNfIB7mN6y7KJN6y2c= +github.com/hashicorp/terraform-plugin-docs v0.20.0 h1:ox7rm1FN0dVZaJBUzkVVh10R1r3+FeMQWL0QopQ9d7o= +github.com/hashicorp/terraform-plugin-docs v0.20.0/go.mod h1:A/+4SVMdAkQYtIBtaxV0H7AU862TxVZk/hhKaMDQB6Y= github.com/hashicorp/terraform-plugin-framework v1.13.0 h1:8OTG4+oZUfKgnfTdPTJwZ532Bh2BobF4H+yBiYJ/scw= github.com/hashicorp/terraform-plugin-framework v1.13.0/go.mod h1:j64rwMGpgM3NYXTKuxrCnyubQb/4VKldEKlcG8cvmjU= github.com/hashicorp/terraform-plugin-framework-validators v0.15.0 h1:RXMmu7JgpFjnI1a5QjMCBb11usrW2OtAG+iOTIj5c9Y= @@ -261,8 +261,8 @@ github.com/posener/complete v1.2.3 h1:NP0eAhjcjImqslEwo/1hq7gpajME0fTLTezBKDqfXq github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= -github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= -github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= +github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= +github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= github.com/securego/gosec/v2 v2.21.4 h1:Le8MSj0PDmOnHJgUATjD96PaXRvCpKC+DGJvwyy0Mlk= github.com/securego/gosec/v2 v2.21.4/go.mod h1:Jtb/MwRQfRxCXyCm1rfM1BEiiiTfUOdyzzAhlr6lUTA= github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 h1:n661drycOFuPLCN3Uc8sB6B/s6Z4t2xvBgU1htSHuq8= @@ -301,8 +301,8 @@ github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 h1:QldyIu/L63oPpyvQmHgvgickp1Yw510KJOqX7H24mg8= github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778/go.mod h1:2MuV+tbUrU1zIOPMxZ5EncGwgmMJsa+9ucAQZXxsObs= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -github.com/yuin/goldmark v1.7.1 h1:3bajkSilaCbjdKVsKdZjZCLBNPL9pYzrCakKaf4U49U= -github.com/yuin/goldmark v1.7.1/go.mod h1:uzxRWxtg69N339t3louHJ7+O03ezfj6PlliRlaOzY1E= +github.com/yuin/goldmark v1.7.7 h1:5m9rrB1sW3JUMToKFQfb+FGt1U7r57IHu5GrYrG2nqU= +github.com/yuin/goldmark v1.7.7/go.mod h1:uzxRWxtg69N339t3louHJ7+O03ezfj6PlliRlaOzY1E= github.com/yuin/goldmark-meta v1.1.0 h1:pWw+JLHGZe8Rk0EGsMVssiNb/AaPMHfSRszZeUeiOUc= github.com/yuin/goldmark-meta v1.1.0/go.mod h1:U4spWENafuA7Zyg+Lj5RqK/MF+ovMYtBvXi1lBb2VP0= github.com/zclconf/go-cty v1.15.0 h1:tTCRWxsexYUmtt/wVxgDClUe+uQusuI443uL6e+5sXQ= @@ -435,8 +435,8 @@ golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= -golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM= +golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.6.0 h1:eTDhh4ZXt5Qf0augr54TN6suAUudPcawVZeIAPU7D4U= golang.org/x/time v0.6.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= From dbf045e7c6e63d9d2dcf6418564143c4f2922064 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 8 Nov 2024 05:42:41 -0800 Subject: [PATCH 11/15] Bump golang.org/x/sync from 0.8.0 to 0.9.0 (#600) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 6ccfcc5e..01cf3c6f 100644 --- a/go.mod +++ b/go.mod @@ -19,7 +19,7 @@ require ( github.com/mitchellh/copystructure v1.2.0 github.com/securego/gosec/v2 v2.21.4 github.com/stretchr/testify v1.9.0 - golang.org/x/sync v0.8.0 + golang.org/x/sync v0.9.0 gotest.tools/gotestsum v1.12.0 ) diff --git a/go.sum b/go.sum index 0727c76d..53ced412 100644 --- a/go.sum +++ b/go.sum @@ -380,8 +380,8 @@ golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= -golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ= +golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= From eaf3938493c431fbe7c5afee5419dd1a8b2154fe Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 9 Nov 2024 21:35:49 +0000 Subject: [PATCH 12/15] Bump github.com/hashicorp/terraform-plugin-docs from 0.19.4 to 0.20.0 (#44) Bumps [github.com/hashicorp/terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs) from 0.19.4 to 0.20.0. - [Release notes](https://github.com/hashicorp/terraform-plugin-docs/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-docs/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-docs/compare/v0.19.4...v0.20.0) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-docs dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 12 ++++++------ go.sum | 28 ++++++++++++++-------------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/go.mod b/go.mod index 1eceb97d..6ccfcc5e 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( github.com/google/go-cmp v0.6.0 github.com/hashicorp/go-retryablehttp v0.7.7 github.com/hashicorp/go-uuid v1.0.3 - github.com/hashicorp/terraform-plugin-docs v0.19.4 + github.com/hashicorp/terraform-plugin-docs v0.20.0 github.com/hashicorp/terraform-plugin-framework v1.13.0 github.com/hashicorp/terraform-plugin-framework-validators v0.15.0 github.com/hashicorp/terraform-plugin-go v0.25.0 @@ -41,7 +41,7 @@ require ( github.com/armon/go-radix v1.0.0 // indirect github.com/bgentry/speakeasy v0.1.0 // indirect github.com/bitfield/gotestdox v0.2.2 // indirect - github.com/bmatcuk/doublestar/v4 v4.6.1 // indirect + github.com/bmatcuk/doublestar/v4 v4.7.1 // indirect github.com/ccojocar/zxcvbn-go v1.0.2 // indirect github.com/cloudflare/circl v1.3.7 // indirect github.com/coder/websocket v1.8.12 // indirect @@ -70,11 +70,11 @@ require ( github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/go-plugin v1.6.2 // indirect github.com/hashicorp/go-version v1.7.0 // indirect - github.com/hashicorp/hc-install v0.8.0 // indirect + github.com/hashicorp/hc-install v0.9.0 // indirect github.com/hashicorp/hcl/v2 v2.21.0 // indirect github.com/hashicorp/logutils v1.0.0 // indirect github.com/hashicorp/terraform-exec v0.21.0 // indirect - github.com/hashicorp/terraform-json v0.22.1 // indirect + github.com/hashicorp/terraform-json v0.23.0 // indirect github.com/hashicorp/terraform-plugin-log v0.9.0 // indirect github.com/hashicorp/terraform-plugin-sdk/v2 v2.34.0 // indirect github.com/hashicorp/terraform-registry-address v0.2.3 // indirect @@ -98,7 +98,7 @@ require ( github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 // indirect - github.com/yuin/goldmark v1.7.1 // indirect + github.com/yuin/goldmark v1.7.7 // indirect github.com/yuin/goldmark-meta v1.1.0 // indirect github.com/zclconf/go-cty v1.15.0 // indirect go.abhg.dev/goldmark/frontmatter v0.2.0 // indirect @@ -115,7 +115,7 @@ require ( golang.org/x/oauth2 v0.23.0 // indirect golang.org/x/sys v0.25.0 // indirect golang.org/x/term v0.24.0 // indirect - golang.org/x/text v0.18.0 // indirect + golang.org/x/text v0.19.0 // indirect golang.org/x/time v0.6.0 // indirect golang.org/x/tools v0.25.0 // indirect google.golang.org/api v0.198.0 // indirect diff --git a/go.sum b/go.sum index 5ccb682a..0727c76d 100644 --- a/go.sum +++ b/go.sum @@ -39,8 +39,8 @@ github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQ github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bitfield/gotestdox v0.2.2 h1:x6RcPAbBbErKLnapz1QeAlf3ospg8efBsedU93CDsnE= github.com/bitfield/gotestdox v0.2.2/go.mod h1:D+gwtS0urjBrzguAkTM2wodsTQYFHdpx8eqRJ3N+9pY= -github.com/bmatcuk/doublestar/v4 v4.6.1 h1:FH9SifrbvJhnlQpztAx++wlkk70QBf0iBWDwNy7PA4I= -github.com/bmatcuk/doublestar/v4 v4.6.1/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc= +github.com/bmatcuk/doublestar/v4 v4.7.1 h1:fdDeAqgT47acgwd9bd9HxJRDmc9UAmPpc+2m0CXv75Q= +github.com/bmatcuk/doublestar/v4 v4.7.1/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc= github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA= github.com/bufbuild/protocompile v0.4.0/go.mod h1:3v93+mbWn/v3xzN+31nwkJfrEpAUwp+BagBSZWx+TP8= github.com/ccojocar/zxcvbn-go v1.0.2 h1:na/czXU8RrhXO4EZme6eQJLR4PzcGsahsBOAwU6I3Vg= @@ -164,18 +164,18 @@ github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/C github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY= github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/hc-install v0.8.0 h1:LdpZeXkZYMQhoKPCecJHlKvUkQFixN/nvyR1CdfOLjI= -github.com/hashicorp/hc-install v0.8.0/go.mod h1:+MwJYjDfCruSD/udvBmRB22Nlkwwkwf5sAB6uTIhSaU= +github.com/hashicorp/hc-install v0.9.0 h1:2dIk8LcvANwtv3QZLckxcjyF5w8KVtiMxu6G6eLhghE= +github.com/hashicorp/hc-install v0.9.0/go.mod h1:+6vOP+mf3tuGgMApVYtmsnDoKWMDcFXeTxCACYZ8SFg= github.com/hashicorp/hcl/v2 v2.21.0 h1:lve4q/o/2rqwYOgUg3y3V2YPyD1/zkCLGjIV74Jit14= github.com/hashicorp/hcl/v2 v2.21.0/go.mod h1:62ZYHrXgPoX8xBnzl8QzbWq4dyDsDtfCRgIq1rbJEvA= github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI65Y= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/terraform-exec v0.21.0 h1:uNkLAe95ey5Uux6KJdua6+cv8asgILFVWkd/RG0D2XQ= github.com/hashicorp/terraform-exec v0.21.0/go.mod h1:1PPeMYou+KDUSSeRE9szMZ/oHf4fYUmB923Wzbq1ICg= -github.com/hashicorp/terraform-json v0.22.1 h1:xft84GZR0QzjPVWs4lRUwvTcPnegqlyS7orfb5Ltvec= -github.com/hashicorp/terraform-json v0.22.1/go.mod h1:JbWSQCLFSXFFhg42T7l9iJwdGXBYV8fmmD6o/ML4p3A= -github.com/hashicorp/terraform-plugin-docs v0.19.4 h1:G3Bgo7J22OMtegIgn8Cd/CaSeyEljqjH3G39w28JK4c= -github.com/hashicorp/terraform-plugin-docs v0.19.4/go.mod h1:4pLASsatTmRynVzsjEhbXZ6s7xBlUw/2Kt0zfrq8HxA= +github.com/hashicorp/terraform-json v0.23.0 h1:sniCkExU4iKtTADReHzACkk8fnpQXrdD2xoR+lppBkI= +github.com/hashicorp/terraform-json v0.23.0/go.mod h1:MHdXbBAbSg0GvzuWazEGKAn/cyNfIB7mN6y7KJN6y2c= +github.com/hashicorp/terraform-plugin-docs v0.20.0 h1:ox7rm1FN0dVZaJBUzkVVh10R1r3+FeMQWL0QopQ9d7o= +github.com/hashicorp/terraform-plugin-docs v0.20.0/go.mod h1:A/+4SVMdAkQYtIBtaxV0H7AU862TxVZk/hhKaMDQB6Y= github.com/hashicorp/terraform-plugin-framework v1.13.0 h1:8OTG4+oZUfKgnfTdPTJwZ532Bh2BobF4H+yBiYJ/scw= github.com/hashicorp/terraform-plugin-framework v1.13.0/go.mod h1:j64rwMGpgM3NYXTKuxrCnyubQb/4VKldEKlcG8cvmjU= github.com/hashicorp/terraform-plugin-framework-validators v0.15.0 h1:RXMmu7JgpFjnI1a5QjMCBb11usrW2OtAG+iOTIj5c9Y= @@ -261,8 +261,8 @@ github.com/posener/complete v1.2.3 h1:NP0eAhjcjImqslEwo/1hq7gpajME0fTLTezBKDqfXq github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= -github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= -github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= +github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= +github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= github.com/securego/gosec/v2 v2.21.4 h1:Le8MSj0PDmOnHJgUATjD96PaXRvCpKC+DGJvwyy0Mlk= github.com/securego/gosec/v2 v2.21.4/go.mod h1:Jtb/MwRQfRxCXyCm1rfM1BEiiiTfUOdyzzAhlr6lUTA= github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 h1:n661drycOFuPLCN3Uc8sB6B/s6Z4t2xvBgU1htSHuq8= @@ -301,8 +301,8 @@ github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 h1:QldyIu/L63oPpyvQmHgvgickp1Yw510KJOqX7H24mg8= github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778/go.mod h1:2MuV+tbUrU1zIOPMxZ5EncGwgmMJsa+9ucAQZXxsObs= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -github.com/yuin/goldmark v1.7.1 h1:3bajkSilaCbjdKVsKdZjZCLBNPL9pYzrCakKaf4U49U= -github.com/yuin/goldmark v1.7.1/go.mod h1:uzxRWxtg69N339t3louHJ7+O03ezfj6PlliRlaOzY1E= +github.com/yuin/goldmark v1.7.7 h1:5m9rrB1sW3JUMToKFQfb+FGt1U7r57IHu5GrYrG2nqU= +github.com/yuin/goldmark v1.7.7/go.mod h1:uzxRWxtg69N339t3louHJ7+O03ezfj6PlliRlaOzY1E= github.com/yuin/goldmark-meta v1.1.0 h1:pWw+JLHGZe8Rk0EGsMVssiNb/AaPMHfSRszZeUeiOUc= github.com/yuin/goldmark-meta v1.1.0/go.mod h1:U4spWENafuA7Zyg+Lj5RqK/MF+ovMYtBvXi1lBb2VP0= github.com/zclconf/go-cty v1.15.0 h1:tTCRWxsexYUmtt/wVxgDClUe+uQusuI443uL6e+5sXQ= @@ -435,8 +435,8 @@ golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= -golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM= +golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.6.0 h1:eTDhh4ZXt5Qf0augr54TN6suAUudPcawVZeIAPU7D4U= golang.org/x/time v0.6.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= From 77cd07933d8768e880fb938732d94e45303a7303 Mon Sep 17 00:00:00 2001 From: Volodymyr Manilo <35466116+vmanilo@users.noreply.github.com> Date: Mon, 18 Nov 2024 20:32:02 +0100 Subject: [PATCH 13/15] Fix: add lint versioning with docker (#601) --- .github/dependabot.yml | 4 + Makefile | 25 +++---- README.md | 2 +- go.mod | 39 ++-------- go.sum | 160 ++++------------------------------------ golangci.yml | 14 +--- scripts/coveralls.sh | 4 +- tools.go | 2 - tools/golint.Dockerfile | 3 + tools/gosec.Dockerfile | 3 + 10 files changed, 45 insertions(+), 211 deletions(-) create mode 100644 tools/golint.Dockerfile create mode 100644 tools/gosec.Dockerfile diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 83332f89..328d1dc1 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -10,3 +10,7 @@ updates: directory: "/" schedule: interval: "daily" +- package-ecosystem: "docker" + directory: "/tools" + schedule: + interval: "daily" diff --git a/Makefile b/Makefile index 9f302002..aae54d7a 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,8 @@ OS_ARCH=darwin_amd64 GOBINPATH=$(shell go env GOPATH)/bin SWEEP_TENANT=terraformtests SWEEP_FOLDER=./twingate/internal/test/sweepers +GOLINT_VERSION=v1.61.0 +GOSEC_VERSION=2.21.4 check_defined = \ @@ -68,26 +70,21 @@ fmtcheck: @sh -c $(CURDIR)/scripts/gofmtcheck.sh .PHONY: lint -lint: tools +lint: @echo "==> Checking source code against linters..." - @$(GOBINPATH)/golangci-lint run -c golangci.yml ./$(PKG_NAME)/... + docker run -t --rm -v $(PWD):/app -w /app golangci/golangci-lint:$(GOLINT_VERSION) golangci-lint run -c /app/golangci.yml ./$(PKG_NAME)/... + .PHONY: lint-fix -lint-fix: tools +lint-fix: @echo "==> Checking source code against linters with fix enabled..." - @$(GOBINPATH)/golangci-lint run --fix -c golangci.yml ./$(PKG_NAME)/... + docker run -t --rm -v $(PWD):/app -w /app golangci/golangci-lint:$(GOLINT_VERSION) golangci-lint run --fix -c /app/golangci.yml ./$(PKG_NAME)/... .PHONY: sec -sec: tools +sec: @echo "==> Checking source code against security issues..." - go run github.com/securego/gosec/v2/cmd/gosec ./$(PKG_NAME)/... - + docker run -t --rm -e GOFLAGS=-buildvcs=false -v $(PWD):/app -w /app securego/gosec:$(GOSEC_VERSION) gosec ./$(PKG_NAME)/... -.PHONY: doc-tools -docs: doc-tools +.PHONY: docs +docs: go run github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs generate - -.PHONY: tools -tools: - @echo "==> installing required tools ..." - go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest diff --git a/README.md b/README.md index 853e9e8d..54f78cab 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ ## Requirements - Bash -- [Go](https://golang.org/doc/install) 1.22 (to build the provider plugin) +- [Go](https://golang.org/doc/install) 1.23 (to build the provider plugin) - [Terraform](https://www.terraform.io/downloads.html) 1.x ## Build diff --git a/go.mod b/go.mod index 01cf3c6f..48af594b 100644 --- a/go.mod +++ b/go.mod @@ -1,9 +1,8 @@ module github.com/Twingate/terraform-provider-twingate/v3 -go 1.23.2 +go 1.23 require ( - github.com/client9/misspell v0.3.4 github.com/google/go-cmp v0.6.0 github.com/hashicorp/go-retryablehttp v0.7.7 github.com/hashicorp/go-uuid v1.0.3 @@ -17,23 +16,16 @@ require ( github.com/jarcoal/httpmock v1.3.1 github.com/mattn/goveralls v0.0.12 github.com/mitchellh/copystructure v1.2.0 - github.com/securego/gosec/v2 v2.21.4 github.com/stretchr/testify v1.9.0 golang.org/x/sync v0.9.0 gotest.tools/gotestsum v1.12.0 ) require ( - cloud.google.com/go v0.115.1 // indirect - cloud.google.com/go/ai v0.8.0 // indirect - cloud.google.com/go/auth v0.9.4 // indirect - cloud.google.com/go/auth/oauth2adapt v0.2.4 // indirect - cloud.google.com/go/compute/metadata v0.5.1 // indirect - cloud.google.com/go/longrunning v0.5.7 // indirect - github.com/BurntSushi/toml v1.2.1 // indirect + github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c // indirect github.com/Kunde21/markdownfmt/v3 v3.1.0 // indirect github.com/Masterminds/goutils v1.1.1 // indirect - github.com/Masterminds/semver/v3 v3.2.0 // indirect + github.com/Masterminds/semver/v3 v3.3.0 // indirect github.com/Masterminds/sprig/v3 v3.2.3 // indirect github.com/ProtonMail/go-crypto v1.1.0-alpha.2 // indirect github.com/agext/levenshtein v1.2.2 // indirect @@ -42,25 +34,15 @@ require ( github.com/bgentry/speakeasy v0.1.0 // indirect github.com/bitfield/gotestdox v0.2.2 // indirect github.com/bmatcuk/doublestar/v4 v4.7.1 // indirect - github.com/ccojocar/zxcvbn-go v1.0.2 // indirect github.com/cloudflare/circl v1.3.7 // indirect github.com/coder/websocket v1.8.12 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/dnephin/pflag v1.0.7 // indirect - github.com/fatih/color v1.16.0 // indirect - github.com/felixge/httpsnoop v1.0.4 // indirect + github.com/fatih/color v1.17.0 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect - github.com/go-logr/logr v1.4.2 // indirect - github.com/go-logr/stdr v1.2.2 // indirect - github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.4 // indirect - github.com/google/generative-ai-go v0.18.0 // indirect - github.com/google/s2a-go v0.1.8 // indirect github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect github.com/google/uuid v1.6.0 // indirect - github.com/googleapis/enterprise-certificate-proxy v0.3.4 // indirect - github.com/googleapis/gax-go/v2 v2.13.0 // indirect - github.com/gookit/color v1.5.4 // indirect github.com/hashicorp/cli v1.1.6 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-checkpoint v0.5.0 // indirect @@ -82,6 +64,7 @@ require ( github.com/hashicorp/yamux v0.1.1 // indirect github.com/huandu/xstrings v1.3.3 // indirect github.com/imdario/mergo v0.3.15 // indirect + github.com/kr/pretty v0.3.1 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-runewidth v0.0.9 // indirect @@ -97,33 +80,23 @@ require ( github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect - github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 // indirect github.com/yuin/goldmark v1.7.7 // indirect github.com/yuin/goldmark-meta v1.1.0 // indirect github.com/zclconf/go-cty v1.15.0 // indirect go.abhg.dev/goldmark/frontmatter v0.2.0 // indirect - go.opencensus.io v0.24.0 // indirect - go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0 // indirect - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0 // indirect - go.opentelemetry.io/otel v1.29.0 // indirect - go.opentelemetry.io/otel/metric v1.29.0 // indirect - go.opentelemetry.io/otel/trace v1.29.0 // indirect golang.org/x/crypto v0.27.0 // indirect golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 // indirect golang.org/x/mod v0.21.0 // indirect golang.org/x/net v0.29.0 // indirect - golang.org/x/oauth2 v0.23.0 // indirect golang.org/x/sys v0.25.0 // indirect golang.org/x/term v0.24.0 // indirect golang.org/x/text v0.19.0 // indirect - golang.org/x/time v0.6.0 // indirect golang.org/x/tools v0.25.0 // indirect - google.golang.org/api v0.198.0 // indirect google.golang.org/appengine v1.6.8 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect google.golang.org/grpc v1.67.1 // indirect google.golang.org/protobuf v1.35.1 // indirect + gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 53ced412..681b75db 100644 --- a/go.sum +++ b/go.sum @@ -1,27 +1,14 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.115.1 h1:Jo0SM9cQnSkYfp44+v+NQXHpcHqlnRJk2qxh6yvxxxQ= -cloud.google.com/go v0.115.1/go.mod h1:DuujITeaufu3gL68/lOFIirVNJwQeyf5UXyi+Wbgknc= -cloud.google.com/go/ai v0.8.0 h1:rXUEz8Wp2OlrM8r1bfmpF2+VKqc1VJpafE3HgzRnD/w= -cloud.google.com/go/ai v0.8.0/go.mod h1:t3Dfk4cM61sytiggo2UyGsDVW3RF1qGZaUKDrZFyqkE= -cloud.google.com/go/auth v0.9.4 h1:DxF7imbEbiFu9+zdKC6cKBko1e8XeJnipNqIbWZ+kDI= -cloud.google.com/go/auth v0.9.4/go.mod h1:SHia8n6//Ya940F1rLimhJCjjx7KE17t0ctFEci3HkA= -cloud.google.com/go/auth/oauth2adapt v0.2.4 h1:0GWE/FUsXhf6C+jAkWgYm7X9tK8cuEIfy19DBn6B6bY= -cloud.google.com/go/auth/oauth2adapt v0.2.4/go.mod h1:jC/jOpwFP6JBxhB3P5Rr0a9HLMC/Pe3eaL4NmdvqPtc= -cloud.google.com/go/compute/metadata v0.5.1 h1:NM6oZeZNlYjiwYje+sYFjEpP0Q0zCan1bmQW/KmIrGs= -cloud.google.com/go/compute/metadata v0.5.1/go.mod h1:C66sj2AluDcIqakBq/M8lw8/ybHgOZqin2obFxa/E5k= -cloud.google.com/go/longrunning v0.5.7 h1:WLbHekDbjK1fVFD3ibpFFVoyizlLRl73I7YKuAKilhU= -cloud.google.com/go/longrunning v0.5.7/go.mod h1:8GClkudohy1Fxm3owmBGid8W0pSgodEMwEAztp38Xng= dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/toml v1.2.1 h1:9F2/+DoOYIOksmaJFPw1tGFy1eDnIJXg+UHjuD8lTak= -github.com/BurntSushi/toml v1.2.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= +github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c h1:pxW6RcqyfI9/kWtOwnv/G+AzdKuy2ZrqINhenH4HyNs= +github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= github.com/Kunde21/markdownfmt/v3 v3.1.0 h1:KiZu9LKs+wFFBQKhrZJrFZwtLnCCWJahL+S+E/3VnM0= github.com/Kunde21/markdownfmt/v3 v3.1.0/go.mod h1:tPXN1RTyOzJwhfHoon9wUr4HGYmWgVxSQN6VBJDkrVc= github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= -github.com/Masterminds/semver/v3 v3.2.0 h1:3MEsd0SM6jqZojhjLWWeBY+Kcjy9i6MQAeY7YgDP83g= github.com/Masterminds/semver/v3 v3.2.0/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= +github.com/Masterminds/semver/v3 v3.3.0 h1:B8LGeaivUe71a5qox1ICM/JLl0NqZSW5CHyL+hmvYS0= +github.com/Masterminds/semver/v3 v3.3.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM= github.com/Masterminds/sprig/v3 v3.2.3 h1:eL2fZNezLomi0uOLqjQoN6BfsDD+fyLtgbJMAj9n6YA= github.com/Masterminds/sprig/v3 v3.2.3/go.mod h1:rXcFaZ2zZbLRJv/xSysmlgIM1u11eBaRMhvYXJNkGuM= github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= @@ -43,16 +30,11 @@ github.com/bmatcuk/doublestar/v4 v4.7.1 h1:fdDeAqgT47acgwd9bd9HxJRDmc9UAmPpc+2m0 github.com/bmatcuk/doublestar/v4 v4.7.1/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc= github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA= github.com/bufbuild/protocompile v0.4.0/go.mod h1:3v93+mbWn/v3xzN+31nwkJfrEpAUwp+BagBSZWx+TP8= -github.com/ccojocar/zxcvbn-go v1.0.2 h1:na/czXU8RrhXO4EZme6eQJLR4PzcGsahsBOAwU6I3Vg= -github.com/ccojocar/zxcvbn-go v1.0.2/go.mod h1:g1qkXtUSvHP8lhHp5GrSmTz6uWALGRMQdw6Qnz/hi60= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/client9/misspell v0.3.4 h1:ta993UF76GwbvJcIo3Y68y/M3WxlpEHPWIGDkJYwzJI= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU= github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBSc8r4zxgA= -github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/coder/websocket v1.8.12 h1:5bUXkEPPIbewrnkU8LTCLVaxi4N4J8ahufH2vlo4NAo= github.com/coder/websocket v1.8.12/go.mod h1:LNVeNrXQZfe5qhS9ALED3uA+l5pPqvwXg3CKoDBB2gs= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg= github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -62,16 +44,11 @@ github.com/dnephin/pflag v1.0.7 h1:oxONGlWxhmUct0YzKTgrpQv9AUA1wtPBn7zuSjJqptk= github.com/dnephin/pflag v1.0.7/go.mod h1:uxE91IoWURlOiTUIA8Mq5ZZkAv3dPUfZNaT80Zm7OQE= github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ= -github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= -github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= -github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= -github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4= +github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI= github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= github.com/frankban/quicktest v1.14.3/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps= github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= @@ -82,62 +59,25 @@ github.com/go-git/go-billy/v5 v5.5.0 h1:yEY4yhzCDuMGSv83oGxiBotRzhwhNr8VZyphhiu+ github.com/go-git/go-billy/v5 v5.5.0/go.mod h1:hmexnoNsr2SJU1Ju67OaNz5ASJY3+sHgFRpCtpDCKow= github.com/go-git/go-git/v5 v5.12.0 h1:7Md+ndsjrzZxbddRDZjF14qK+NN56sy6wkqaVrjZtys= github.com/go-git/go-git/v5 v5.12.0/go.mod h1:FTM9VKtnI2m65hNI/TenDDDnUf2Q9FHnXYjuz9i5OEY= -github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= -github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= -github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= -github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= -github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= -github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= -github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= -github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= -github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= -github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= -github.com/google/generative-ai-go v0.18.0 h1:6ybg9vOCLcI/UpBBYXOTVgvKmcUKFRNj+2Cj3GnebSo= -github.com/google/generative-ai-go v0.18.0/go.mod h1:JYolL13VG7j79kM5BtHz4qwONHkeJQzOCkKXnpqtS/E= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5 h1:5iH8iuqE5apketRbSFBy+X1V0o+l+8NF1avt4HWl7cA= -github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144= -github.com/google/s2a-go v0.1.8 h1:zZDs9gcbt9ZPLV0ndSyQk6Kacx2g/X+SKYovpnz3SMM= -github.com/google/s2a-go v0.1.8/go.mod h1:6iNWHTpQ+nfNRN5E00MSdfDwVesa8hhS32PhPO8deJA= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/enterprise-certificate-proxy v0.3.4 h1:XYIDZApgAnrN1c855gTgghdIA6Stxb52D5RnLI1SLyw= -github.com/googleapis/enterprise-certificate-proxy v0.3.4/go.mod h1:YKe7cfqYXjKGpGvmSg28/fFvhNzinZQm8DGnaburhGA= -github.com/googleapis/gax-go/v2 v2.13.0 h1:yitjD5f7jQHhyDsnhKEBU52NdvvdSeGzlAnDPT0hH1s= -github.com/googleapis/gax-go/v2 v2.13.0/go.mod h1:Z/fvTZXF8/uw7Xu5GuslPw+bplx6SS338j1Is2S+B7A= -github.com/gookit/color v1.5.4 h1:FZmqs7XOyGgCAxmWyPslpiok1k05wmY3SJTytgvYFs0= -github.com/gookit/color v1.5.4/go.mod h1:pZJOeOS8DM43rXbp4AZo1n9zCU2qjpcRko0b6/QJi9w= github.com/hashicorp/cli v1.1.6 h1:CMOV+/LJfL1tXCOKrgAX0uRKnzjj/mpmqNXloRSy2K8= github.com/hashicorp/cli v1.1.6/go.mod h1:MPon5QYlgjjo0BSoAiN0ESeT5fRzDjVRp+uioJ0piz4= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -212,8 +152,9 @@ github.com/jhump/protoreflect v1.15.1/go.mod h1:jD/2GMKKE6OqX8qTjhADU1e6DShO+gav github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4= github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= -github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -249,22 +190,17 @@ github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zx github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= -github.com/onsi/ginkgo/v2 v2.20.2 h1:7NVCeyIWROIAheY21RLS+3j2bb52W0W82tkberYytp4= -github.com/onsi/ginkgo/v2 v2.20.2/go.mod h1:K9gyxPIlb+aIvnZ8bd9Ak+YP18w3APlR+5coaZoE2ag= -github.com/onsi/gomega v1.34.2 h1:pNCwDkzrsv7MS9kpaQvVb1aVLahQXyJ/Tv5oAZMI3i8= -github.com/onsi/gomega v1.34.2/go.mod h1:v1xfxRgk0KIsG+QOdm7p8UosrOzPYRo60fd3B/1Dukc= github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4= github.com/pjbgf/sha1cd v0.3.0/go.mod h1:nZ1rrWOcGJ5uZgEEVL1VUM9iRQiZvWdbZjkKyFzPPsI= +github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.2.3 h1:NP0eAhjcjImqslEwo/1hq7gpajME0fTLTezBKDqfXqo= github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= -github.com/securego/gosec/v2 v2.21.4 h1:Le8MSj0PDmOnHJgUATjD96PaXRvCpKC+DGJvwyy0Mlk= -github.com/securego/gosec/v2 v2.21.4/go.mod h1:Jtb/MwRQfRxCXyCm1rfM1BEiiiTfUOdyzzAhlr6lUTA= github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 h1:n661drycOFuPLCN3Uc8sB6B/s6Z4t2xvBgU1htSHuq8= github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4= github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= @@ -276,17 +212,10 @@ github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkU github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= -github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= -github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= -github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= @@ -298,8 +227,6 @@ github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAh github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM= github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw= -github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 h1:QldyIu/L63oPpyvQmHgvgickp1Yw510KJOqX7H24mg8= -github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778/go.mod h1:2MuV+tbUrU1zIOPMxZ5EncGwgmMJsa+9ucAQZXxsObs= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/yuin/goldmark v1.7.7 h1:5m9rrB1sW3JUMToKFQfb+FGt1U7r57IHu5GrYrG2nqU= github.com/yuin/goldmark v1.7.7/go.mod h1:uzxRWxtg69N339t3louHJ7+O03ezfj6PlliRlaOzY1E= @@ -311,20 +238,7 @@ github.com/zclconf/go-cty-debug v0.0.0-20240509010212-0d6042c53940 h1:4r45xpDWB6 github.com/zclconf/go-cty-debug v0.0.0-20240509010212-0d6042c53940/go.mod h1:CmBdvvj3nqzfzJ6nTCIwDTPZ56aVGvDrmztiO5g3qrM= go.abhg.dev/goldmark/frontmatter v0.2.0 h1:P8kPG0YkL12+aYk2yU3xHv4tcXzeVnN+gU0tJ5JnxRw= go.abhg.dev/goldmark/frontmatter v0.2.0/go.mod h1:XqrEkZuM57djk7zrlRUB02x8I5J0px76YjkOzhB4YlU= -go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= -go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0 h1:r6I7RJCN86bpD/FQwedZ0vSixDpwuWREjW9oRMsmqDc= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0/go.mod h1:B9yO6b04uB80CzjedvewuqDhxJxi11s7/GtiGa8bAjI= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0 h1:TT4fX+nBOA/+LUkobKGW1ydGcn+G3vRw9+g5HwCphpk= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0/go.mod h1:L7UH0GbB0p47T4Rri3uHjbpCFYrVrwc1I25QhNPiGK8= -go.opentelemetry.io/otel v1.29.0 h1:PdomN/Al4q/lN6iBJEN3AwPvUiHPMlt93c8bqTG5Llw= -go.opentelemetry.io/otel v1.29.0/go.mod h1:N/WtXPs1CNCUEx+Agz5uouwCba+i+bJGFicT8SR4NP8= -go.opentelemetry.io/otel/metric v1.29.0 h1:vPf/HFWTNkPu1aYeIsc98l4ktOQaL6LeSoeV2g+8YLc= -go.opentelemetry.io/otel/metric v1.29.0/go.mod h1:auu/QWieFVWx+DmQOUMgj0F8LHWdgalxXqvp7BII/W8= -go.opentelemetry.io/otel/trace v1.29.0 h1:J/8ZNK4XgR7a21DZUAsbF8pZ5Jcw1VhACmnYt39JTi4= -go.opentelemetry.io/otel/trace v1.29.0/go.mod h1:eHl3w0sp3paPkYstJOmAimxhiFXPg+MMTlEh3nsQgWQ= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= @@ -334,12 +248,8 @@ golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDf golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= golang.org/x/crypto v0.27.0 h1:GXm2NjJrPaiv/h1tb2UH8QfgC/hOf/+z0p6PT8o1w7A= golang.org/x/crypto v0.27.0/go.mod h1:1Xngt8kV6Dvbssa53Ziq6Eqn0HqbZi5Z6R0ZpwQzt70= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 h1:e66Fs6Z+fZTbFBAxKfP3PALWBtpfqks2bwGcexMxgtk= golang.org/x/exp v0.0.0-20240909161429-701f63a606c0/go.mod h1:2TbTHSBQa924w8M6Xs1QcRcFwyucIwBGpK1p2f1YFFY= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= @@ -350,13 +260,8 @@ golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/mod v0.16.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/mod v0.21.0 h1:vvrHzRwRfVKSiLrG+d4FMl/Qi4ukBCE6kZlTUkDYRT0= golang.org/x/mod v0.21.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= @@ -370,11 +275,7 @@ golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo= golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.23.0 h1:PbgcYx2W7i4LvjJWEbf0ngHV6qJYr86PkAV3bXdLEbs= -golang.org/x/oauth2 v0.23.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -382,12 +283,9 @@ golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ= golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -437,13 +335,7 @@ golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM= golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= -golang.org/x/time v0.6.0 h1:eTDhh4ZXt5Qf0augr54TN6suAUudPcawVZeIAPU7D4U= -golang.org/x/time v0.6.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA= @@ -456,54 +348,30 @@ golang.org/x/tools v0.25.0 h1:oFU9pkj/iJgs+0DT+VMHrx+oBKs/LJMV+Uvg78sl+fE= golang.org/x/tools v0.25.0/go.mod h1:/vtpO8WL1N9cQC3FN5zPqb//fRXskFHbLKk4OW1Q7rg= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/api v0.198.0 h1:OOH5fZatk57iN0A7tjJQzt6aPfYQ1JiWkt1yGseazks= -google.golang.org/api v0.198.0/go.mod h1:/Lblzl3/Xqqk9hw/yS97TImKTUwnf1bv89v7+OagJzc= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142 h1:wKguEg1hsxI2/L3hUYrpo1RVi48K+uTyzKqprwLXsb8= -google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142/go.mod h1:d6be+8HhtEtucleCbxpPW9PA9XwISACu8nvpPqF0BVo= google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 h1:pPJltXNxVzT4pK9yD8vR9X75DaWYYmLGMsEvBfFQZzQ= google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/grpc v1.67.1 h1:zWnc1Vrcno+lHZCOofnIMvycFcc0QRGIzm9dhnDX68E= google.golang.org/grpc v1.67.1/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA= -google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= -google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= -google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= -google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= -google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.35.1 h1:m3LfL6/Ca+fqnjnlqQXNpFPABW1UD7mjh8KO2mKFytA= google.golang.org/protobuf v1.35.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools/gotestsum v1.12.0 h1:CmwtaGDkHxrZm4Ib0Vob89MTfpc3GrEFMJKovliPwGk= gotest.tools/gotestsum v1.12.0/go.mod h1:fAvqkSptospfSbQw26CTYzNwnsE/ztqLeyhP0h67ARY= gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU= gotest.tools/v3 v3.5.1/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/golangci.yml b/golangci.yml index 68204fbd..6dd0eee8 100644 --- a/golangci.yml +++ b/golangci.yml @@ -8,7 +8,7 @@ run: skip-files: [] output: - format: colored-line-number + formats: colored-line-number print-issued-lines: true print-linter-name: true @@ -30,7 +30,7 @@ linters-settings: check-type-assertions: false check-blank: false govet: - check-shadowing: true + shadow: true use-installed-packages: false gofmt: simplify: true @@ -64,20 +64,10 @@ linters-settings: linters: enable-all: true disable: - - deadcode - - exhaustivestruct - exhaustruct - forcetypeassert - gofumpt - - golint - - ifshort - - interfacer - lll - - maligned - - nosnakecase - - scopelint - - structcheck - - varcheck - revive - gomoddirectives disable-all: false diff --git a/scripts/coveralls.sh b/scripts/coveralls.sh index 31d2e5b4..699cb7c8 100755 --- a/scripts/coveralls.sh +++ b/scripts/coveralls.sh @@ -5,6 +5,4 @@ set -o nounset TEST_RESULTS=${TEST_RESULTS:-"./test_results"} -go install github.com/mattn/goveralls@latest - -${GOPATH}/bin/goveralls -coverprofile="${TEST_RESULTS}"/coverage.out -service=circleci -repotoken "${COVERALLS_TOKEN}" \ No newline at end of file +go run github.com/mattn/goveralls -coverprofile="${TEST_RESULTS}"/coverage.out -service=circleci -repotoken "${COVERALLS_TOKEN}" \ No newline at end of file diff --git a/tools.go b/tools.go index 30a3bcb2..227b992f 100644 --- a/tools.go +++ b/tools.go @@ -4,9 +4,7 @@ package tools import ( - _ "github.com/client9/misspell/cmd/misspell" _ "github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs" _ "github.com/mattn/goveralls" - _ "github.com/securego/gosec/v2/cmd/gosec" _ "gotest.tools/gotestsum" ) diff --git a/tools/golint.Dockerfile b/tools/golint.Dockerfile new file mode 100644 index 00000000..0c512860 --- /dev/null +++ b/tools/golint.Dockerfile @@ -0,0 +1,3 @@ +FROM golangci/golangci-lint:v1.61.0 + +# Please also update GOLINT_VERSION in Makefile \ No newline at end of file diff --git a/tools/gosec.Dockerfile b/tools/gosec.Dockerfile new file mode 100644 index 00000000..d4c9ee94 --- /dev/null +++ b/tools/gosec.Dockerfile @@ -0,0 +1,3 @@ +FROM securego/gosec:2.21.4 + +# Please also update GOSEC_VERSION in Makefile \ No newline at end of file From 49ffbcf5f5012ab4af3438238f02e671a3dcdfa9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 20 Nov 2024 13:48:33 +0000 Subject: [PATCH 14/15] Bump github.com/hashicorp/terraform-plugin-testing from 1.10.0 to 1.11.0 (#46) Bumps [github.com/hashicorp/terraform-plugin-testing](https://github.com/hashicorp/terraform-plugin-testing) from 1.10.0 to 1.11.0. - [Release notes](https://github.com/hashicorp/terraform-plugin-testing/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-testing/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-testing/compare/v1.10.0...v1.11.0) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-testing dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 16 ++++++++-------- go.sum | 32 ++++++++++++++++---------------- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/go.mod b/go.mod index 6ccfcc5e..072f1641 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/hashicorp/terraform-plugin-framework v1.13.0 github.com/hashicorp/terraform-plugin-framework-validators v0.15.0 github.com/hashicorp/terraform-plugin-go v0.25.0 - github.com/hashicorp/terraform-plugin-testing v1.10.0 + github.com/hashicorp/terraform-plugin-testing v1.11.0 github.com/hasura/go-graphql-client v0.13.1 github.com/iancoleman/strcase v0.3.0 github.com/jarcoal/httpmock v1.3.1 @@ -19,7 +19,7 @@ require ( github.com/mitchellh/copystructure v1.2.0 github.com/securego/gosec/v2 v2.21.4 github.com/stretchr/testify v1.9.0 - golang.org/x/sync v0.8.0 + golang.org/x/sync v0.9.0 gotest.tools/gotestsum v1.12.0 ) @@ -71,12 +71,12 @@ require ( github.com/hashicorp/go-plugin v1.6.2 // indirect github.com/hashicorp/go-version v1.7.0 // indirect github.com/hashicorp/hc-install v0.9.0 // indirect - github.com/hashicorp/hcl/v2 v2.21.0 // indirect + github.com/hashicorp/hcl/v2 v2.23.0 // indirect github.com/hashicorp/logutils v1.0.0 // indirect github.com/hashicorp/terraform-exec v0.21.0 // indirect github.com/hashicorp/terraform-json v0.23.0 // indirect github.com/hashicorp/terraform-plugin-log v0.9.0 // indirect - github.com/hashicorp/terraform-plugin-sdk/v2 v2.34.0 // indirect + github.com/hashicorp/terraform-plugin-sdk/v2 v2.35.0 // indirect github.com/hashicorp/terraform-registry-address v0.2.3 // indirect github.com/hashicorp/terraform-svchost v0.1.1 // indirect github.com/hashicorp/yamux v0.1.1 // indirect @@ -108,14 +108,14 @@ require ( go.opentelemetry.io/otel v1.29.0 // indirect go.opentelemetry.io/otel/metric v1.29.0 // indirect go.opentelemetry.io/otel/trace v1.29.0 // indirect - golang.org/x/crypto v0.27.0 // indirect + golang.org/x/crypto v0.29.0 // indirect golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 // indirect golang.org/x/mod v0.21.0 // indirect golang.org/x/net v0.29.0 // indirect golang.org/x/oauth2 v0.23.0 // indirect - golang.org/x/sys v0.25.0 // indirect - golang.org/x/term v0.24.0 // indirect - golang.org/x/text v0.19.0 // indirect + golang.org/x/sys v0.27.0 // indirect + golang.org/x/term v0.26.0 // indirect + golang.org/x/text v0.20.0 // indirect golang.org/x/time v0.6.0 // indirect golang.org/x/tools v0.25.0 // indirect google.golang.org/api v0.198.0 // indirect diff --git a/go.sum b/go.sum index 0727c76d..3c36c77c 100644 --- a/go.sum +++ b/go.sum @@ -166,8 +166,8 @@ github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKe github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/hc-install v0.9.0 h1:2dIk8LcvANwtv3QZLckxcjyF5w8KVtiMxu6G6eLhghE= github.com/hashicorp/hc-install v0.9.0/go.mod h1:+6vOP+mf3tuGgMApVYtmsnDoKWMDcFXeTxCACYZ8SFg= -github.com/hashicorp/hcl/v2 v2.21.0 h1:lve4q/o/2rqwYOgUg3y3V2YPyD1/zkCLGjIV74Jit14= -github.com/hashicorp/hcl/v2 v2.21.0/go.mod h1:62ZYHrXgPoX8xBnzl8QzbWq4dyDsDtfCRgIq1rbJEvA= +github.com/hashicorp/hcl/v2 v2.23.0 h1:Fphj1/gCylPxHutVSEOf2fBOh1VE4AuLV7+kbJf3qos= +github.com/hashicorp/hcl/v2 v2.23.0/go.mod h1:62ZYHrXgPoX8xBnzl8QzbWq4dyDsDtfCRgIq1rbJEvA= github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI65Y= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/terraform-exec v0.21.0 h1:uNkLAe95ey5Uux6KJdua6+cv8asgILFVWkd/RG0D2XQ= @@ -184,10 +184,10 @@ github.com/hashicorp/terraform-plugin-go v0.25.0 h1:oi13cx7xXA6QciMcpcFi/rwA974r github.com/hashicorp/terraform-plugin-go v0.25.0/go.mod h1:+SYagMYadJP86Kvn+TGeV+ofr/R3g4/If0O5sO96MVw= github.com/hashicorp/terraform-plugin-log v0.9.0 h1:i7hOA+vdAItN1/7UrfBqBwvYPQ9TFvymaRGZED3FCV0= github.com/hashicorp/terraform-plugin-log v0.9.0/go.mod h1:rKL8egZQ/eXSyDqzLUuwUYLVdlYeamldAHSxjUFADow= -github.com/hashicorp/terraform-plugin-sdk/v2 v2.34.0 h1:kJiWGx2kiQVo97Y5IOGR4EMcZ8DtMswHhUuFibsCQQE= -github.com/hashicorp/terraform-plugin-sdk/v2 v2.34.0/go.mod h1:sl/UoabMc37HA6ICVMmGO+/0wofkVIRxf+BMb/dnoIg= -github.com/hashicorp/terraform-plugin-testing v1.10.0 h1:2+tmRNhvnfE4Bs8rB6v58S/VpqzGC6RCh9Y8ujdn+aw= -github.com/hashicorp/terraform-plugin-testing v1.10.0/go.mod h1:iWRW3+loP33WMch2P/TEyCxxct/ZEcCGMquSLSCVsrc= +github.com/hashicorp/terraform-plugin-sdk/v2 v2.35.0 h1:wyKCCtn6pBBL46c1uIIBNUOWlNfYXfXpVo16iDyLp8Y= +github.com/hashicorp/terraform-plugin-sdk/v2 v2.35.0/go.mod h1:B0Al8NyYVr8Mp/KLwssKXG1RqnTk7FySqSn4fRuLNgw= +github.com/hashicorp/terraform-plugin-testing v1.11.0 h1:MeDT5W3YHbONJt2aPQyaBsgQeAIckwPX41EUHXEn29A= +github.com/hashicorp/terraform-plugin-testing v1.11.0/go.mod h1:WNAHQ3DcgV/0J+B15WTE6hDvxcUdkPPpnB1FR3M910U= github.com/hashicorp/terraform-registry-address v0.2.3 h1:2TAiKJ1A3MAkZlH1YI/aTVcLZRu7JseiXNRHbOAyoTI= github.com/hashicorp/terraform-registry-address v0.2.3/go.mod h1:lFHA76T8jfQteVfT7caREqguFrW3c4MFSPhZB7HHgUM= github.com/hashicorp/terraform-svchost v0.1.1 h1:EZZimZ1GxdqFRinZ1tpJwVxxt49xc/S52uzrw4x0jKQ= @@ -332,8 +332,8 @@ golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIi golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= -golang.org/x/crypto v0.27.0 h1:GXm2NjJrPaiv/h1tb2UH8QfgC/hOf/+z0p6PT8o1w7A= -golang.org/x/crypto v0.27.0/go.mod h1:1Xngt8kV6Dvbssa53Ziq6Eqn0HqbZi5Z6R0ZpwQzt70= +golang.org/x/crypto v0.29.0 h1:L5SG1JTTXupVV3n6sUqMTeWbjAyfPwoda2DLX8J8FrQ= +golang.org/x/crypto v0.29.0/go.mod h1:+F4F4N5hv6v38hfeYwTdx20oUvLLc+QfrE9Ax9HtgRg= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 h1:e66Fs6Z+fZTbFBAxKfP3PALWBtpfqks2bwGcexMxgtk= golang.org/x/exp v0.0.0-20240909161429-701f63a606c0/go.mod h1:2TbTHSBQa924w8M6Xs1QcRcFwyucIwBGpK1p2f1YFFY= @@ -380,8 +380,8 @@ golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= -golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ= +golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -408,8 +408,8 @@ golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= -golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= +golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -422,8 +422,8 @@ golang.org/x/term v0.10.0/go.mod h1:lpqdcUyK/oCiQxvxVrppt5ggO2KCZ5QblwqPnfZ6d5o= golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= -golang.org/x/term v0.24.0 h1:Mh5cbb+Zk2hqqXNO7S1iTjEphVL+jb8ZWaqh/g+JWkM= -golang.org/x/term v0.24.0/go.mod h1:lOBK/LVxemqiMij05LGJ0tzNr8xlmwBRJ81PX6wVLH8= +golang.org/x/term v0.26.0 h1:WEQa6V3Gja/BhNxg540hBip/kkaYtRg3cxg4oXSw4AU= +golang.org/x/term v0.26.0/go.mod h1:Si5m1o57C5nBNQo5z1iq+XDijt21BDBDp2bK0QI8e3E= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -435,8 +435,8 @@ golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM= -golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= +golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= golang.org/x/time v0.6.0 h1:eTDhh4ZXt5Qf0augr54TN6suAUudPcawVZeIAPU7D4U= golang.org/x/time v0.6.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= From 98287a2c1cb0b460c64b6d10b850b89657f70c19 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 23 Nov 2024 05:29:48 +0000 Subject: [PATCH 15/15] Bump golangci/golangci-lint from v1.61.0 to v1.62.0 in /tools (#47) Bumps golangci/golangci-lint from v1.61.0 to v1.62.0. --- updated-dependencies: - dependency-name: golangci/golangci-lint dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- tools/golint.Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/golint.Dockerfile b/tools/golint.Dockerfile index 0c512860..f3818e17 100644 --- a/tools/golint.Dockerfile +++ b/tools/golint.Dockerfile @@ -1,3 +1,3 @@ -FROM golangci/golangci-lint:v1.61.0 +FROM golangci/golangci-lint:v1.62.0 # Please also update GOLINT_VERSION in Makefile \ No newline at end of file