Skip to content

Commit

Permalink
update test data
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonas Nicole committed May 7, 2024
1 parent 2d08e21 commit aba8061
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 85 deletions.
130 changes: 53 additions & 77 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,83 +10,59 @@
"request": "launch",
"mode": "test",
"program": "${workspaceRoot}/neo4j/data_source_database_test.go",
"args": [
"-test.v",
"-test.run",
"TestDatabases"
],
"args": ["-test.v", "-test.run", "TestDatabases"],
"envFile": "${workspaceRoot}/.vscode/private.env",
"showLog": true
},
{
"name": "resource_database_test",
"type": "go",
"request": "launch",
"mode": "test",
"program": "${workspaceRoot}/neo4j/resource_database_test.go",
"args": [
"-test.v",
"-test.run",
"TestResourceDatabase"
],
"envFile": "${workspaceRoot}/.vscode/private.env",
"showLog": true
},
{
"name": "resource_user_test",
"type": "go",
"request": "launch",
"mode": "test",
"program": "${workspaceRoot}/neo4j/resource_user_test.go",
"args": [
"-test.v",
"-test.run",
"TestResourceUser"
],
"envFile": "${workspaceRoot}/.vscode/private.env",
"showLog": true
},
{
"name": "resource_role_test",
"type": "go",
"request": "launch",
"mode": "test",
"program": "${workspaceRoot}/neo4j/resource_role_test.go",
"args": [
"-test.v",
"-test.run",
"TestResourceRole"
],
"envFile": "${workspaceRoot}/.vscode/private.env",
"showLog": true
},
{
"name": "resource_grant_test",
"type": "go",
"request": "launch",
"mode": "test",
"program": "${workspaceRoot}/neo4j/resource_grant_test.go",
"args": [
"-test.v",
"-test.run",
"TestResourceGrant"
],
"envFile": "${workspaceRoot}/.vscode/private.env",
"showLog": true
},
{
"name": "resource_grant_test_import",
"type": "go",
"request": "launch",
"mode": "test",
"program": "${workspaceRoot}/neo4j/resource_grant_test.go",
"args": [
"-test.v",
"-test.run",
"TestImportResourceGrant"
],
"envFile": "${workspaceRoot}/.vscode/private.env",
"showLog": true
}
},
{
"name": "resource_database_test",
"type": "go",
"request": "launch",
"mode": "test",
"program": "${workspaceRoot}/neo4j/resource_database_test.go",
"args": ["-test.v", "-test.run", "TestResourceDatabase"],
"envFile": "${workspaceRoot}/.vscode/private.env",
"showLog": true
},
{
"name": "resource_user_test",
"type": "go",
"request": "launch",
"mode": "test",
"program": "${workspaceRoot}/neo4j/resource_user_test.go",
"args": ["-test.v", "-test.run", "TestResourceUser"],
"envFile": "${workspaceRoot}/.vscode/private.env",
"showLog": true
},
{
"name": "resource_role_test",
"type": "go",
"request": "launch",
"mode": "test",
"program": "${workspaceRoot}/neo4j/resource_role_test.go",
"args": ["-test.v", "-test.run", "TestResourceRole"],
"envFile": "${workspaceRoot}/.vscode/private.env",
"showLog": true
},
{
"name": "resource_grant_test",
"type": "go",
"request": "launch",
"mode": "test",
"program": "${workspaceRoot}/neo4j/resource_grant_test.go",
"args": ["-test.v", "-test.run", "TestResourceGrant"],
"envFile": "${workspaceRoot}/.vscode/private.env",
"showLog": true
},
{
"name": "resource_grant_test_import",
"type": "go",
"request": "launch",
"mode": "test",
"program": "${workspaceRoot}/neo4j/resource_grant_test.go",
"args": ["-test.v", "-test.run", "TestImportResourceGrant"],
"envFile": "${workspaceRoot}/.vscode/private.env",
"showLog": true
}
]
}
}
6 changes: 1 addition & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,5 @@ install: build
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

testacc:
go clean -testcache
TF_ACC=1 go test $(TEST) -v $(TESTARGS) -timeout 120m
TF_ACC=1 go test terraform-provider-neo4j/neo4j -v $(TESTARGS) -timeout 120m
25 changes: 22 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,27 @@ go build -o terraform-provider-neo4j
`
## Run Neo4j

To run a Neo4j server for testing, you can run the following command:

`docker run -d --name neo4j -p 7474:7474 -p 7687:7687 --env=NEO4J_ACCEPT_LICENSE_AGREEMENT=yes --env NEO4J_AUTH=neo4j/password neo4j:enterprise`

> :warning: **Neo4j Enterprise is a licensed product. Please read the [official license documentation](https://neo4j.com/licensing)**
## Testing

- run a Neo4j server for testing:

```
docker run -d --name neo4j -p 7474:7474 -p 7687:7687 --env=NEO4J_ACCEPT_LICENSE_AGREEMENT=yes --env NEO4J_AUTH=neo4j/password neo4j:enterprise
```

> :warning: **Neo4j Enterprise is a licensed product. Please read the [official license documentation](https://neo4j.com/licensing)**
- Export the required variables:
```
export TF_LOG=DEBUG
export NEO4J_HOST=neo4j://localhost:7687
export NEO4J_USERNAME=neo4j
export NEO4J_PASSWORD=password
```

- Run the tests
```
make test
```

0 comments on commit aba8061

Please sign in to comment.