forked from luthermonson/go-proxmox
/
test.go
31 lines (25 loc) · 824 Bytes
/
test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package test
import (
"fmt"
"github.com/magefile/mage/sh"
)
// Unit run all unit tests
func Unit() error {
fmt.Println("Running Tests...")
return sh.RunV("go", "test")
}
// Build run a test build to confirm no compilation errors
func Build() error {
fmt.Println("Running Build...")
return sh.RunV("go", "build", "-tags", "test")
}
// Coverage run all unit tests and output coverage
func Coverage() error {
fmt.Println("Running Tests with Coverage...")
return sh.RunV("go", "test", "-race", "-coverprofile=coverage.txt", "-covermode=atomic")
}
// Integration run all integration tests against a pve node, see ./tests/integration
func Integration() error {
fmt.Println("Running Integration Tests against a PVE Cluster...")
return sh.RunV("go", "test", "./tests/integration", "-tags", "nodes containers vms")
}