@@ -11,6 +11,7 @@ import (
1111 "github.com/dnaeon/go-vcr/cassette"
1212 "github.com/dnaeon/go-vcr/recorder"
1313 go_deploygate "github.com/fnaoto/go_deploygate"
14+ "github.com/hashicorp/terraform-plugin-sdk/v2/diag"
1415 "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
1516 "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
1617 "github.com/hashicorp/terraform-plugin-sdk/v2/terraform"
@@ -51,7 +52,7 @@ func Test_DGPreCheck(t *testing.T) {
5152
5253func initProvider (t * testing.T ) map [string ]* schema.Provider {
5354 testDGProvider = Provider ()
54- testDGProvider .ConfigureFunc = providerConfigureVCR (testDGProvider , t )
55+ testDGProvider .ConfigureContextFunc = providerConfigureVCR (testDGProvider , t )
5556
5657 testDGProviders = map [string ]* schema.Provider {
5758 ProviderNameDG : testDGProvider ,
@@ -60,8 +61,8 @@ func initProvider(t *testing.T) map[string]*schema.Provider {
6061 return testDGProviders
6162}
6263
63- func providerConfigureVCR (p * schema.Provider , t * testing.T ) schema.ConfigureFunc {
64- return func (d * schema.ResourceData ) (interface {}, error ) {
64+ func providerConfigureVCR (p * schema.Provider , t * testing.T ) schema.ConfigureContextFunc {
65+ return func (_ context. Context , d * schema.ResourceData ) (interface {}, diag. Diagnostics ) {
6566 config := & Config {
6667 clientConfig : go_deploygate.ClientConfig {
6768 ApiKey : d .Get ("api_key" ).(string ),
@@ -70,14 +71,14 @@ func providerConfigureVCR(p *schema.Provider, t *testing.T) schema.ConfigureFunc
7071
7172 err := config .initClient ()
7273 if err != nil {
73- return nil , err
74+ return nil , diag . FromErr ( err )
7475 }
7576
7677 fixture := filepath .Join (FixtureBasePath , t .Name (), strconv .Itoa (len (testDGConfigs )))
7778
7879 rec , err := recorder .New (fixture )
7980 if err != nil {
80- return nil , err
81+ return nil , diag . FromErr ( err )
8182 }
8283
8384 rec .AddSaveFilter (func (i * cassette.Interaction ) error {
0 commit comments