From 1cafd4f2ce42c2fc61bcdfb5f5bf92fa735373aa Mon Sep 17 00:00:00 2001
From: Marc Di Luzio <marc.diluzio@gmail.com>
Date: Thu, 11 Jun 2020 18:55:53 +0100
Subject: [PATCH] Fix makefile and coverage output

---
 Makefile           | 9 ++++-----
 docker-compose.yml | 4 +++-
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/Makefile b/Makefile
index 5c56b8e..ac8fd5e 100644
--- a/Makefile
+++ b/Makefile
@@ -12,9 +12,8 @@ gen:
 	protoc --proto_path pkg/accounts --go_out=plugins=grpc:pkg/accounts/ --go_opt=paths=source_relative  pkg/accounts/accounts.proto
 
 test:
-	docker-compose up --build --exit-code-from=rove-tests --abort-on-container-exit
+	docker-compose up --build --exit-code-from=rove-tests --abort-on-container-exit rove-tests
+	go tool cover -html=/tmp/coverage-data/c.out -o /tmp/coverage.html
+	@echo Done, coverage data can be found in /tmp/coverage.html
 
-	# TODO: Collect and convert the coverage data to html
-	# go tool cover -html=/tmp/c.out -o /tmp/coverage.html
-
-.PHONY: install test
+.PHONY: build install test gen
diff --git a/docker-compose.yml b/docker-compose.yml
index f99139a..9eab597 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -42,7 +42,9 @@ services:
     environment:
       - ACCOUNTANT_ADDRESS=rove-accountant:8081
       - ROVE_SERVER_ADDRESS=rove-server:80
-    command: [ "go", "test", "-v", "./...", "--tags=integration", "-cover", "-coverprofile=/tmp/c.out", "-count", "1" ]
+    command: [ "go", "test", "-v", "./...", "--tags=integration", "-cover", "-coverprofile=/mnt/coverage-data/c.out", "-count", "1" ]
+    volumes:
+      - /tmp/coverage-data:/mnt/coverage-data:rw