Go SDK for proof -- capture visual evidence of test execution.
Thin wrapper around the proof CLI. If the binary isn't on PATH, it auto-downloads from GitHub Releases on first use.
go get github.com/automazeio/proof-gopackage main
import (
"fmt"
"github.com/automazeio/proof-go/proof"
)
func main() {
p, err := proof.New(proof.Config{
AppName: "my-app",
ProofDir: "./evidence",
})
if err != nil {
panic(err)
}
rec, err := p.Capture(proof.CaptureOptions{
Command: "go test ./... -v",
Mode: "terminal",
Label: "unit-tests",
})
if err != nil {
panic(err)
}
fmt.Println(rec.Path) // /abs/path/unit-tests-143012.html
fmt.Println(rec.Duration) // 4300
reportPath, _ := p.Report(proof.ReportOptions{})
fmt.Println(reportPath)
}func TestMain(m *testing.M) {
p, _ := proof.New(proof.Config{
AppName: "my-service",
ProofDir: "./evidence",
})
p.Capture(proof.CaptureOptions{
Command: "go test ./... -v -count=1",
Mode: "terminal",
Label: "all-tests",
})
code := m.Run()
p.Report(proof.ReportOptions{})
os.Exit(code)
}proofon PATH~/.proof/bin/proof-<version>(cached from previous download)- Auto-download from GitHub Releases (~100MB, one time)
curl -fsSL https://automaze.io/install/proof | sh