fix: fix tests and lintings
This commit is contained in:
parent
2aee47aa76
commit
6e1817c425
18 changed files with 61 additions and 37 deletions
|
|
@ -40,6 +40,7 @@ func Test_handleDSEncryption(t *testing.T) {
|
|||
}
|
||||
|
||||
func Test_handleEncryption(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
type args struct {
|
||||
m *sqlserverflexbetaRs.InstanceModel
|
||||
resp *sqlserverflexbetaPkgGen.GetInstanceResponse
|
||||
|
|
@ -80,19 +81,23 @@ func Test_handleEncryption(t *testing.T) {
|
|||
},
|
||||
},
|
||||
},
|
||||
want: sqlserverflexbetaRs.EncryptionValue{
|
||||
KekKeyId: types.StringValue("kek_key_id"),
|
||||
KekKeyRingId: types.StringValue("kek_key_ring_id"),
|
||||
KekKeyVersion: types.StringValue("kek_key_version"),
|
||||
ServiceAccount: types.StringValue("kek_svc_acc"),
|
||||
},
|
||||
want: sqlserverflexbetaRs.NewEncryptionValueMust(
|
||||
sqlserverflexbetaRs.EncryptionValue{}.AttributeTypes(ctx),
|
||||
map[string]attr.Value{
|
||||
"kek_key_id": types.StringValue("kek_key_id"),
|
||||
"kek_key_ring_id": types.StringValue("kek_key_ring_id"),
|
||||
"kek_key_version": types.StringValue("kek_key_version"),
|
||||
"service_account": types.StringValue("kek_svc_acc"),
|
||||
},
|
||||
),
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(
|
||||
tt.name, func(t *testing.T) {
|
||||
if got := handleEncryption(t.Context(), tt.args.m, tt.args.resp); !reflect.DeepEqual(got, tt.want) {
|
||||
t.Errorf("handleEncryption() = %v, want %v", got, tt.want)
|
||||
got := handleEncryption(t.Context(), tt.args.m, tt.args.resp)
|
||||
if diff := cmp.Diff(tt.want, got); diff != "" {
|
||||
t.Errorf("string mismatch (-want +got):\n%s", diff)
|
||||
}
|
||||
},
|
||||
)
|
||||
|
|
|
|||
|
|
@ -473,7 +473,9 @@ func (r *instanceResource) Delete(ctx context.Context, req resource.DeleteReques
|
|||
|
||||
ctx = core.LogResponse(ctx)
|
||||
|
||||
delResp, err := wait.DeleteInstanceWaitHandler(ctx, r.client, projectId, instanceId, region).WaitWithContext(ctx)
|
||||
delResp, err := wait.DeleteInstanceWaitHandler(ctx, r.client, projectId, instanceId, region).
|
||||
SetTimeout(30 * time.Minute).
|
||||
WaitWithContext(ctx)
|
||||
if err != nil {
|
||||
core.LogAndAddError(
|
||||
ctx,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue