- Go 1.17 or lastest version already installed on your local machine.
- 2 Postgresql servers (one serves as normal database server, and another for running tests). You can use a disposable docker instance for tests
- Ensure you postgres instances are running
- Create and populate a
app.env
file on the project root with its keys and corresponding values as listed inapp-sample.env
- Run from project root directory
$ go run main.go
- Ensure you postgres instances are running
- Create and populate a
app.env
file on the project root with its keys and corresponding values as listed inapp-sample.env
- Build Docker Image by running this command on the project root
$ docker build -t <image tag> .
$ ./build-image.sh
Run image built with above command with
$ docker run -d -p <port>:<port> <image tag>
e.g docker run -d -p 8005:8005 vesicash-auth-ms
- Automated unit and integration tests done with golang's builtin
testing
package.
To run one test file:
$ go test -v ./tests/<file name> -timeout 99999s
To run all tests:
$ go test -v ./tests/<folder name>/<file name> -timeout 99999s
$ go test -v ./tests/... -timeout 99999s
NB: Always add timeout tag to prevent early timeout