Skip to content

Commit 8fc0175

Browse files
authored
Update CONTRIBUTING.md
1 parent dc43f56 commit 8fc0175

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

.github/CONTRIBUTING.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,30 @@ Please ask as many questions as you need, either directly in the issue or on [Di
4949
5. Build the code `make clean && make`
5050
> Note: if you don't have [`make`](https://www.ibm.com/docs/en/aix/7.2?topic=concepts-make-command), you can `cd` into `server` dir and build using the `go build` command
5151
6. Run binary `./build/server`
52+
53+
### Testing
54+
55+
Make sure you test before creating PR.
56+
57+
If you want to test for all the databases that authorizer supports you will have to run `mongodb` & `arangodb` instances locally.
58+
59+
Setup mongodb & arangodb using Docker
60+
61+
```
62+
docker run --name mongodb -d -p 27017:27017 mongo
63+
docker run --name arangodb -d -p 8529:8529 -e ARANGO_ROOT_PASSWORD=root arangodb/arangodb:3.8.4
64+
```
65+
> Note: If you are not making any changes in db schema / db operations, you can disable those db tests [here](https://github.com/authorizerdev/authorizer/blob/main/server/__test__/resolvers_test.go#L14)
66+
67+
If you are adding new resolver,
68+
1. create new resolver test file [here](https://github.com/authorizerdev/authorizer/tree/main/server/__test__)
69+
Naming convention filename: `resolver_name_test.go` function name: `resolverNameTest(s TestSetup, t *testing.T)`
70+
2. Add your tests [here](https://github.com/authorizerdev/authorizer/blob/main/server/__test__/resolvers_test.go#L38)
71+
72+
__Command to run tests:__
73+
74+
```sh
75+
make test
76+
```
77+
78+

0 commit comments

Comments
 (0)