Extend presubmit to covert test and request (#1846)

Fix the casing *and* fix use of context as we were still referencing
the non-std lib context - no wondering how this could have worked...
This commit is contained in:
Miek Gieben 2018-06-01 15:12:49 +01:00 committed by GitHub
parent 0df5eb98fe
commit 4f0b36e57e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 20 additions and 20 deletions

View file

@ -5,7 +5,7 @@ SYSTEM:=
CHECKS:=check godeps
VERBOSE:=-v
GOPATH?=$(HOME)/go
PRESUBMIT:=core coremain plugin
PRESUBMIT:=core coremain plugin test request
all: coredns

View file

@ -2,13 +2,13 @@
package request
import (
"context"
"net"
"strings"
"github.com/coredns/coredns/plugin/pkg/edns"
"github.com/miekg/dns"
"golang.org/x/net/context"
)
// Request contains some connection state and is useful in plugin.

View file

@ -14,7 +14,7 @@ func TestLookupCache(t *testing.T) {
// Start auth. CoreDNS holding the auth zone.
name, rm, err := test.TempFile(".", exampleOrg)
if err != nil {
t.Fatalf("failed to create zone: %s", err)
t.Fatalf("Failed to create zone: %s", err)
}
defer rm()

View file

@ -34,7 +34,7 @@ func TestLookupDS(t *testing.T) {
t.Parallel()
name, rm, err := TempFile(".", miekNL)
if err != nil {
t.Fatalf("failed to create zone: %s", err)
t.Fatalf("Failed to create zone: %s", err)
}
defer rm()

View file

@ -3,6 +3,7 @@
package test
import (
"context"
"io/ioutil"
"log"
"testing"
@ -13,7 +14,6 @@ import (
"github.com/coredns/coredns/request"
"github.com/miekg/dns"
"golang.org/x/net/context"
)
// uses some stuff from etcd_tests.go

View file

@ -3,6 +3,7 @@
package test
import (
"context"
"encoding/json"
"io/ioutil"
"log"
@ -17,7 +18,6 @@ import (
etcdc "github.com/coreos/etcd/client"
"github.com/miekg/dns"
"golang.org/x/net/context"
)
func etcdPlugin() *etcd.Etcd {

View file

@ -36,7 +36,7 @@ func testExternalPluginCompile(t *testing.T) {
}
if !strings.Contains(string(out), "dns.example") {
t.Fatal("dns.example plugin should be there")
t.Fatal("Plugin dns.example should be there")
}
}
@ -44,7 +44,7 @@ func run(t *testing.T, c *exec.Cmd) ([]byte, error) {
c.Dir = ".."
out, err := c.Output()
if err != nil {
return nil, fmt.Errorf("run: failed to run %s %s: %q", c.Args[0], c.Args[1], err)
return nil, fmt.Errorf("Run: failed to run %s %s: %q", c.Args[0], c.Args[1], err)
}
return out, nil

View file

@ -6,7 +6,7 @@ func TestTempFile(t *testing.T) {
t.Parallel()
_, f, e := TempFile(".", "test")
if e != nil {
t.Fatalf("failed to create temp file: %s", e)
t.Fatalf("Failed to create temp file: %s", e)
}
defer f()
}

View file

@ -1,13 +1,13 @@
package test
import (
"context"
"io/ioutil"
"log"
"testing"
"time"
"github.com/miekg/dns"
"golang.org/x/net/context"
"google.golang.org/grpc"
"github.com/coredns/coredns/pb"

View file

@ -15,7 +15,7 @@ func TestLookupBalanceRewriteCacheDnssec(t *testing.T) {
t.Parallel()
name, rm, err := test.TempFile(".", exampleOrg)
if err != nil {
t.Fatalf("failed to create zone: %s", err)
t.Fatalf("Failed to create zone: %s", err)
}
defer rm()
rm1 := createKeyFile(t)

View file

@ -17,7 +17,7 @@ func benchmarkLookupBalanceRewriteCache(b *testing.B) {
t := new(testing.T)
name, rm, err := test.TempFile(".", exampleOrg)
if err != nil {
t.Fatalf("failed to create zone: %s", err)
t.Fatalf("Failed to create zone: %s", err)
}
defer rm()

View file

@ -38,7 +38,7 @@ func TestProxyWithHTTPCheckOK(t *testing.T) {
name, rm, err := test.TempFile(".", exampleOrg)
if err != nil {
t.Fatalf("failed to create zone: %s", err)
t.Fatalf("Failed to create zone: %s", err)
}
defer rm()

View file

@ -16,7 +16,7 @@ func TestLookupProxy(t *testing.T) {
t.Parallel()
name, rm, err := test.TempFile(".", exampleOrg)
if err != nil {
t.Fatalf("failed to create zone: %s", err)
t.Fatalf("Failed to create zone: %s", err)
}
defer rm()
@ -55,7 +55,7 @@ func TestLookupDnsWithForcedTcp(t *testing.T) {
t.Parallel()
name, rm, err := test.TempFile(".", exampleOrg)
if err != nil {
t.Fatalf("failed to create zone: %s", err)
t.Fatalf("Failed to create zone: %s", err)
}
defer rm()
@ -94,7 +94,7 @@ func BenchmarkProxyLookup(b *testing.B) {
t := new(testing.T)
name, rm, err := test.TempFile(".", exampleOrg)
if err != nil {
t.Fatalf("failed to created zone: %s", err)
t.Fatalf("Failed to created zone: %s", err)
}
defer rm()
@ -105,12 +105,12 @@ func BenchmarkProxyLookup(b *testing.B) {
i, err := CoreDNSServer(corefile)
if err != nil {
t.Fatalf("could not get CoreDNS serving instance: %s", err)
t.Fatalf("Could not get CoreDNS serving instance: %s", err)
}
udp, _ := CoreDNSServerPorts(i, 0)
if udp == "" {
t.Fatalf("could not get udp listening port")
t.Fatalf("Could not get udp listening port")
}
defer i.Stop()

View file

@ -40,7 +40,7 @@ func TestEmptySecondaryZone(t *testing.T) {
func TestSecondaryZoneTransfer(t *testing.T) {
name, rm, err := test.TempFile(".", exampleOrg)
if err != nil {
t.Fatalf("failed to create zone: %s", err)
t.Fatalf("Failed to create zone: %s", err)
}
defer rm()

View file

@ -16,7 +16,7 @@ func TestLookupWildcard(t *testing.T) {
t.Parallel()
name, rm, err := test.TempFile(".", exampleOrg)
if err != nil {
t.Fatalf("failed to create zone: %s", err)
t.Fatalf("Failed to create zone: %s", err)
}
defer rm()