Skip to content

Commit

Permalink
Fix acceptance tests trigger.
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitry Kisler <[email protected]>
  • Loading branch information
kislerdm committed Mar 10, 2024
1 parent 9d1b2cf commit 38e5665
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 2 deletions.
2 changes: 1 addition & 1 deletion GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ test: ## Runs unit tests.
@ echo $(TEST) | xargs -t -n4 go test $(TESTARGS) -timeout=30s -parallel=4

testacc: ## Runs acceptance tests.
@ TF_ACC=1 go test -v -timeout 120m ./... -run TestAcc
@ TF_ACC=1 go test -v -timeout 120m ./...

docu: ## Generates docu.
@ go generate
File renamed without changes.
9 changes: 8 additions & 1 deletion internal/provider/resource_branch_test.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
package provider

import "testing"
import (
"os"
"testing"
)

func Test_isValidBranchID(t *testing.T) {
if os.Getenv("TF_ACC") == "1" {
t.Skip("acceptance tests are running")
}

type args struct {
s string
}
Expand Down
17 changes: 17 additions & 0 deletions internal/provider/resource_project_permission_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,18 @@ package provider
import (
"context"
"errors"
"os"
"testing"
"time"

neon "github.com/kislerdm/neon-sdk-go"
)

func Test_resourceProjectPermissionCreate(t *testing.T) {
if os.Getenv("TF_ACC") == "1" {
t.Skip("acceptance tests are running")
}

t.Parallel()

t.Run("shall create permission for [email protected]", func(t *testing.T) {
Expand Down Expand Up @@ -86,6 +91,10 @@ func Test_resourceProjectPermissionCreate(t *testing.T) {
}

func Test_resourceProjectPermissionDelete(t *testing.T) {
if os.Getenv("TF_ACC") == "1" {
t.Skip("acceptance tests are running")
}

t.Parallel()

t.Run("shall revoke existing permission", func(t *testing.T) {
Expand Down Expand Up @@ -154,6 +163,10 @@ func Test_resourceProjectPermissionDelete(t *testing.T) {
}

func Test_resourceProjectPermissionRead(t *testing.T) {
if os.Getenv("TF_ACC") == "1" {
t.Skip("acceptance tests are running")
}

t.Parallel()
const (
projectID = "myproject"
Expand Down Expand Up @@ -240,6 +253,10 @@ func Test_resourceProjectPermissionRead(t *testing.T) {
}

func Test_resourceProjectPermissionImport(t *testing.T) {
if os.Getenv("TF_ACC") == "1" {
t.Skip("acceptance tests are running")
}

t.Parallel()

const (
Expand Down
9 changes: 9 additions & 0 deletions internal/provider/resource_project_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package provider

import (
"context"
"os"
"reflect"
"testing"
"time"
Expand All @@ -10,6 +11,10 @@ import (
)

func Test_resourceProjectCreate(t *testing.T) {
if os.Getenv("TF_ACC") == "1" {
t.Skip("acceptance tests are running")
}

t.Parallel()

t.Run(
Expand Down Expand Up @@ -289,6 +294,10 @@ func Test_resourceProjectCreate(t *testing.T) {
}

func Test_newDbConnectionInfo(t *testing.T) {
if os.Getenv("TF_ACC") == "1" {
t.Skip("acceptance tests are running")
}

t.Run("shall use the values with the lowest CreatedAt to define the default database, role and endpoint",
func(t *testing.T) {
// see for details: https://github.com/kislerdm/terraform-provider-neon/issues/83
Expand Down

0 comments on commit 38e5665

Please sign in to comment.