From 863e20ad65ad239c9355b0b41e41dda30346b2d7 Mon Sep 17 00:00:00 2001 From: Megan Marsh Date: Wed, 2 Dec 2020 09:46:42 -0800 Subject: [PATCH] move builder/testing framework into sdk; it imports the core but I think we just need to accept that. It doesn't expose the core directly to the SDK. --- builder/alicloud/ecs/builder_acc_test.go | 2 +- builder/amazon/ebs/builder_acc_test.go | 2 +- builder/amazon/ebs/tags_acc_test.go | 2 +- builder/azure/arm/builder_acc_test.go | 2 +- builder/azure/dtl/builder_acc_test.go | 6 +++--- builder/digitalocean/builder_acc_test.go | 2 +- builder/file/builder_test.go | 2 +- builder/hcloud/builder_acc_test.go | 2 +- builder/hyperone/builder_acc_test.go | 2 +- builder/linode/builder_acc_test.go | 2 +- builder/oneandone/builder_acc_test.go | 2 +- builder/osc/bsu/builder_acc_test.go | 2 +- builder/osc/bsusurrogate/builder_acc_test.go | 2 +- builder/osc/bsuvolume/builder_acc_test.go | 2 +- builder/profitbricks/builder_acc_test.go | 2 +- builder/ucloud/uhost/builder_acc_test.go | 2 +- builder/virtualbox/iso/builder_acc_test.go | 2 +- builder/vmware/iso/builder_acc_test.go | 2 +- builder/vsphere/clone/builder_acc_test.go | 2 +- builder/vsphere/iso/builder_acc_test.go | 2 +- builder/yandex/builder_acc_test.go | 2 +- go.mod | 1 + go.sum | 3 +++ {helper => packer-plugin-sdk}/builder/testing/testing.go | 0 .../builder/testing/testing_test.go | 0 25 files changed, 27 insertions(+), 23 deletions(-) rename {helper => packer-plugin-sdk}/builder/testing/testing.go (100%) rename {helper => packer-plugin-sdk}/builder/testing/testing_test.go (100%) diff --git a/builder/alicloud/ecs/builder_acc_test.go b/builder/alicloud/ecs/builder_acc_test.go index 4de4c5741..c3efa2129 100644 --- a/builder/alicloud/ecs/builder_acc_test.go +++ b/builder/alicloud/ecs/builder_acc_test.go @@ -8,7 +8,7 @@ import ( "testing" "github.com/aliyun/alibaba-cloud-sdk-go/services/ecs" - builderT "github.com/hashicorp/packer/helper/builder/testing" + builderT "github.com/hashicorp/packer/packer-plugin-sdk/builder/testing" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) diff --git a/builder/amazon/ebs/builder_acc_test.go b/builder/amazon/ebs/builder_acc_test.go index ffb773657..e81d226ab 100644 --- a/builder/amazon/ebs/builder_acc_test.go +++ b/builder/amazon/ebs/builder_acc_test.go @@ -12,7 +12,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/packer/builder/amazon/common" - builderT "github.com/hashicorp/packer/helper/builder/testing" + builderT "github.com/hashicorp/packer/packer-plugin-sdk/builder/testing" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) diff --git a/builder/amazon/ebs/tags_acc_test.go b/builder/amazon/ebs/tags_acc_test.go index ac1c48dc0..640e27cc4 100644 --- a/builder/amazon/ebs/tags_acc_test.go +++ b/builder/amazon/ebs/tags_acc_test.go @@ -8,7 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/packer/builder/amazon/common" - builderT "github.com/hashicorp/packer/helper/builder/testing" + builderT "github.com/hashicorp/packer/packer-plugin-sdk/builder/testing" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) diff --git a/builder/azure/arm/builder_acc_test.go b/builder/azure/arm/builder_acc_test.go index 42e518cf4..24a36bf72 100644 --- a/builder/azure/arm/builder_acc_test.go +++ b/builder/azure/arm/builder_acc_test.go @@ -25,7 +25,7 @@ import ( "fmt" "os" - builderT "github.com/hashicorp/packer/helper/builder/testing" + builderT "github.com/hashicorp/packer/packer-plugin-sdk/builder/testing" ) const DeviceLoginAcceptanceTest = "DEVICELOGIN_TEST" diff --git a/builder/azure/dtl/builder_acc_test.go b/builder/azure/dtl/builder_acc_test.go index 2255319c5..825090890 100644 --- a/builder/azure/dtl/builder_acc_test.go +++ b/builder/azure/dtl/builder_acc_test.go @@ -28,7 +28,7 @@ package dtl import ( "testing" - builderT "github.com/hashicorp/packer/helper/builder/testing" + builderT "github.com/hashicorp/packer/packer-plugin-sdk/builder/testing" ) const DeviceLoginAcceptanceTest = "DEVICELOGIN_TEST" @@ -83,7 +83,7 @@ const testBuilderAccManagedDiskWindows = ` "winrm_insecure": "true", "winrm_timeout": "3m", "winrm_username": "packer", - + "location": "South Central US", "vm_size": "Standard_DS2_v2" }] @@ -120,7 +120,7 @@ const testBuilderAccManagedDiskLinux = ` "location": "South Central US", "vm_size": "Standard_DS2_v2", - + "dtl_artifacts": [{ "artifact_name": "linux-apt-package", "parameters" : [{ diff --git a/builder/digitalocean/builder_acc_test.go b/builder/digitalocean/builder_acc_test.go index 183058d95..619736ab6 100644 --- a/builder/digitalocean/builder_acc_test.go +++ b/builder/digitalocean/builder_acc_test.go @@ -7,7 +7,7 @@ import ( "testing" "github.com/digitalocean/godo" - builderT "github.com/hashicorp/packer/helper/builder/testing" + builderT "github.com/hashicorp/packer/packer-plugin-sdk/builder/testing" "golang.org/x/oauth2" ) diff --git a/builder/file/builder_test.go b/builder/file/builder_test.go index ee1f4154e..edaab32f5 100644 --- a/builder/file/builder_test.go +++ b/builder/file/builder_test.go @@ -5,7 +5,7 @@ import ( "io/ioutil" "testing" - builderT "github.com/hashicorp/packer/helper/builder/testing" + builderT "github.com/hashicorp/packer/packer-plugin-sdk/builder/testing" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) diff --git a/builder/hcloud/builder_acc_test.go b/builder/hcloud/builder_acc_test.go index 86b0afd21..51e833d10 100644 --- a/builder/hcloud/builder_acc_test.go +++ b/builder/hcloud/builder_acc_test.go @@ -4,7 +4,7 @@ import ( "os" "testing" - builderT "github.com/hashicorp/packer/helper/builder/testing" + builderT "github.com/hashicorp/packer/packer-plugin-sdk/builder/testing" ) func TestBuilderAcc_basic(t *testing.T) { diff --git a/builder/hyperone/builder_acc_test.go b/builder/hyperone/builder_acc_test.go index b9e5a6da7..aa295b618 100644 --- a/builder/hyperone/builder_acc_test.go +++ b/builder/hyperone/builder_acc_test.go @@ -4,7 +4,7 @@ import ( "os" "testing" - builderT "github.com/hashicorp/packer/helper/builder/testing" + builderT "github.com/hashicorp/packer/packer-plugin-sdk/builder/testing" ) func TestBuilderAcc_basic(t *testing.T) { diff --git a/builder/linode/builder_acc_test.go b/builder/linode/builder_acc_test.go index d5a999d6c..bd5af8fb8 100644 --- a/builder/linode/builder_acc_test.go +++ b/builder/linode/builder_acc_test.go @@ -4,7 +4,7 @@ import ( "os" "testing" - builderT "github.com/hashicorp/packer/helper/builder/testing" + builderT "github.com/hashicorp/packer/packer-plugin-sdk/builder/testing" ) func TestBuilderAcc_basic(t *testing.T) { diff --git a/builder/oneandone/builder_acc_test.go b/builder/oneandone/builder_acc_test.go index 57ca974f2..b348f805d 100644 --- a/builder/oneandone/builder_acc_test.go +++ b/builder/oneandone/builder_acc_test.go @@ -4,7 +4,7 @@ import ( "os" "testing" - builderT "github.com/hashicorp/packer/helper/builder/testing" + builderT "github.com/hashicorp/packer/packer-plugin-sdk/builder/testing" ) func TestBuilderAcc_basic(t *testing.T) { diff --git a/builder/osc/bsu/builder_acc_test.go b/builder/osc/bsu/builder_acc_test.go index 2776af243..7d5e25f59 100644 --- a/builder/osc/bsu/builder_acc_test.go +++ b/builder/osc/bsu/builder_acc_test.go @@ -4,7 +4,7 @@ package bsu import ( "testing" - builderT "github.com/hashicorp/packer/helper/builder/testing" + builderT "github.com/hashicorp/packer/packer-plugin-sdk/builder/testing" ) func TestBuilderAcc_basic(t *testing.T) { diff --git a/builder/osc/bsusurrogate/builder_acc_test.go b/builder/osc/bsusurrogate/builder_acc_test.go index 7208969e0..b8a980a0c 100644 --- a/builder/osc/bsusurrogate/builder_acc_test.go +++ b/builder/osc/bsusurrogate/builder_acc_test.go @@ -3,7 +3,7 @@ package bsusurrogate import ( "testing" - builderT "github.com/hashicorp/packer/helper/builder/testing" + builderT "github.com/hashicorp/packer/packer-plugin-sdk/builder/testing" ) func TestBuilderAcc_basic(t *testing.T) { diff --git a/builder/osc/bsuvolume/builder_acc_test.go b/builder/osc/bsuvolume/builder_acc_test.go index 93a748a30..dd3bbef6a 100644 --- a/builder/osc/bsuvolume/builder_acc_test.go +++ b/builder/osc/bsuvolume/builder_acc_test.go @@ -4,7 +4,7 @@ package bsuvolume import ( "testing" - builderT "github.com/hashicorp/packer/helper/builder/testing" + builderT "github.com/hashicorp/packer/packer-plugin-sdk/builder/testing" ) func TestBuilderAcc_basic(t *testing.T) { diff --git a/builder/profitbricks/builder_acc_test.go b/builder/profitbricks/builder_acc_test.go index 93fd7946d..c3a829920 100644 --- a/builder/profitbricks/builder_acc_test.go +++ b/builder/profitbricks/builder_acc_test.go @@ -4,7 +4,7 @@ import ( "os" "testing" - builderT "github.com/hashicorp/packer/helper/builder/testing" + builderT "github.com/hashicorp/packer/packer-plugin-sdk/builder/testing" ) func TestBuilderAcc_basic(t *testing.T) { diff --git a/builder/ucloud/uhost/builder_acc_test.go b/builder/ucloud/uhost/builder_acc_test.go index c4b5b2781..5d3c68888 100644 --- a/builder/ucloud/uhost/builder_acc_test.go +++ b/builder/ucloud/uhost/builder_acc_test.go @@ -9,7 +9,7 @@ import ( packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/stretchr/testify/assert" - builderT "github.com/hashicorp/packer/helper/builder/testing" + builderT "github.com/hashicorp/packer/packer-plugin-sdk/builder/testing" ) func TestBuilderAcc_validateRegion(t *testing.T) { diff --git a/builder/virtualbox/iso/builder_acc_test.go b/builder/virtualbox/iso/builder_acc_test.go index dd8fccaeb..1be8de534 100644 --- a/builder/virtualbox/iso/builder_acc_test.go +++ b/builder/virtualbox/iso/builder_acc_test.go @@ -5,7 +5,7 @@ import ( "path/filepath" "testing" - builderT "github.com/hashicorp/packer/helper/builder/testing" + builderT "github.com/hashicorp/packer/packer-plugin-sdk/builder/testing" ) func TestBuilderAcc_basic(t *testing.T) { diff --git a/builder/vmware/iso/builder_acc_test.go b/builder/vmware/iso/builder_acc_test.go index dd8fccaeb..1be8de534 100644 --- a/builder/vmware/iso/builder_acc_test.go +++ b/builder/vmware/iso/builder_acc_test.go @@ -5,7 +5,7 @@ import ( "path/filepath" "testing" - builderT "github.com/hashicorp/packer/helper/builder/testing" + builderT "github.com/hashicorp/packer/packer-plugin-sdk/builder/testing" ) func TestBuilderAcc_basic(t *testing.T) { diff --git a/builder/vsphere/clone/builder_acc_test.go b/builder/vsphere/clone/builder_acc_test.go index a5af88eb1..83d34ae8f 100644 --- a/builder/vsphere/clone/builder_acc_test.go +++ b/builder/vsphere/clone/builder_acc_test.go @@ -6,7 +6,7 @@ import ( "github.com/hashicorp/packer/builder/vsphere/common" commonT "github.com/hashicorp/packer/builder/vsphere/common/testing" - builderT "github.com/hashicorp/packer/helper/builder/testing" + builderT "github.com/hashicorp/packer/packer-plugin-sdk/builder/testing" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/vmware/govmomi/vim25/types" ) diff --git a/builder/vsphere/iso/builder_acc_test.go b/builder/vsphere/iso/builder_acc_test.go index 8276258f0..1ded0723b 100644 --- a/builder/vsphere/iso/builder_acc_test.go +++ b/builder/vsphere/iso/builder_acc_test.go @@ -7,7 +7,7 @@ import ( "testing" commonT "github.com/hashicorp/packer/builder/vsphere/common/testing" - builderT "github.com/hashicorp/packer/helper/builder/testing" + builderT "github.com/hashicorp/packer/packer-plugin-sdk/builder/testing" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/vmware/govmomi/vim25/types" ) diff --git a/builder/yandex/builder_acc_test.go b/builder/yandex/builder_acc_test.go index 226c5b787..3d201a171 100644 --- a/builder/yandex/builder_acc_test.go +++ b/builder/yandex/builder_acc_test.go @@ -7,7 +7,7 @@ import ( "github.com/go-resty/resty/v2" - builderT "github.com/hashicorp/packer/helper/builder/testing" + builderT "github.com/hashicorp/packer/packer-plugin-sdk/builder/testing" ) const InstanceMetadataAddr = "169.254.169.254" diff --git a/go.mod b/go.mod index cf76d5690..352ad70ee 100644 --- a/go.mod +++ b/go.mod @@ -94,6 +94,7 @@ require ( github.com/mitchellh/go-homedir v1.1.0 github.com/mitchellh/go-testing-interface v1.0.3 // indirect github.com/mitchellh/go-vnc v0.0.0-20150629162542-723ed9867aed + github.com/mitchellh/gox v1.0.1 // indirect github.com/mitchellh/iochan v1.0.0 github.com/mitchellh/mapstructure v1.2.3 github.com/mitchellh/panicwrap v1.0.0 diff --git a/go.sum b/go.sum index 2150402df..501a4163e 100644 --- a/go.sum +++ b/go.sum @@ -376,6 +376,7 @@ github.com/hashicorp/go-uuid v1.0.1 h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1 github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE= github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-version v1.0.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.1.0 h1:bPIoEKD27tNdebFGGxxYwcL4nepeY4j1QP23PFRGzg0= github.com/hashicorp/go-version v1.1.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.2.0 h1:3vNe/fWF5CBgRIguda1meWhsZHy3m8gCJ5wx+dIzX/E= @@ -510,6 +511,8 @@ github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7/go.mod h1:ZX github.com/mitchellh/go-wordwrap v1.0.0 h1:6GlHJ/LTGMrIJbwgdqdl2eEH8o+Exx/0m8ir9Gns0u4= github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= +github.com/mitchellh/gox v1.0.1 h1:x0jD3dcHk9a9xPSDN6YEL4xL6Qz0dvNYm8yZqui5chI= +github.com/mitchellh/gox v1.0.1/go.mod h1:ED6BioOGXMswlXa2zxfh/xdd5QhwYliBFn9V18Ap4z4= github.com/mitchellh/iochan v1.0.0 h1:C+X3KsSTLFVBr/tK1eYN/vs4rJcvsiLU338UhYPJWeY= github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= diff --git a/helper/builder/testing/testing.go b/packer-plugin-sdk/builder/testing/testing.go similarity index 100% rename from helper/builder/testing/testing.go rename to packer-plugin-sdk/builder/testing/testing.go diff --git a/helper/builder/testing/testing_test.go b/packer-plugin-sdk/builder/testing/testing_test.go similarity index 100% rename from helper/builder/testing/testing_test.go rename to packer-plugin-sdk/builder/testing/testing_test.go