From 22ba82a233925e201fe15a5b4996c18ee3fe8fb7 Mon Sep 17 00:00:00 2001 From: Simon Hilchenbach Date: Sat, 22 Jan 2022 21:52:45 +0100 Subject: [PATCH] Let mage test:unit generate a coverprofile Running mage test:coverage fails due to a missing cover.out coverprofile. Since test:coverage depends on test:unit, we let test:unit generate the cover.out file. --- magefile.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/magefile.go b/magefile.go index 1924e278e..026425473 100644 --- a/magefile.go +++ b/magefile.go @@ -14,6 +14,7 @@ // You should have received a copy of the GNU Affero General Public Licensee // along with this program. If not, see . +//go:build mage // +build mage package main @@ -349,7 +350,7 @@ func (Test) Unit() { mg.Deps(initVars) setApiPackages() // We run everything sequentially and not in parallel to prevent issues with real test databases - args := append([]string{"test", Goflags[0], "-p", "1", "-timeout", "20m"}, ApiPackages...) + args := append([]string{"test", Goflags[0], "-p", "1", "-coverprofile", "cover.out", "-timeout", "20m"}, ApiPackages...) runAndStreamOutput("go", args...) }