From f39c3458f71b98101903e932720a9a0e2c9d24b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=84=8B=E1=85=B2=E1=84=89=E1=85=A5=E1=86=BC=E1=84=83?= =?UTF-8?q?=E1=85=A5=E1=86=A8?= Date: Tue, 30 Jan 2018 10:20:02 +0900 Subject: [PATCH] fix Run method arguments for testing --- builder/ncloud/step_create_block_storage_instance_test.go | 5 +++-- builder/ncloud/step_create_login_key_test.go | 5 +++-- builder/ncloud/step_create_public_ip_instance_test.go | 5 +++-- builder/ncloud/step_create_server_image_test.go | 5 +++-- builder/ncloud/step_create_server_instance_test.go | 5 +++-- builder/ncloud/step_delete_block_storage_instance_test.go | 5 +++-- builder/ncloud/step_get_rootpassword_test.go | 5 +++-- builder/ncloud/step_stop_server_instance_test.go | 5 +++-- builder/ncloud/step_terminate_server_instance_test.go | 5 +++-- builder/ncloud/step_validate_template_test.go | 5 +++-- 10 files changed, 30 insertions(+), 20 deletions(-) diff --git a/builder/ncloud/step_create_block_storage_instance_test.go b/builder/ncloud/step_create_block_storage_instance_test.go index feae195d1..6f4a9e4e2 100644 --- a/builder/ncloud/step_create_block_storage_instance_test.go +++ b/builder/ncloud/step_create_block_storage_instance_test.go @@ -1,6 +1,7 @@ package ncloud import ( + "context" "fmt" "testing" @@ -20,7 +21,7 @@ func TestStepCreateBlockStorageInstanceShouldFailIfOperationCreateBlockStorageIn stateBag := createTestStateBagStepCreateBlockStorageInstance() - var result = testSubject.Run(stateBag) + var result = testSubject.Run(context.Background(), stateBag) if result != multistep.ActionHalt { t.Fatalf("Expected the step to return 'ActionHalt', but got '%d'.", result) @@ -43,7 +44,7 @@ func TestStepCreateBlockStorageInstanceShouldPassIfOperationCreateBlockStorageIn stateBag := createTestStateBagStepCreateBlockStorageInstance() - var result = testSubject.Run(stateBag) + var result = testSubject.Run(context.Background(), stateBag) if result != multistep.ActionContinue { t.Fatalf("Expected the step to return 'ActionContinue', but got '%d'.", result) diff --git a/builder/ncloud/step_create_login_key_test.go b/builder/ncloud/step_create_login_key_test.go index 6f0d7af8f..3583f47a5 100644 --- a/builder/ncloud/step_create_login_key_test.go +++ b/builder/ncloud/step_create_login_key_test.go @@ -1,6 +1,7 @@ package ncloud import ( + "context" "fmt" "testing" @@ -16,7 +17,7 @@ func TestStepCreateLoginKeyShouldFailIfOperationCreateLoginKeyFails(t *testing.T stateBag := createTestStateBagStepCreateLoginKey() - var result = testSubject.Run(stateBag) + var result = testSubject.Run(context.Background(), stateBag) if result != multistep.ActionHalt { t.Fatalf("Expected the step to return 'ActionHalt', but got '%d'.", result) @@ -36,7 +37,7 @@ func TestStepCreateLoginKeyShouldPassIfOperationCreateLoginKeyPasses(t *testing. stateBag := createTestStateBagStepCreateLoginKey() - var result = testSubject.Run(stateBag) + var result = testSubject.Run(context.Background(), stateBag) if result != multistep.ActionContinue { t.Fatalf("Expected the step to return 'ActionContinue', but got '%d'.", result) diff --git a/builder/ncloud/step_create_public_ip_instance_test.go b/builder/ncloud/step_create_public_ip_instance_test.go index 7269e3af5..e28a19d48 100644 --- a/builder/ncloud/step_create_public_ip_instance_test.go +++ b/builder/ncloud/step_create_public_ip_instance_test.go @@ -1,6 +1,7 @@ package ncloud import ( + "context" "fmt" "testing" @@ -20,7 +21,7 @@ func TestStepCreatePublicIPInstanceShouldFailIfOperationCreatePublicIPInstanceFa stateBag := createTestStateBagStepCreateServerImage() - var result = testSubject.Run(stateBag) + var result = testSubject.Run(context.Background(), stateBag) if result != multistep.ActionHalt { t.Fatalf("Expected the step to return 'ActionHalt', but got '%d'.", result) @@ -47,7 +48,7 @@ func TestStepCreatePublicIPInstanceShouldPassIfOperationCreatePublicIPInstancePa stateBag := createTestStateBagStepCreatePublicIPInstance() - var result = testSubject.Run(stateBag) + var result = testSubject.Run(context.Background(), stateBag) if result != multistep.ActionContinue { t.Fatalf("Expected the step to return 'ActionContinue', but got '%d'.", result) diff --git a/builder/ncloud/step_create_server_image_test.go b/builder/ncloud/step_create_server_image_test.go index fa7745135..49915ced2 100644 --- a/builder/ncloud/step_create_server_image_test.go +++ b/builder/ncloud/step_create_server_image_test.go @@ -1,6 +1,7 @@ package ncloud import ( + "context" "fmt" "testing" @@ -20,7 +21,7 @@ func TestStepCreateServerImageShouldFailIfOperationCreateServerImageFails(t *tes stateBag := createTestStateBagStepCreateServerImage() - var result = testSubject.Run(stateBag) + var result = testSubject.Run(context.Background(), stateBag) if result != multistep.ActionHalt { t.Fatalf("Expected the step to return 'ActionHalt', but got '%d'.", result) @@ -39,7 +40,7 @@ func TestStepCreateServerImageShouldPassIfOperationCreateServerImagePasses(t *te stateBag := createTestStateBagStepCreateServerImage() - var result = testSubject.Run(stateBag) + var result = testSubject.Run(context.Background(), stateBag) if result != multistep.ActionContinue { t.Fatalf("Expected the step to return 'ActionContinue', but got '%d'.", result) diff --git a/builder/ncloud/step_create_server_instance_test.go b/builder/ncloud/step_create_server_instance_test.go index db337c41b..676c3fa3f 100644 --- a/builder/ncloud/step_create_server_instance_test.go +++ b/builder/ncloud/step_create_server_instance_test.go @@ -1,6 +1,7 @@ package ncloud import ( + "context" "fmt" "testing" @@ -18,7 +19,7 @@ func TestStepCreateServerInstanceShouldFailIfOperationCreateFails(t *testing.T) stateBag := createTestStateBagStepCreateServerInstance() - var result = testSubject.Run(stateBag) + var result = testSubject.Run(context.Background(), stateBag) if result != multistep.ActionHalt { t.Fatalf("Expected the step to return 'ActionHalt', but got '%d'.", result) @@ -38,7 +39,7 @@ func TestStepCreateServerInstanceShouldPassIfOperationCreatePasses(t *testing.T) stateBag := createTestStateBagStepCreateServerInstance() - var result = testSubject.Run(stateBag) + var result = testSubject.Run(context.Background(), stateBag) if result != multistep.ActionContinue { t.Fatalf("Expected the step to return 'ActionContinue', but got '%d'.", result) diff --git a/builder/ncloud/step_delete_block_storage_instance_test.go b/builder/ncloud/step_delete_block_storage_instance_test.go index c5fc4566e..024ed332e 100644 --- a/builder/ncloud/step_delete_block_storage_instance_test.go +++ b/builder/ncloud/step_delete_block_storage_instance_test.go @@ -1,6 +1,7 @@ package ncloud import ( + "context" "fmt" "testing" @@ -17,7 +18,7 @@ func TestStepDeleteBlockStorageInstanceShouldFailIfOperationDeleteBlockStorageIn stateBag := createTestStateBagStepDeleteBlockStorageInstance() - var result = testSubject.Run(stateBag) + var result = testSubject.Run(context.Background(), stateBag) if result != multistep.ActionHalt { t.Fatalf("Expected the step to return 'ActionHalt', but got '%d'.", result) @@ -38,7 +39,7 @@ func TestStepDeleteBlockStorageInstanceShouldPassIfOperationDeleteBlockStorageIn stateBag := createTestStateBagStepDeleteBlockStorageInstance() - var result = testSubject.Run(stateBag) + var result = testSubject.Run(context.Background(), stateBag) if result != multistep.ActionContinue { t.Fatalf("Expected the step to return 'ActionContinue', but got '%d'.", result) diff --git a/builder/ncloud/step_get_rootpassword_test.go b/builder/ncloud/step_get_rootpassword_test.go index 1717b5753..0c93229bd 100644 --- a/builder/ncloud/step_get_rootpassword_test.go +++ b/builder/ncloud/step_get_rootpassword_test.go @@ -1,6 +1,7 @@ package ncloud import ( + "context" "fmt" "testing" @@ -16,7 +17,7 @@ func TestStepGetRootPasswordShouldFailIfOperationGetRootPasswordFails(t *testing stateBag := DeleteTestStateBagStepGetRootPassword() - var result = testSubject.Run(stateBag) + var result = testSubject.Run(context.Background(), stateBag) if result != multistep.ActionHalt { t.Fatalf("Expected the step to return 'ActionHalt', but got '%d'.", result) @@ -36,7 +37,7 @@ func TestStepGetRootPasswordShouldPassIfOperationGetRootPasswordPasses(t *testin stateBag := DeleteTestStateBagStepGetRootPassword() - var result = testSubject.Run(stateBag) + var result = testSubject.Run(context.Background(), stateBag) if result != multistep.ActionContinue { t.Fatalf("Expected the step to return 'ActionContinue', but got '%d'.", result) diff --git a/builder/ncloud/step_stop_server_instance_test.go b/builder/ncloud/step_stop_server_instance_test.go index 04c39d313..4b5afe605 100644 --- a/builder/ncloud/step_stop_server_instance_test.go +++ b/builder/ncloud/step_stop_server_instance_test.go @@ -1,6 +1,7 @@ package ncloud import ( + "context" "fmt" "testing" @@ -16,7 +17,7 @@ func TestStepStopServerInstanceShouldFailIfOperationStopFails(t *testing.T) { stateBag := createTestStateBagStepStopServerInstance() - var result = testSubject.Run(stateBag) + var result = testSubject.Run(context.Background(), stateBag) if result != multistep.ActionHalt { t.Fatalf("Expected the step to return 'ActionHalt', but got '%d'.", result) @@ -36,7 +37,7 @@ func TestStepStopServerInstanceShouldPassIfOperationStopPasses(t *testing.T) { stateBag := createTestStateBagStepStopServerInstance() - var result = testSubject.Run(stateBag) + var result = testSubject.Run(context.Background(), stateBag) if result != multistep.ActionContinue { t.Fatalf("Expected the step to return 'ActionContinue', but got '%d'.", result) diff --git a/builder/ncloud/step_terminate_server_instance_test.go b/builder/ncloud/step_terminate_server_instance_test.go index 9256b85b9..54a00748a 100644 --- a/builder/ncloud/step_terminate_server_instance_test.go +++ b/builder/ncloud/step_terminate_server_instance_test.go @@ -1,6 +1,7 @@ package ncloud import ( + "context" "fmt" "testing" @@ -16,7 +17,7 @@ func TestStepTerminateServerInstanceShouldFailIfOperationTerminationFails(t *tes stateBag := createTestStateBagStepTerminateServerInstance() - var result = testSubject.Run(stateBag) + var result = testSubject.Run(context.Background(), stateBag) if result != multistep.ActionHalt { t.Fatalf("Expected the step to return 'ActionHalt', but got '%d'.", result) @@ -36,7 +37,7 @@ func TestStepTerminateServerInstanceShouldPassIfOperationTerminationPasses(t *te stateBag := createTestStateBagStepTerminateServerInstance() - var result = testSubject.Run(stateBag) + var result = testSubject.Run(context.Background(), stateBag) if result != multistep.ActionContinue { t.Fatalf("Expected the step to return 'ActionContinue', but got '%d'.", result) diff --git a/builder/ncloud/step_validate_template_test.go b/builder/ncloud/step_validate_template_test.go index 6836f8446..7e9212c7f 100644 --- a/builder/ncloud/step_validate_template_test.go +++ b/builder/ncloud/step_validate_template_test.go @@ -1,6 +1,7 @@ package ncloud import ( + "context" "fmt" "testing" @@ -16,7 +17,7 @@ func TestStepValidateTemplateShouldFailIfValidateFails(t *testing.T) { stateBag := createTestStateBagStepValidateTemplate() - var result = testSubject.Run(stateBag) + var result = testSubject.Run(context.Background(), stateBag) if result != multistep.ActionHalt { t.Fatalf("Expected the step to return 'ActionHalt', but got '%d'.", result) @@ -36,7 +37,7 @@ func TestStepValidateTemplateShouldPassIfValidatePasses(t *testing.T) { stateBag := createTestStateBagStepValidateTemplate() - var result = testSubject.Run(stateBag) + var result = testSubject.Run(context.Background(), stateBag) if result != multistep.ActionContinue { t.Fatalf("Expected the step to return 'ActionContinue', but got '%d'.", result)