Skip to content

Commit

Permalink
Upgrade packages, tests and documentation
Browse files Browse the repository at this point in the history
Signed-off-by: Beshoy Girgis <[email protected]>
  • Loading branch information
egyptianbman committed Dec 15, 2023
1 parent 1f12db8 commit 92c5a18
Show file tree
Hide file tree
Showing 15 changed files with 2,168 additions and 113 deletions.
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ install: build
mkdir -p ~/.terraform.d/plugins/${HOSTNAME}/${NAMESPACE}/${NAME}/${VERSION}/${OS_ARCH}
mv ${BINARY} ~/.terraform.d/plugins/${HOSTNAME}/${NAMESPACE}/${NAME}/${VERSION}/${OS_ARCH}

test:
go test -i $(TEST) || exit 1
echo $(TEST) | xargs -t -n4 go test $(TESTARGS) -timeout=30s -parallel=4
test:
go test -i $(TEST) || exit 1
echo $(TEST) | xargs -t -n4 go test $(TESTARGS) -timeout=30s -parallel=4

testacc:
TF_ACC=1 go test $(TEST) -v $(TESTARGS) -timeout 120m
testacc:
TF_ACC=1 go test $(TEST) -v $(TESTARGS) -timeout 120m
4 changes: 2 additions & 2 deletions docs/resources/database.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ The following arguments are exported:
neo4j_database resource can be importe using the resource name, e.g.

```bash
terraform import neo4j_user.my_database mydatabase
```
terraform import neo4j_database.my_database mydatabase
```
4 changes: 2 additions & 2 deletions docs/resources/role.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ The following arguments are exported:
neo4j_database resource can be importe using the resource name, e.g.

```bash
terraform import neo4j_user.my_role myRole
```
terraform import neo4j_role.my_role myRole
```
26 changes: 24 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,29 @@ module terraform-provider-neo4j
go 1.16

require (
github.com/hashicorp/terraform-plugin-sdk v1.17.2 // indirect
github.com/hashicorp/terraform-plugin-sdk/v2 v2.8.0
github.com/Masterminds/semver v1.5.0 // indirect
github.com/Masterminds/sprig v2.22.0+incompatible // indirect
github.com/ProtonMail/go-crypto v0.0.0-20230923063757-afb1ddc0824c // indirect
github.com/agext/levenshtein v1.2.3 // indirect
github.com/andybalholm/crlf v0.0.0-20171020200849-670099aa064f // indirect
github.com/apparentlymart/go-cidr v1.0.1 // indirect
github.com/apparentlymart/go-dump v0.0.0-20190214190832-042adf3cf4a0 // indirect
github.com/aws/aws-sdk-go v1.37.0 // indirect
github.com/cloudflare/circl v1.3.6 // indirect
github.com/fatih/color v1.16.0 // indirect
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-getter v1.5.3 // indirect
github.com/hashicorp/go-hclog v1.6.2 // indirect
github.com/hashicorp/terraform-plugin-sdk/v2 v2.31.0
github.com/konsorten/go-windows-terminal-sequences v1.0.1 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
github.com/neo4j/neo4j-go-driver/v4 v4.3.3
github.com/neo4j/neo4j-go-driver/v5 v5.15.0
github.com/nsf/jsondiff v0.0.0-20200515183724-f29ed568f4ce // indirect
github.com/oklog/run v1.1.0 // indirect
github.com/vmihailenco/msgpack/v4 v4.3.12 // indirect
golang.org/x/net v0.19.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0 // indirect
)
2,176 changes: 2,115 additions & 61 deletions go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion neo4j/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
neo4j "github.com/neo4j/neo4j-go-driver/v4/neo4j"
neo4j "github.com/neo4j/neo4j-go-driver/v5/neo4j"
)

type Neo4jConfiguration struct {
Expand Down
14 changes: 9 additions & 5 deletions neo4j/provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,15 @@ func testAccPreCheck(t *testing.T) {
}

func testAccProviderConfig() string {
return fmt.Sprint(`
return fmt.Sprintf(`
provider "neo4j" {
host = "neo4j://localhost:7687"
username = "neo4j"
password = "password"
host = "%s"
username = "%s"
password = "%s"
}
`)
`,
os.Getenv("NEO4J_HOST"),
os.Getenv("NEO4J_USERNAME"),
os.Getenv("NEO4J_PASSWORD"),
)
}
2 changes: 1 addition & 1 deletion neo4j/resource_database.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
neo4j "github.com/neo4j/neo4j-go-driver/v4/neo4j"
neo4j "github.com/neo4j/neo4j-go-driver/v5/neo4j"
)

