From 50b14cd145a47ceb920c59c65f8949acbc2b5ab9 Mon Sep 17 00:00:00 2001 From: Daniel Ivanov Date: Mon, 11 Oct 2021 15:02:27 +0300 Subject: [PATCH] docs(add): Add cmd for running units with coverage Signed-off-by: Daniel Ivanov --- docs/installation.md | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/docs/installation.md b/docs/installation.md index 40cc7c141..90ef02818 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -19,7 +19,7 @@ docker-compose pull In addition to Go, you will need to run [PostgreSQL](https://postgresql.org) v9.6 database. The easiest way you can do that is by running it from the docker image: -``` +```shell docker-compose up db ``` @@ -30,24 +30,29 @@ You can run the database separately, but you will have to edit the validator def ### Build application -``` +```shell go build cmd/* ``` ### Run application After you have run the database and compiled the node, you need to have the necessary [configuration](configuration.md) populated and run: -``` +```shell go run cmd/* ``` ### Unit Tests In order to run the unit tests, one must execute the following command: -``` +```shell go test $(go list ./... | grep -v e2e) ``` The command filters out the e2e tests that require an additional setup. +To get the coverage report execute the following command: +```shell +go test -cover $(go list ./... | grep -v e2e) +``` + ## Running via Docker Compose Docker Compose consists of scripts for the following components @@ -65,11 +70,11 @@ Before you run, [configure](configuration.md) the application updating the [node This file persists as a volume to the `Application` container. Finally, run: -``` +```shell docker-compose up ``` Shutting down the containers: -``` +```shell docker-compose down ```