Skip to content

Commit afcbabf

Browse files
committed
Tweaks and lint
1 parent 0664cce commit afcbabf

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

internal/service/ec2/stop_instance_action.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ type stopInstanceModel struct {
4646
}
4747

4848
func (a *stopInstanceAction) Schema(ctx context.Context, req action.SchemaRequest, resp *action.SchemaResponse) {
49-
5049
resp.Schema = schema.UnlinkedSchema{
5150
Description: "Stops an EC2 instance. This action will gracefully stop the instance and wait for it to reach the stopped state.",
5251
Attributes: map[string]schema.Attribute{

internal/service/ec2/stop_instance_action_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func TestAccEC2StopInstanceAction_force(t *testing.T) {
4848
}
4949

5050
// Invoke the action programmatically with force=true
51-
if err := invokeStopInstanceAction(t, ctx, *v.InstanceId, true); err != nil {
51+
if err := invokeStopInstanceAction(ctx, t, *v.InstanceId, true); err != nil {
5252
t.Fatalf("Failed to invoke stop instance action: %v", err)
5353
}
5454
},
@@ -138,7 +138,7 @@ action "aws_ec2_stop_instance" "test" {
138138
}
139139

140140
// Step 1: Get the AWS provider as a ProviderServerWithActions
141-
func providerWithActions(t *testing.T, ctx context.Context) tfprotov5.ProviderServerWithActions {
141+
func providerWithActions(ctx context.Context, t *testing.T) tfprotov5.ProviderServerWithActions {
142142
t.Helper()
143143

144144
// Use the existing configured provider factories that handle muxing
@@ -157,7 +157,7 @@ func providerWithActions(t *testing.T, ctx context.Context) tfprotov5.ProviderSe
157157
}
158158

159159
// Cast to ProviderServerWithActions
160-
providerWithActions, ok := providerServer.(tfprotov5.ProviderServerWithActions)
160+
providerWithActions, ok := providerServer.(tfprotov5.ProviderServerWithActions) //nolint:staticcheck // SA1019: Working in alpha situation
161161
if !ok {
162162
t.Fatal("Provider does not implement ProviderServerWithActions")
163163
}
@@ -256,11 +256,11 @@ func buildStopInstanceActionConfig(instanceID string, force bool) (tftypes.Type,
256256
}
257257

258258
// Step 3: Programmatic action invocation
259-
func invokeStopInstanceAction(t *testing.T, ctx context.Context, instanceID string, force bool) error {
259+
func invokeStopInstanceAction(ctx context.Context, t *testing.T, instanceID string, force bool) error {
260260
t.Helper()
261261

262262
// Get the provider
263-
awsProvider := providerWithActions(t, ctx)
263+
p := providerWithActions(ctx, t)
264264

265265
// Build configuration
266266
configType, configMap := buildStopInstanceActionConfig(instanceID, force)
@@ -277,7 +277,7 @@ func invokeStopInstanceAction(t *testing.T, ctx context.Context, instanceID stri
277277
}
278278

279279
// Step 3: Invoke the action directly (provider should already be configured)
280-
invokeResp, err := awsProvider.InvokeAction(ctx, &tfprotov5.InvokeActionRequest{
280+
invokeResp, err := p.InvokeAction(ctx, &tfprotov5.InvokeActionRequest{
281281
ActionType: actionTypeName,
282282
Config: &testConfig,
283283
})

0 commit comments

Comments
 (0)