For testing we use the frameworks - Ginkgo and Gomega
- PostgreSQL running standalone or in a docker container
docker run -d -p 5432:5432 --name prod_postgres --user postgres postgres
Currently unit and integration tests are run with one command.
To execute tests, run the following command:
make test
If PostgreSQL is not running with default settings, the connection URI can be changed by providing a commandline argument:
make test TEST_FLAGS="--storage.uri=postgres://postgres:postgres@localhost:5432/postgres?sslmode=disable"
To generate test coverage report run the following command:
make coverage
If PostgreSQL is not running with default settings, the connection URI can be changed by providing a commandline argument:
make coverage TEST_FLAGS="--storage.uri=postgres://postgres:postgres@localhost:5432/postgres?sslmode=disable"
The above command will create a file called coverage.html
at the root of the project.
Note: All commandline arguments that can be used to configure the Service Manager on startup can also be passed to make test
and make coverage
via TEST_FLAGS
.