elesto-dao / elesto

The ElestoDAO node
Apache License 2.0
4 stars 1 forks source link

test: increase test coverage for keeper package (goal 80%) #145

Closed noandrea closed 2 years ago

noandrea commented 2 years ago
➜ go test -tags test -coverprofile=/tmp/c.out ./... && grep -v .pb. /tmp/c.out > /tmp/coverage.out && go tool cover -html=/tmp/coverage.out -o=/tmp/coverage.html && goverreport -coverprofile=/tmp/coverage.out -sort stmt
ok      github.com/elesto-dao/elesto/x/credential/keeper    0.061s  coverage: 83.9% of statements
+----------------------------------------------------------------+--------+---------+-------+---------+---------------+--------------+
|                              File                              | Blocks | Missing | Stmts | Missing | Block cover % | Stmt cover % |
+----------------------------------------------------------------+--------+---------+-------+---------+---------------+--------------+
| github.com/elesto-dao/elesto/x/credential/keeper/grpc_query.go |     27 |      10 |    39 |      14 |         62.96 |        64.10 |
| github.com/elesto-dao/elesto/x/credential/keeper/msg_server.go |     61 |      12 |   114 |      18 |         80.33 |        84.21 |
| github.com/elesto-dao/elesto/x/credential/keeper/credential.go |     24 |       1 |    43 |       1 |         95.83 |        97.67 |
| github.com/elesto-dao/elesto/x/credential/keeper/keeper.go     |      5 |       0 |     9 |       0 |        100.00 |       100.00 |
+----------------------------------------------------------------+--------+---------+-------+---------+---------------+--------------+
|                                                          Total |    117 |      23 |   205 |      33 |         80.34 |        83.90 |
+----------------------------------------------------------------+--------+---------+-------+---------+---------------+--------------+