Skip to content

Commit d34ded0

Browse files
committed
fix: Correct secret drift implementation
Signed-off-by: Steve Hipwell <steve.hipwell@gmail.com>
1 parent f4a5b1a commit d34ded0

14 files changed

Lines changed: 2017 additions & 602 deletions

github/acc_test.go

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,21 @@ type testAccConfig struct {
7474

7575
var testAccConf *testAccConfig
7676

77+
var testAccProviders map[string]*schema.Provider = map[string]*schema.Provider{
78+
"github": Provider(),
79+
}
80+
7781
// providerFactories are used to instantiate a provider during acceptance testing.
7882
// The factory function will be invoked for every Terraform CLI command executed
7983
// to create a provider server to which the CLI can reattach.
80-
var providerFactories = map[string]func() (*schema.Provider, error){
81-
//nolint:unparam
82-
"github": func() (*schema.Provider, error) {
83-
return Provider(), nil
84-
},
85-
}
84+
var (
85+
providerFactories = map[string]func() (*schema.Provider, error){
86+
//nolint:unparam
87+
"github": func() (*schema.Provider, error) {
88+
return Provider(), nil
89+
},
90+
}
91+
)
8692

8793
func TestMain(m *testing.M) {
8894
authMode := testMode(os.Getenv("GH_TEST_AUTH_MODE"))

github/provider_test.go

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,33 +6,9 @@ import (
66
"testing"
77

88
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
9-
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
109
"github.com/hashicorp/terraform-plugin-sdk/v2/terraform"
1110
)
1211

13-
var (
14-
testAccProviders map[string]*schema.Provider
15-
testAccProviderFactories func(providers *[]*schema.Provider) map[string]func() (*schema.Provider, error)
16-
testAccProvider *schema.Provider
17-
)
18-
19-
func init() {
20-
testAccProvider = Provider()
21-
testAccProviders = map[string]*schema.Provider{
22-
"github": testAccProvider,
23-
}
24-
testAccProviderFactories = func(providers *[]*schema.Provider) map[string]func() (*schema.Provider, error) {
25-
return map[string]func() (*schema.Provider, error){
26-
//nolint:unparam
27-
"github": func() (*schema.Provider, error) {
28-
p := Provider()
29-
*providers = append(*providers, p)
30-
return p, nil
31-
},
32-
}
33-
}
34-
}
35-
3612
func TestProvider(t *testing.T) {
3713
t.Run("runs internal validation without error", func(t *testing.T) {
3814
if err := Provider().InternalValidate(); err != nil {

0 commit comments

Comments
 (0)