Skip to content

Commit 4d05762

Browse files
committed
fix: Correct secret drift implementation
Signed-off-by: Steve Hipwell <[email protected]>
1 parent 8359c39 commit 4d05762

15 files changed

Lines changed: 2017 additions & 573 deletions

github/acc_test.go

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

7878
var testAccConf *testAccConfig
7979

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

9096
func TestMain(m *testing.M) {
9197
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)