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:
parent
3753731809
commit
22ba82a233
|
@ -14,6 +14,7 @@
|
||||||
// You should have received a copy of the GNU Affero General Public Licensee
|
// 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/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
//go:build mage
|
||||||
// +build mage
|
// +build mage
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
@ -349,7 +350,7 @@ func (Test) Unit() {
|
||||||
mg.Deps(initVars)
|
mg.Deps(initVars)
|
||||||
setApiPackages()
|
setApiPackages()
|
||||||
// We run everything sequentially and not in parallel to prevent issues with real test databases
|
// 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...)
|
runAndStreamOutput("go", args...)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue