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.
This commit is contained in:
Simon Hilchenbach 2022-01-22 21:52:45 +01:00
parent 3753731809
commit 22ba82a233
Signed by: shilch
GPG Key ID: A60AC63730A5DE56

View File

@ -14,6 +14,7 @@
// You should have received a copy of the GNU Affero General Public Licensee
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//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...)
}