mirror of
https://github.com/coredns/coredns.git
synced 2025-10-27 16:24:19 -04:00
Remove travis and move to github workflow (#4267)
Add github testing workflow, simplify the Makefile because that was complex because of Travis. Remove the fuzzing, needs to be re-added when that works properly with go modules (it has been disabled for quite some time). Multiple builds and files have been added so these tests can all run in parallel. Our testing now tests a couple of minutes, the codeql is by far the more expensive. Move metric's naming test to test/presubmit_test.go Add longer sleep in the TestAutoAXFR. Bye bye travis! Closes: #4266 Signed-off-by: Miek Gieben <miek@miek.nl>
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
"go/parser"
|
||||
"go/token"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"testing"
|
||||
@@ -400,3 +401,21 @@ func importtype(s string) string {
|
||||
}
|
||||
return "std"
|
||||
}
|
||||
|
||||
// TestMetricNaming tests the imports path used for metrics. It depends on faillint to be installed: go install github.com/fatih/faillint
|
||||
func TestPrometheusImports(t *testing.T) {
|
||||
if _, err := exec.LookPath("faillint"); err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Not executing TestPrometheusImports: faillint not found\n")
|
||||
return
|
||||
}
|
||||
|
||||
// make this multiline?
|
||||
p := `github.com/prometheus/client_golang/prometheus.{NewCounter,NewCounterVec,NewCounterVec,NewGauge,NewGaugeVec,NewGaugeFunc,NewHistorgram,NewHistogramVec,NewSummary,NewSummaryVec}=github.com/prometheus/client_golang/prometheus/promauto.{NewCounter,NewCounterVec,NewCounterVec,NewGauge,NewGaugeVec,NewGaugeFunc,NewHistorgram,NewHistogramVec,NewSummary,NewSummaryVec}`
|
||||
|
||||
cmd := exec.Command("faillint", "-paths", p, "./...")
|
||||
cmd.Dir = ".."
|
||||
out, err := cmd.CombinedOutput()
|
||||
if err != nil {
|
||||
t.Fatalf("Failed: %s\n%s", err, out)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user