func resourceDatabase() *schema.Resource {
Expand Down
5 changes: 0 additions & 5 deletions neo4j/resource_database_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ func TestResourceDatabase(t *testing.T) {

func testResourceDatabaseConfig_basic() string {
return fmt.Sprint(`
provider "neo4j" {
host = "neo4j://localhost:7687"
username = "neo4j"
password = "password"
}
resource "neo4j_database" "test" {
name = "mydatabase2"
}
Expand Down
2 changes: 1 addition & 1 deletion neo4j/resource_grant.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
neo4j "github.com/neo4j/neo4j-go-driver/v4/neo4j"
neo4j "github.com/neo4j/neo4j-go-driver/v5/neo4j"
)

func resourceGrant() *schema.Resource {
Expand Down
14 changes: 2 additions & 12 deletions neo4j/resource_grant_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/v2/terraform"
neo4j "github.com/neo4j/neo4j-go-driver/v4/neo4j"
neo4j "github.com/neo4j/neo4j-go-driver/v5/neo4j"
)

func TestResourceGrantV2(t *testing.T) {
Expand Down Expand Up @@ -88,17 +88,12 @@ func testAccGrantV2Exists(rn string) resource.TestCheckFunc {

func testResourceGrantV2Config_basic() string {
return fmt.Sprint(`
provider "neo4j" {
host = "neo4j://localhost:7687"
username = "neo4j"
password = "password"
}
resource "neo4j_role" "test" {
name = "testRole"
}
resource "neo4j_user" "test" {
name = "testUser"
password = "test"
password = "testpassword"
roles = [
neo4j_role.test.name
]
Expand Down Expand Up @@ -190,11 +185,6 @@ func testResourceGrantV2Config_basic() string {

func testResourceGrantV2Config_import() string {
return fmt.Sprint(`
provider "neo4j" {
host = "neo4j://localhost:7687"
username = "neo4j"
password = "password"
}
resource "neo4j_role" "reader" {
name = "reader"
}
Expand Down
2 changes: 1 addition & 1 deletion neo4j/resource_role.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
neo4j "github.com/neo4j/neo4j-go-driver/v4/neo4j"
neo4j "github.com/neo4j/neo4j-go-driver/v5/neo4j"
)

func resourceRole() *schema.Resource {
Expand Down
7 changes: 1 addition & 6 deletions neo4j/resource_role_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/v2/terraform"
neo4j "github.com/neo4j/neo4j-go-driver/v4/neo4j"
neo4j "github.com/neo4j/neo4j-go-driver/v5/neo4j"
)

func TestResourceRole(t *testing.T) {
Expand Down Expand Up @@ -55,11 +55,6 @@ func testAccRoleExists(rn string) resource.TestCheckFunc {

func testResourceRoleConfig_basic() string {
return fmt.Sprint(`
provider "neo4j" {
host = "neo4j://localhost:7687"
username = "neo4j"
password = "password"
}
resource "neo4j_role" "test" {
name = "test"
}
Expand Down
2 changes: 1 addition & 1 deletion neo4j/resource_user.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
neo4j "github.com/neo4j/neo4j-go-driver/v4/neo4j"
neo4j "github.com/neo4j/neo4j-go-driver/v5/neo4j"
)

func resourceUser() *schema.Resource {
Expand Down
11 changes: 3 additions & 8 deletions neo4j/resource_user_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/v2/terraform"
neo4j "github.com/neo4j/neo4j-go-driver/v4/neo4j"
neo4j "github.com/neo4j/neo4j-go-driver/v5/neo4j"
)

func TestResourceUser(t *testing.T) {
Expand All @@ -19,7 +19,7 @@ func TestResourceUser(t *testing.T) {
Check: resource.ComposeTestCheckFunc(
testAccUserExists("neo4j_user.test"),
resource.TestCheckResourceAttr("neo4j_user.test", "name", "testUser"),
resource.TestCheckResourceAttr("neo4j_user.test", "password", "test"),
resource.TestCheckResourceAttr("neo4j_user.test", "password", "testpassword"),
),
},
},
Expand Down Expand Up @@ -55,14 +55,9 @@ func testAccUserExists(rn string) resource.TestCheckFunc {

func testResourceUserConfig_basic() string {
return fmt.Sprint(`
provider "neo4j" {
host = "neo4j://localhost:7687"
username = "neo4j"
password = "password"
}
resource "neo4j_user" "test" {
name = "testUser"
password = "test"
password = "testpassword"
roles = [
neo4j_role.test_role.name
]
Expand Down

0 comments on commit 92c5a18

Please sign in to comment.