Skip to content

Commit

Permalink
fix UA for acceptance tests
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitry Kisler <admin@dkisler.com>
  • Loading branch information
kislerdm committed Nov 19, 2024
1 parent 96658d4 commit fc272e5
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 20 deletions.
2 changes: 1 addition & 1 deletion internal/provider/acc-apikey_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func TestAccAPIKeys(t *testing.T) {
t, resource.TestCase{
ProviderFactories: map[string]func() (*schema.Provider, error){
"neon": func() (*schema.Provider, error) {
return New("accTest"), nil
return newAccTest(), nil
},
},
Steps: []resource.TestStep{
Expand Down
14 changes: 6 additions & 8 deletions internal/provider/acc-import_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,7 @@ func TestAccResourcesImport(t *testing.T) {
resource.UnitTest(
t, resource.TestCase{
ProviderFactories: map[string]func() (*schema.Provider, error){
"neon": func() (*schema.Provider, error) {
return New("0.5.0"), nil
},
"neon": func() (*schema.Provider, error) { return newAccTest(), nil },
},
Steps: []resource.TestStep{
{
Expand Down Expand Up @@ -123,7 +121,7 @@ func TestAccResourcesImport(t *testing.T) {
t, resource.TestCase{
ProviderFactories: map[string]func() (*schema.Provider, error){
"neon": func() (*schema.Provider, error) {
return New("0.5.0"), nil
return newAccTest(), nil
},
},
Steps: []resource.TestStep{
Expand Down Expand Up @@ -172,7 +170,7 @@ func TestAccResourcesImport(t *testing.T) {
t, resource.TestCase{
ProviderFactories: map[string]func() (*schema.Provider, error){
"neon": func() (*schema.Provider, error) {
return New("0.5.0"), nil
return newAccTest(), nil
},
},
Steps: []resource.TestStep{
Expand Down Expand Up @@ -220,7 +218,7 @@ func TestAccResourcesImport(t *testing.T) {
t, resource.TestCase{
ProviderFactories: map[string]func() (*schema.Provider, error){
"neon": func() (*schema.Provider, error) {
return New("0.5.0"), nil
return newAccTest(), nil
},
},
Steps: []resource.TestStep{
Expand Down Expand Up @@ -268,7 +266,7 @@ func TestAccResourcesImport(t *testing.T) {
t, resource.TestCase{
ProviderFactories: map[string]func() (*schema.Provider, error){
"neon": func() (*schema.Provider, error) {
return New("0.5.0"), nil
return newAccTest(), nil
},
},
Steps: []resource.TestStep{
Expand Down Expand Up @@ -313,7 +311,7 @@ func TestAccResourcesImport(t *testing.T) {
t, resource.TestCase{
ProviderFactories: map[string]func() (*schema.Provider, error){
"neon": func() (*schema.Provider, error) {
return New("0.5.0"), nil
return newAccTest(), nil
},
},
Steps: []resource.TestStep{
Expand Down
2 changes: 1 addition & 1 deletion internal/provider/acc-org_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func TestAccOrg(t *testing.T) {
t, resource.TestCase{
ProviderFactories: map[string]func() (*schema.Provider, error){
"neon": func() (*schema.Provider, error) {
return New("0.6.0"), nil
return newAccTest(), nil
},
},
Steps: []resource.TestStep{
Expand Down
20 changes: 10 additions & 10 deletions internal/provider/acc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ resource "neon_database" "this" {
t, resource.TestCase{
ProviderFactories: map[string]func() (*schema.Provider, error){
"neon": func() (*schema.Provider, error) {
return New("0.2.2"), nil
return newAccTest(), nil
},
},
Steps: []resource.TestStep{
Expand Down Expand Up @@ -540,7 +540,7 @@ func projectAllowedIPs(t *testing.T, client *neon.Client) {
t, resource.TestCase{
ProviderFactories: map[string]func() (*schema.Provider, error){
"neon": func() (*schema.Provider, error) {
return New("0.3.0"), nil
return newAccTest(), nil
},
},
Steps: []resource.TestStep{
Expand Down Expand Up @@ -629,7 +629,7 @@ func projectAllowedIPs(t *testing.T, client *neon.Client) {
t, resource.TestCase{
ProviderFactories: map[string]func() (*schema.Provider, error){
"neon": func() (*schema.Provider, error) {
return New("0.3.0"), nil
return newAccTest(), nil
},
},
Steps: []resource.TestStep{
Expand Down Expand Up @@ -715,7 +715,7 @@ func projectLogicalReplication(t *testing.T, client *neon.Client) {
t, resource.TestCase{
ProviderFactories: map[string]func() (*schema.Provider, error){
"neon": func() (*schema.Provider, error) {
return New("0.3.0"), nil
return newAccTest(), nil
},
},
Steps: []resource.TestStep{
Expand Down Expand Up @@ -763,7 +763,7 @@ func projectLogicalReplication(t *testing.T, client *neon.Client) {
t, resource.TestCase{
ProviderFactories: map[string]func() (*schema.Provider, error){
"neon": func() (*schema.Provider, error) {
return New("0.3.0"), nil
return newAccTest(), nil
},
},
Steps: []resource.TestStep{
Expand Down Expand Up @@ -809,7 +809,7 @@ func fetchDataSources(t *testing.T) {
resource.Test(t, resource.TestCase{
ProviderFactories: map[string]func() (*schema.Provider, error){
"neon": func() (*schema.Provider, error) {
return New("v0.3.0"), nil
return newAccTest(), nil
},
},
Steps: []resource.TestStep{
Expand Down Expand Up @@ -971,7 +971,7 @@ resource "neon_database" "this" {
t, resource.TestCase{
ProviderFactories: map[string]func() (*schema.Provider, error){
"neon": func() (*schema.Provider, error) {
return New("0.5.0"), nil
return newAccTest(), nil
},
},
Steps: []resource.TestStep{
Expand Down Expand Up @@ -1054,7 +1054,7 @@ func testPlanAfterRoleImport(t *testing.T, client *neon.Client) {
resource.Test(t, resource.TestCase{
ProviderFactories: map[string]func() (*schema.Provider, error){
"neon": func() (*schema.Provider, error) {
return New("0.6.2"), nil
return newAccTest(), nil
},
},
Steps: []resource.TestStep{
Expand Down Expand Up @@ -1127,7 +1127,7 @@ resource "neon_branch" "this" {
resource.Test(t, resource.TestCase{
ProviderFactories: map[string]func() (*schema.Provider, error){
"neon": func() (*schema.Provider, error) {
return New("0.6.2"), nil
return newAccTest(), nil
},
},
Steps: []resource.TestStep{
Expand Down Expand Up @@ -1203,7 +1203,7 @@ func TestProjectDefaultEndpointURI(t *testing.T) {
t, resource.TestCase{
ProviderFactories: map[string]func() (*schema.Provider, error){
"neon": func() (*schema.Provider, error) {
return New("accTest"), nil
return newAccTest(), nil
},
},
Steps: []resource.TestStep{
Expand Down
4 changes: 4 additions & 0 deletions internal/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,7 @@ func NewUnitTest() *schema.Provider {
}
return o
}

func newAccTest() *schema.Provider {
return New("accTest")
}

0 comments on commit fc272e5

Please sign in to comment.