Skip to content

Commit be8a072

Browse files
committed
fix golint failures of test/e2e
1 parent 1284c99 commit be8a072

File tree

4 files changed

+17
-18
lines changed

4 files changed

+17
-18
lines changed

hack/.golint_failures

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,6 @@ staging/src/k8s.io/sample-apiserver/pkg/apis/wardle
590590
staging/src/k8s.io/sample-apiserver/pkg/apis/wardle/v1alpha1
591591
staging/src/k8s.io/sample-apiserver/pkg/registry/wardle/fischer
592592
staging/src/k8s.io/sample-apiserver/pkg/registry/wardle/flunder
593-
test/e2e
594593
test/e2e/autoscaling
595594
test/e2e/chaosmonkey
596595
test/e2e/common

test/e2e/examples.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import (
3434
e2elog "k8s.io/kubernetes/test/e2e/framework/log"
3535
"k8s.io/kubernetes/test/e2e/framework/testfiles"
3636

37-
. "github.com/onsi/ginkgo"
37+
"github.com/onsi/ginkgo"
3838
)
3939

4040
const (
@@ -46,7 +46,7 @@ var _ = framework.KubeDescribe("[Feature:Example]", func() {
4646

4747
var c clientset.Interface
4848
var ns string
49-
BeforeEach(func() {
49+
ginkgo.BeforeEach(func() {
5050
c = f.ClientSet
5151
ns = f.Namespace.Name
5252

@@ -63,7 +63,7 @@ var _ = framework.KubeDescribe("[Feature:Example]", func() {
6363
})
6464

6565
framework.KubeDescribe("Liveness", func() {
66-
It("liveness pods should be automatically restarted", func() {
66+
ginkgo.It("liveness pods should be automatically restarted", func() {
6767
test := "test/fixtures/doc-yaml/user-guide/liveness"
6868
execYaml := readFile(test, "exec-liveness.yaml.in")
6969
httpYaml := readFile(test, "http-liveness.yaml.in")
@@ -94,7 +94,7 @@ var _ = framework.KubeDescribe("[Feature:Example]", func() {
9494
wg.Done()
9595
}
9696

97-
By("Check restarts")
97+
ginkgo.By("Check restarts")
9898

9999
// Start the "actual test", and wait for both pods to complete.
100100
// If 2 fail: Something is broken with the test (or maybe even with liveness).
@@ -111,39 +111,39 @@ var _ = framework.KubeDescribe("[Feature:Example]", func() {
111111
})
112112

113113
framework.KubeDescribe("Secret", func() {
114-
It("should create a pod that reads a secret", func() {
114+
ginkgo.It("should create a pod that reads a secret", func() {
115115
test := "test/fixtures/doc-yaml/user-guide/secrets"
116116
secretYaml := readFile(test, "secret.yaml")
117117
podYaml := readFile(test, "secret-pod.yaml.in")
118118

119119
nsFlag := fmt.Sprintf("--namespace=%v", ns)
120120
podName := "secret-test-pod"
121121

122-
By("creating secret and pod")
122+
ginkgo.By("creating secret and pod")
123123
framework.RunKubectlOrDieInput(secretYaml, "create", "-f", "-", nsFlag)
124124
framework.RunKubectlOrDieInput(podYaml, "create", "-f", "-", nsFlag)
125125
err := framework.WaitForPodNoLongerRunningInNamespace(c, podName, ns)
126126
framework.ExpectNoError(err)
127127

128-
By("checking if secret was read correctly")
128+
ginkgo.By("checking if secret was read correctly")
129129
_, err = framework.LookForStringInLog(ns, "secret-test-pod", "test-container", "value-1", serverStartTimeout)
130130
framework.ExpectNoError(err)
131131
})
132132
})
133133

134134
framework.KubeDescribe("Downward API", func() {
135-
It("should create a pod that prints his name and namespace", func() {
135+
ginkgo.It("should create a pod that prints his name and namespace", func() {
136136
test := "test/fixtures/doc-yaml/user-guide/downward-api"
137137
podYaml := readFile(test, "dapi-pod.yaml.in")
138138
nsFlag := fmt.Sprintf("--namespace=%v", ns)
139139
podName := "dapi-test-pod"
140140

141-
By("creating the pod")
141+
ginkgo.By("creating the pod")
142142
framework.RunKubectlOrDieInput(podYaml, "create", "-f", "-", nsFlag)
143143
err := framework.WaitForPodNoLongerRunningInNamespace(c, podName, ns)
144144
framework.ExpectNoError(err)
145145

146-
By("checking if name and namespace were passed correctly")
146+
ginkgo.By("checking if name and namespace were passed correctly")
147147
_, err = framework.LookForStringInLog(ns, podName, "test-container", fmt.Sprintf("MY_POD_NAMESPACE=%v", ns), serverStartTimeout)
148148
framework.ExpectNoError(err)
149149
_, err = framework.LookForStringInLog(ns, podName, "test-container", fmt.Sprintf("MY_POD_NAME=%v", podName), serverStartTimeout)
@@ -154,5 +154,5 @@ var _ = framework.KubeDescribe("[Feature:Example]", func() {
154154

155155
func readFile(test, file string) string {
156156
from := filepath.Join(test, file)
157-
return commonutils.SubstituteImageName(string(testfiles.ReadOrDie(from, Fail)))
157+
return commonutils.SubstituteImageName(string(testfiles.ReadOrDie(from, ginkgo.Fail)))
158158
}

test/e2e/gke_local_ssd.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,18 @@ import (
2626
"k8s.io/kubernetes/test/e2e/framework"
2727
e2elog "k8s.io/kubernetes/test/e2e/framework/log"
2828

29-
. "github.com/onsi/ginkgo"
29+
"github.com/onsi/ginkgo"
3030
)
3131

3232
var _ = framework.KubeDescribe("GKE local SSD [Feature:GKELocalSSD]", func() {
3333

3434
f := framework.NewDefaultFramework("localssd")
3535

36-
BeforeEach(func() {
36+
ginkgo.BeforeEach(func() {
3737
framework.SkipUnlessProviderIs("gke")
3838
})
3939

40-
It("should write and read from node local SSD [Feature:GKELocalSSD]", func() {
40+
ginkgo.It("should write and read from node local SSD [Feature:GKELocalSSD]", func() {
4141
e2elog.Logf("Start local SSD test")
4242
createNodePoolWithLocalSsds("np-ssd")
4343
doTestWriteAndReadToLocalSsd(f)

test/e2e/gke_node_pools.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,18 @@ import (
2323
"k8s.io/kubernetes/test/e2e/framework"
2424
e2elog "k8s.io/kubernetes/test/e2e/framework/log"
2525

26-
. "github.com/onsi/ginkgo"
26+
"github.com/onsi/ginkgo"
2727
)
2828

2929
var _ = framework.KubeDescribe("GKE node pools [Feature:GKENodePool]", func() {
3030

3131
f := framework.NewDefaultFramework("node-pools")
3232

33-
BeforeEach(func() {
33+
ginkgo.BeforeEach(func() {
3434
framework.SkipUnlessProviderIs("gke")
3535
})
3636

37-
It("should create a cluster with multiple node pools [Feature:GKENodePool]", func() {
37+
ginkgo.It("should create a cluster with multiple node pools [Feature:GKENodePool]", func() {
3838
e2elog.Logf("Start create node pool test")
3939
testCreateDeleteNodePool(f, "test-pool")
4040
})

0 commit comments

Comments
 (0)