Skip to content

Latest commit

 

History

History
44 lines (28 loc) · 1.31 KB

tests.md

File metadata and controls

44 lines (28 loc) · 1.31 KB

Running tests

For testing we use the frameworks - Ginkgo and Gomega

Prerequisites

  • PostgreSQL running standalone or in a docker container
    docker run -d -p 5432:5432 --name prod_postgres --user postgres postgres

Unit and integration tests

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"

Coverage

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.