plugin: Fix tests
An earlier change made the tests not compile here. We now need to use the legacyPluginMap function, since pluginMap has now been replaced with helpers to produce new-style plugin _sets_.
This commit is contained in:
parent
1908aff476
commit
88551181d5
|
@ -17,7 +17,7 @@ func TestResourceProvider_impl(t *testing.T) {
|
||||||
func TestResourceProvider_stop(t *testing.T) {
|
func TestResourceProvider_stop(t *testing.T) {
|
||||||
// Create a mock provider
|
// Create a mock provider
|
||||||
p := new(terraform.MockResourceProvider)
|
p := new(terraform.MockResourceProvider)
|
||||||
client, _ := plugin.TestPluginRPCConn(t, pluginMap(&ServeOpts{
|
client, _ := plugin.TestPluginRPCConn(t, legacyPluginMap(&ServeOpts{
|
||||||
ProviderFunc: testProviderFixed(p),
|
ProviderFunc: testProviderFixed(p),
|
||||||
}), nil)
|
}), nil)
|
||||||
defer client.Close()
|
defer client.Close()
|
||||||
|
@ -44,7 +44,7 @@ func TestResourceProvider_stopErrors(t *testing.T) {
|
||||||
p.StopReturnError = errors.New("foo")
|
p.StopReturnError = errors.New("foo")
|
||||||
|
|
||||||
// Create a mock provider
|
// Create a mock provider
|
||||||
client, _ := plugin.TestPluginRPCConn(t, pluginMap(&ServeOpts{
|
client, _ := plugin.TestPluginRPCConn(t, legacyPluginMap(&ServeOpts{
|
||||||
ProviderFunc: testProviderFixed(p),
|
ProviderFunc: testProviderFixed(p),
|
||||||
}), nil)
|
}), nil)
|
||||||
defer client.Close()
|
defer client.Close()
|
||||||
|
@ -72,7 +72,7 @@ func TestResourceProvider_stopErrors(t *testing.T) {
|
||||||
func TestResourceProvider_input(t *testing.T) {
|
func TestResourceProvider_input(t *testing.T) {
|
||||||
// Create a mock provider
|
// Create a mock provider
|
||||||
p := new(terraform.MockResourceProvider)
|
p := new(terraform.MockResourceProvider)
|
||||||
client, _ := plugin.TestPluginRPCConn(t, pluginMap(&ServeOpts{
|
client, _ := plugin.TestPluginRPCConn(t, legacyPluginMap(&ServeOpts{
|
||||||
ProviderFunc: testProviderFixed(p),
|
ProviderFunc: testProviderFixed(p),
|
||||||
}), nil)
|
}), nil)
|
||||||
defer client.Close()
|
defer client.Close()
|
||||||
|
@ -114,7 +114,7 @@ func TestResourceProvider_input(t *testing.T) {
|
||||||
func TestResourceProvider_configure(t *testing.T) {
|
func TestResourceProvider_configure(t *testing.T) {
|
||||||
// Create a mock provider
|
// Create a mock provider
|
||||||
p := new(terraform.MockResourceProvider)
|
p := new(terraform.MockResourceProvider)
|
||||||
client, _ := plugin.TestPluginRPCConn(t, pluginMap(&ServeOpts{
|
client, _ := plugin.TestPluginRPCConn(t, legacyPluginMap(&ServeOpts{
|
||||||
ProviderFunc: testProviderFixed(p),
|
ProviderFunc: testProviderFixed(p),
|
||||||
}), nil)
|
}), nil)
|
||||||
defer client.Close()
|
defer client.Close()
|
||||||
|
@ -147,7 +147,7 @@ func TestResourceProvider_configure_errors(t *testing.T) {
|
||||||
p.ConfigureReturnError = errors.New("foo")
|
p.ConfigureReturnError = errors.New("foo")
|
||||||
|
|
||||||
// Create a mock provider
|
// Create a mock provider
|
||||||
client, _ := plugin.TestPluginRPCConn(t, pluginMap(&ServeOpts{
|
client, _ := plugin.TestPluginRPCConn(t, legacyPluginMap(&ServeOpts{
|
||||||
ProviderFunc: testProviderFixed(p),
|
ProviderFunc: testProviderFixed(p),
|
||||||
}), nil)
|
}), nil)
|
||||||
defer client.Close()
|
defer client.Close()
|
||||||
|
@ -182,7 +182,7 @@ func TestResourceProvider_configure_warnings(t *testing.T) {
|
||||||
p := new(terraform.MockResourceProvider)
|
p := new(terraform.MockResourceProvider)
|
||||||
|
|
||||||
// Create a mock provider
|
// Create a mock provider
|
||||||
client, _ := plugin.TestPluginRPCConn(t, pluginMap(&ServeOpts{
|
client, _ := plugin.TestPluginRPCConn(t, legacyPluginMap(&ServeOpts{
|
||||||
ProviderFunc: testProviderFixed(p),
|
ProviderFunc: testProviderFixed(p),
|
||||||
}), nil)
|
}), nil)
|
||||||
defer client.Close()
|
defer client.Close()
|
||||||
|
@ -214,7 +214,7 @@ func TestResourceProvider_apply(t *testing.T) {
|
||||||
p := new(terraform.MockResourceProvider)
|
p := new(terraform.MockResourceProvider)
|
||||||
|
|
||||||
// Create a mock provider
|
// Create a mock provider
|
||||||
client, _ := plugin.TestPluginRPCConn(t, pluginMap(&ServeOpts{
|
client, _ := plugin.TestPluginRPCConn(t, legacyPluginMap(&ServeOpts{
|
||||||
ProviderFunc: testProviderFixed(p),
|
ProviderFunc: testProviderFixed(p),
|
||||||
}), nil)
|
}), nil)
|
||||||
defer client.Close()
|
defer client.Close()
|
||||||
|
@ -253,7 +253,7 @@ func TestResourceProvider_diff(t *testing.T) {
|
||||||
p := new(terraform.MockResourceProvider)
|
p := new(terraform.MockResourceProvider)
|
||||||
|
|
||||||
// Create a mock provider
|
// Create a mock provider
|
||||||
client, _ := plugin.TestPluginRPCConn(t, pluginMap(&ServeOpts{
|
client, _ := plugin.TestPluginRPCConn(t, legacyPluginMap(&ServeOpts{
|
||||||
ProviderFunc: testProviderFixed(p),
|
ProviderFunc: testProviderFixed(p),
|
||||||
}), nil)
|
}), nil)
|
||||||
defer client.Close()
|
defer client.Close()
|
||||||
|
@ -299,7 +299,7 @@ func TestResourceProvider_diff_error(t *testing.T) {
|
||||||
p := new(terraform.MockResourceProvider)
|
p := new(terraform.MockResourceProvider)
|
||||||
|
|
||||||
// Create a mock provider
|
// Create a mock provider
|
||||||
client, _ := plugin.TestPluginRPCConn(t, pluginMap(&ServeOpts{
|
client, _ := plugin.TestPluginRPCConn(t, legacyPluginMap(&ServeOpts{
|
||||||
ProviderFunc: testProviderFixed(p),
|
ProviderFunc: testProviderFixed(p),
|
||||||
}), nil)
|
}), nil)
|
||||||
defer client.Close()
|
defer client.Close()
|
||||||
|
@ -338,7 +338,7 @@ func TestResourceProvider_refresh(t *testing.T) {
|
||||||
p := new(terraform.MockResourceProvider)
|
p := new(terraform.MockResourceProvider)
|
||||||
|
|
||||||
// Create a mock provider
|
// Create a mock provider
|
||||||
client, _ := plugin.TestPluginRPCConn(t, pluginMap(&ServeOpts{
|
client, _ := plugin.TestPluginRPCConn(t, legacyPluginMap(&ServeOpts{
|
||||||
ProviderFunc: testProviderFixed(p),
|
ProviderFunc: testProviderFixed(p),
|
||||||
}), nil)
|
}), nil)
|
||||||
defer client.Close()
|
defer client.Close()
|
||||||
|
@ -376,7 +376,7 @@ func TestResourceProvider_importState(t *testing.T) {
|
||||||
p := new(terraform.MockResourceProvider)
|
p := new(terraform.MockResourceProvider)
|
||||||
|
|
||||||
// Create a mock provider
|
// Create a mock provider
|
||||||
client, _ := plugin.TestPluginRPCConn(t, pluginMap(&ServeOpts{
|
client, _ := plugin.TestPluginRPCConn(t, legacyPluginMap(&ServeOpts{
|
||||||
ProviderFunc: testProviderFixed(p),
|
ProviderFunc: testProviderFixed(p),
|
||||||
}), nil)
|
}), nil)
|
||||||
defer client.Close()
|
defer client.Close()
|
||||||
|
@ -415,7 +415,7 @@ func TestResourceProvider_resources(t *testing.T) {
|
||||||
p := new(terraform.MockResourceProvider)
|
p := new(terraform.MockResourceProvider)
|
||||||
|
|
||||||
// Create a mock provider
|
// Create a mock provider
|
||||||
client, _ := plugin.TestPluginRPCConn(t, pluginMap(&ServeOpts{
|
client, _ := plugin.TestPluginRPCConn(t, legacyPluginMap(&ServeOpts{
|
||||||
ProviderFunc: testProviderFixed(p),
|
ProviderFunc: testProviderFixed(p),
|
||||||
}), nil)
|
}), nil)
|
||||||
defer client.Close()
|
defer client.Close()
|
||||||
|
@ -448,7 +448,7 @@ func TestResourceProvider_readdataapply(t *testing.T) {
|
||||||
p := new(terraform.MockResourceProvider)
|
p := new(terraform.MockResourceProvider)
|
||||||
|
|
||||||
// Create a mock provider
|
// Create a mock provider
|
||||||
client, _ := plugin.TestPluginRPCConn(t, pluginMap(&ServeOpts{
|
client, _ := plugin.TestPluginRPCConn(t, legacyPluginMap(&ServeOpts{
|
||||||
ProviderFunc: testProviderFixed(p),
|
ProviderFunc: testProviderFixed(p),
|
||||||
}), nil)
|
}), nil)
|
||||||
defer client.Close()
|
defer client.Close()
|
||||||
|
@ -486,7 +486,7 @@ func TestResourceProvider_datasources(t *testing.T) {
|
||||||
p := new(terraform.MockResourceProvider)
|
p := new(terraform.MockResourceProvider)
|
||||||
|
|
||||||
// Create a mock provider
|
// Create a mock provider
|
||||||
client, _ := plugin.TestPluginRPCConn(t, pluginMap(&ServeOpts{
|
client, _ := plugin.TestPluginRPCConn(t, legacyPluginMap(&ServeOpts{
|
||||||
ProviderFunc: testProviderFixed(p),
|
ProviderFunc: testProviderFixed(p),
|
||||||
}), nil)
|
}), nil)
|
||||||
defer client.Close()
|
defer client.Close()
|
||||||
|
@ -519,7 +519,7 @@ func TestResourceProvider_validate(t *testing.T) {
|
||||||
p := new(terraform.MockResourceProvider)
|
p := new(terraform.MockResourceProvider)
|
||||||
|
|
||||||
// Create a mock provider
|
// Create a mock provider
|
||||||
client, _ := plugin.TestPluginRPCConn(t, pluginMap(&ServeOpts{
|
client, _ := plugin.TestPluginRPCConn(t, legacyPluginMap(&ServeOpts{
|
||||||
ProviderFunc: testProviderFixed(p),
|
ProviderFunc: testProviderFixed(p),
|
||||||
}), nil)
|
}), nil)
|
||||||
defer client.Close()
|
defer client.Close()
|
||||||
|
@ -554,7 +554,7 @@ func TestResourceProvider_validate_errors(t *testing.T) {
|
||||||
p := new(terraform.MockResourceProvider)
|
p := new(terraform.MockResourceProvider)
|
||||||
|
|
||||||
// Create a mock provider
|
// Create a mock provider
|
||||||
client, _ := plugin.TestPluginRPCConn(t, pluginMap(&ServeOpts{
|
client, _ := plugin.TestPluginRPCConn(t, legacyPluginMap(&ServeOpts{
|
||||||
ProviderFunc: testProviderFixed(p),
|
ProviderFunc: testProviderFixed(p),
|
||||||
}), nil)
|
}), nil)
|
||||||
defer client.Close()
|
defer client.Close()
|
||||||
|
@ -595,7 +595,7 @@ func TestResourceProvider_validate_warns(t *testing.T) {
|
||||||
p := new(terraform.MockResourceProvider)
|
p := new(terraform.MockResourceProvider)
|
||||||
|
|
||||||
// Create a mock provider
|
// Create a mock provider
|
||||||
client, _ := plugin.TestPluginRPCConn(t, pluginMap(&ServeOpts{
|
client, _ := plugin.TestPluginRPCConn(t, legacyPluginMap(&ServeOpts{
|
||||||
ProviderFunc: testProviderFixed(p),
|
ProviderFunc: testProviderFixed(p),
|
||||||
}), nil)
|
}), nil)
|
||||||
defer client.Close()
|
defer client.Close()
|
||||||
|
@ -634,7 +634,7 @@ func TestResourceProvider_validateResource(t *testing.T) {
|
||||||
p := new(terraform.MockResourceProvider)
|
p := new(terraform.MockResourceProvider)
|
||||||
|
|
||||||
// Create a mock provider
|
// Create a mock provider
|
||||||
client, _ := plugin.TestPluginRPCConn(t, pluginMap(&ServeOpts{
|
client, _ := plugin.TestPluginRPCConn(t, legacyPluginMap(&ServeOpts{
|
||||||
ProviderFunc: testProviderFixed(p),
|
ProviderFunc: testProviderFixed(p),
|
||||||
}), nil)
|
}), nil)
|
||||||
defer client.Close()
|
defer client.Close()
|
||||||
|
@ -672,7 +672,7 @@ func TestResourceProvider_validateResource_errors(t *testing.T) {
|
||||||
p := new(terraform.MockResourceProvider)
|
p := new(terraform.MockResourceProvider)
|
||||||
|
|
||||||
// Create a mock provider
|
// Create a mock provider
|
||||||
client, _ := plugin.TestPluginRPCConn(t, pluginMap(&ServeOpts{
|
client, _ := plugin.TestPluginRPCConn(t, legacyPluginMap(&ServeOpts{
|
||||||
ProviderFunc: testProviderFixed(p),
|
ProviderFunc: testProviderFixed(p),
|
||||||
}), nil)
|
}), nil)
|
||||||
defer client.Close()
|
defer client.Close()
|
||||||
|
@ -716,7 +716,7 @@ func TestResourceProvider_validateResource_warns(t *testing.T) {
|
||||||
p := new(terraform.MockResourceProvider)
|
p := new(terraform.MockResourceProvider)
|
||||||
|
|
||||||
// Create a mock provider
|
// Create a mock provider
|
||||||
client, _ := plugin.TestPluginRPCConn(t, pluginMap(&ServeOpts{
|
client, _ := plugin.TestPluginRPCConn(t, legacyPluginMap(&ServeOpts{
|
||||||
ProviderFunc: testProviderFixed(p),
|
ProviderFunc: testProviderFixed(p),
|
||||||
}), nil)
|
}), nil)
|
||||||
defer client.Close()
|
defer client.Close()
|
||||||
|
@ -758,7 +758,7 @@ func TestResourceProvider_validateDataSource(t *testing.T) {
|
||||||
p := new(terraform.MockResourceProvider)
|
p := new(terraform.MockResourceProvider)
|
||||||
|
|
||||||
// Create a mock provider
|
// Create a mock provider
|
||||||
client, _ := plugin.TestPluginRPCConn(t, pluginMap(&ServeOpts{
|
client, _ := plugin.TestPluginRPCConn(t, legacyPluginMap(&ServeOpts{
|
||||||
ProviderFunc: testProviderFixed(p),
|
ProviderFunc: testProviderFixed(p),
|
||||||
}), nil)
|
}), nil)
|
||||||
defer client.Close()
|
defer client.Close()
|
||||||
|
@ -796,7 +796,7 @@ func TestResourceProvider_close(t *testing.T) {
|
||||||
p := new(terraform.MockResourceProvider)
|
p := new(terraform.MockResourceProvider)
|
||||||
|
|
||||||
// Create a mock provider
|
// Create a mock provider
|
||||||
client, _ := plugin.TestPluginRPCConn(t, pluginMap(&ServeOpts{
|
client, _ := plugin.TestPluginRPCConn(t, legacyPluginMap(&ServeOpts{
|
||||||
ProviderFunc: testProviderFixed(p),
|
ProviderFunc: testProviderFixed(p),
|
||||||
}), nil)
|
}), nil)
|
||||||
defer client.Close()
|
defer client.Close()
|
||||||
|
|
|
@ -17,7 +17,7 @@ func TestResourceProvisioner_impl(t *testing.T) {
|
||||||
func TestResourceProvisioner_stop(t *testing.T) {
|
func TestResourceProvisioner_stop(t *testing.T) {
|
||||||
// Create a mock provider
|
// Create a mock provider
|
||||||
p := new(terraform.MockResourceProvisioner)
|
p := new(terraform.MockResourceProvisioner)
|
||||||
client, _ := plugin.TestPluginRPCConn(t, pluginMap(&ServeOpts{
|
client, _ := plugin.TestPluginRPCConn(t, legacyPluginMap(&ServeOpts{
|
||||||
ProvisionerFunc: testProvisionerFixed(p),
|
ProvisionerFunc: testProvisionerFixed(p),
|
||||||
}), nil)
|
}), nil)
|
||||||
defer client.Close()
|
defer client.Close()
|
||||||
|
@ -44,7 +44,7 @@ func TestResourceProvisioner_stopErrors(t *testing.T) {
|
||||||
p.StopReturnError = errors.New("foo")
|
p.StopReturnError = errors.New("foo")
|
||||||
|
|
||||||
// Create a mock provider
|
// Create a mock provider
|
||||||
client, _ := plugin.TestPluginRPCConn(t, pluginMap(&ServeOpts{
|
client, _ := plugin.TestPluginRPCConn(t, legacyPluginMap(&ServeOpts{
|
||||||
ProvisionerFunc: testProvisionerFixed(p),
|
ProvisionerFunc: testProvisionerFixed(p),
|
||||||
}), nil)
|
}), nil)
|
||||||
defer client.Close()
|
defer client.Close()
|
||||||
|
@ -72,7 +72,7 @@ func TestResourceProvisioner_stopErrors(t *testing.T) {
|
||||||
func TestResourceProvisioner_apply(t *testing.T) {
|
func TestResourceProvisioner_apply(t *testing.T) {
|
||||||
// Create a mock provider
|
// Create a mock provider
|
||||||
p := new(terraform.MockResourceProvisioner)
|
p := new(terraform.MockResourceProvisioner)
|
||||||
client, _ := plugin.TestPluginRPCConn(t, pluginMap(&ServeOpts{
|
client, _ := plugin.TestPluginRPCConn(t, legacyPluginMap(&ServeOpts{
|
||||||
ProvisionerFunc: testProvisionerFixed(p),
|
ProvisionerFunc: testProvisionerFixed(p),
|
||||||
}), nil)
|
}), nil)
|
||||||
defer client.Close()
|
defer client.Close()
|
||||||
|
@ -103,7 +103,7 @@ func TestResourceProvisioner_apply(t *testing.T) {
|
||||||
func TestResourceProvisioner_validate(t *testing.T) {
|
func TestResourceProvisioner_validate(t *testing.T) {
|
||||||
// Create a mock provider
|
// Create a mock provider
|
||||||
p := new(terraform.MockResourceProvisioner)
|
p := new(terraform.MockResourceProvisioner)
|
||||||
client, _ := plugin.TestPluginRPCConn(t, pluginMap(&ServeOpts{
|
client, _ := plugin.TestPluginRPCConn(t, legacyPluginMap(&ServeOpts{
|
||||||
ProvisionerFunc: testProvisionerFixed(p),
|
ProvisionerFunc: testProvisionerFixed(p),
|
||||||
}), nil)
|
}), nil)
|
||||||
defer client.Close()
|
defer client.Close()
|
||||||
|
@ -137,7 +137,7 @@ func TestResourceProvisioner_validate(t *testing.T) {
|
||||||
func TestResourceProvisioner_validate_errors(t *testing.T) {
|
func TestResourceProvisioner_validate_errors(t *testing.T) {
|
||||||
// Create a mock provider
|
// Create a mock provider
|
||||||
p := new(terraform.MockResourceProvisioner)
|
p := new(terraform.MockResourceProvisioner)
|
||||||
client, _ := plugin.TestPluginRPCConn(t, pluginMap(&ServeOpts{
|
client, _ := plugin.TestPluginRPCConn(t, legacyPluginMap(&ServeOpts{
|
||||||
ProvisionerFunc: testProvisionerFixed(p),
|
ProvisionerFunc: testProvisionerFixed(p),
|
||||||
}), nil)
|
}), nil)
|
||||||
defer client.Close()
|
defer client.Close()
|
||||||
|
@ -177,7 +177,7 @@ func TestResourceProvisioner_validate_errors(t *testing.T) {
|
||||||
func TestResourceProvisioner_validate_warns(t *testing.T) {
|
func TestResourceProvisioner_validate_warns(t *testing.T) {
|
||||||
// Create a mock provider
|
// Create a mock provider
|
||||||
p := new(terraform.MockResourceProvisioner)
|
p := new(terraform.MockResourceProvisioner)
|
||||||
client, _ := plugin.TestPluginRPCConn(t, pluginMap(&ServeOpts{
|
client, _ := plugin.TestPluginRPCConn(t, legacyPluginMap(&ServeOpts{
|
||||||
ProvisionerFunc: testProvisionerFixed(p),
|
ProvisionerFunc: testProvisionerFixed(p),
|
||||||
}), nil)
|
}), nil)
|
||||||
defer client.Close()
|
defer client.Close()
|
||||||
|
@ -215,7 +215,7 @@ func TestResourceProvisioner_validate_warns(t *testing.T) {
|
||||||
func TestResourceProvisioner_close(t *testing.T) {
|
func TestResourceProvisioner_close(t *testing.T) {
|
||||||
// Create a mock provider
|
// Create a mock provider
|
||||||
p := new(terraform.MockResourceProvisioner)
|
p := new(terraform.MockResourceProvisioner)
|
||||||
client, _ := plugin.TestPluginRPCConn(t, pluginMap(&ServeOpts{
|
client, _ := plugin.TestPluginRPCConn(t, legacyPluginMap(&ServeOpts{
|
||||||
ProvisionerFunc: testProvisionerFixed(p),
|
ProvisionerFunc: testProvisionerFixed(p),
|
||||||
}), nil)
|
}), nil)
|
||||||
defer client.Close()
|
defer client.Close()
|
||||||
|
|
Loading…
Reference in New Issue