forked from cerc-io/plugeth
appveyor, build: fix review requests
This commit is contained in:
parent
a2bc90d1d7
commit
54fcab20e3
@ -36,4 +36,4 @@ after_build:
|
|||||||
|
|
||||||
test_script:
|
test_script:
|
||||||
- set CGO_ENABLED=1
|
- set CGO_ENABLED=1
|
||||||
- go run build\ci.go test -vet -coverage -misspell
|
- go run build\ci.go test -vet -coverage
|
||||||
|
30
build/ci.go
30
build/ci.go
@ -289,10 +289,27 @@ func doTest(cmdline []string) {
|
|||||||
build.MustRun(goTool("vet", packages...))
|
build.MustRun(goTool("vet", packages...))
|
||||||
}
|
}
|
||||||
if *misspell {
|
if *misspell {
|
||||||
|
spellcheck(packages)
|
||||||
|
}
|
||||||
|
// Run the actual tests.
|
||||||
|
gotest := goTool("test")
|
||||||
|
// Test a single package at a time. CI builders are slow
|
||||||
|
// and some tests run into timeouts under load.
|
||||||
|
gotest.Args = append(gotest.Args, "-p", "1")
|
||||||
|
if *coverage {
|
||||||
|
gotest.Args = append(gotest.Args, "-covermode=atomic", "-cover")
|
||||||
|
}
|
||||||
|
gotest.Args = append(gotest.Args, packages...)
|
||||||
|
build.MustRun(gotest)
|
||||||
|
}
|
||||||
|
|
||||||
|
// spellcheck runs the client9/misspell spellchecker package on all Go, Cgo and
|
||||||
|
// test files in the requested packages.
|
||||||
|
func spellcheck(packages []string) {
|
||||||
// Ensure the spellchecker is available
|
// Ensure the spellchecker is available
|
||||||
build.MustRun(goTool("get", "github.com/client9/misspell/cmd/misspell"))
|
build.MustRun(goTool("get", "github.com/client9/misspell/cmd/misspell"))
|
||||||
|
|
||||||
// Windows (AppVeyor) chokes on long argument lists, check packages individualy
|
// Windows chokes on long argument lists, check packages individualy
|
||||||
for _, pkg := range packages {
|
for _, pkg := range packages {
|
||||||
// The spell checker doesn't work on packages, gather all .go files for it
|
// The spell checker doesn't work on packages, gather all .go files for it
|
||||||
out, err := goTool("list", "-f", "{{.Dir}}{{range .GoFiles}}\n{{.}}{{end}}{{range .CgoFiles}}\n{{.}}{{end}}{{range .TestGoFiles}}\n{{.}}{{end}}", pkg).CombinedOutput()
|
out, err := goTool("list", "-f", "{{.Dir}}{{range .GoFiles}}\n{{.}}{{end}}{{range .CgoFiles}}\n{{.}}{{end}}{{range .TestGoFiles}}\n{{.}}{{end}}", pkg).CombinedOutput()
|
||||||
@ -313,17 +330,6 @@ func doTest(cmdline []string) {
|
|||||||
build.MustRunCommand(filepath.Join(GOBIN, "misspell"), append([]string{"-error"}, sources...)...)
|
build.MustRunCommand(filepath.Join(GOBIN, "misspell"), append([]string{"-error"}, sources...)...)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Run the actual tests.
|
|
||||||
gotest := goTool("test")
|
|
||||||
// Test a single package at a time. CI builders are slow
|
|
||||||
// and some tests run into timeouts under load.
|
|
||||||
gotest.Args = append(gotest.Args, "-p", "1")
|
|
||||||
if *coverage {
|
|
||||||
gotest.Args = append(gotest.Args, "-covermode=atomic", "-cover")
|
|
||||||
}
|
|
||||||
gotest.Args = append(gotest.Args, packages...)
|
|
||||||
build.MustRun(gotest)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Release Packaging
|
// Release Packaging
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user