Add aliases and comments
This commit is contained in:
parent
26ff6ec7a4
commit
087c1b352a
10
magefile.go
10
magefile.go
|
@ -45,6 +45,11 @@ var (
|
|||
BinLocation = ""
|
||||
PkgVersion = "master"
|
||||
ApiPackages = []string{}
|
||||
|
||||
// Aliases are mage aliases of targets
|
||||
Aliases = map[string]interface{}{
|
||||
"integration-test": IntegrationTest,
|
||||
}
|
||||
)
|
||||
|
||||
func setVersion() {
|
||||
|
@ -145,7 +150,7 @@ func runAndStreamOutput(cmd string, args ...string) {
|
|||
}
|
||||
}
|
||||
|
||||
// Clean all build, executable and bindata files.
|
||||
// Cleans all build, executable and bindata files.
|
||||
func Clean() error {
|
||||
if err := exec.Command("go", "clean", "./...").Run(); err != nil {
|
||||
return err
|
||||
|
@ -162,17 +167,20 @@ func Clean() error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// Runs all tests except integration tests
|
||||
func Test() {
|
||||
// We run everything sequentially and not in parallel to prevent issues with real test databases
|
||||
args := append([]string{"test", Goflags[0], "-p", "1"}, ApiPackages...)
|
||||
runAndStreamOutput("go", args...)
|
||||
}
|
||||
|
||||
// Runs the tests and builds the coverage html file from coverage output
|
||||
func TestCoverage() {
|
||||
mg.Deps(Test)
|
||||
runAndStreamOutput("go", "tool", "cover", "-html=cover.out", "-o", "cover.html")
|
||||
}
|
||||
|
||||
// Runs the integration tests
|
||||
func IntegrationTest() {
|
||||
// We run everything sequentially and not in parallel to prevent issues with real test databases
|
||||
runAndStreamOutput("go", "test", Goflags[0], "-p", "1", PACKAGE+"/pkg/integrations")
|
||||
|
|
Loading…
Reference in New Issue