Unverified Commit 4d73d99f authored by Kubernetes Prow Robot's avatar Kubernetes Prow Robot Committed by GitHub

Merge pull request #75705 from oomichi/golint-e2e-framework-f

Fix golint failures of e2e/framework/f*.go
parents e1866740 e28fb1a1
...@@ -22,12 +22,14 @@ import ( ...@@ -22,12 +22,14 @@ import (
"sync" "sync"
) )
// FlakeReport is a struct for managing the flake report.
type FlakeReport struct { type FlakeReport struct {
lock sync.RWMutex lock sync.RWMutex
Flakes []string `json:"flakes"` Flakes []string `json:"flakes"`
FlakeCount int `json:"flakeCount"` FlakeCount int `json:"flakeCount"`
} }
// NewFlakeReport returns a new flake report.
func NewFlakeReport() *FlakeReport { func NewFlakeReport() *FlakeReport {
return &FlakeReport{ return &FlakeReport{
Flakes: []string{}, Flakes: []string{},
...@@ -62,12 +64,14 @@ func (f *FlakeReport) RecordFlakeIfError(err error, optionalDescription ...inter ...@@ -62,12 +64,14 @@ func (f *FlakeReport) RecordFlakeIfError(err error, optionalDescription ...inter
f.FlakeCount++ f.FlakeCount++
} }
// GetFlakeCount returns the flake count.
func (f *FlakeReport) GetFlakeCount() int { func (f *FlakeReport) GetFlakeCount() int {
f.lock.RLock() f.lock.RLock()
defer f.lock.RUnlock() defer f.lock.RUnlock()
return f.FlakeCount return f.FlakeCount
} }
// PrintHumanReadable returns string of flake report.
func (f *FlakeReport) PrintHumanReadable() string { func (f *FlakeReport) PrintHumanReadable() string {
f.lock.RLock() f.lock.RLock()
defer f.lock.RUnlock() defer f.lock.RUnlock()
...@@ -80,12 +84,14 @@ func (f *FlakeReport) PrintHumanReadable() string { ...@@ -80,12 +84,14 @@ func (f *FlakeReport) PrintHumanReadable() string {
return buf.String() return buf.String()
} }
// PrintJSON returns the summary of frake report with JSON format.
func (f *FlakeReport) PrintJSON() string { func (f *FlakeReport) PrintJSON() string {
f.lock.RLock() f.lock.RLock()
defer f.lock.RUnlock() defer f.lock.RUnlock()
return PrettyPrintJSON(f) return PrettyPrintJSON(f)
} }
// SummaryKind returns the summary of flake report.
func (f *FlakeReport) SummaryKind() string { func (f *FlakeReport) SummaryKind() string {
return "FlakeReport" return "FlakeReport"
} }
...@@ -60,7 +60,7 @@ func networkingIPerfTest(isIPv6 bool) { ...@@ -60,7 +60,7 @@ func networkingIPerfTest(isIPv6 bool) {
expectedBandwidth := int(float64(maxBandwidthBits) / float64(totalPods)) expectedBandwidth := int(float64(maxBandwidthBits) / float64(totalPods))
Expect(totalPods).NotTo(Equal(0)) Expect(totalPods).NotTo(Equal(0))
appName := "iperf-e2e" appName := "iperf-e2e"
err, _ := f.CreateServiceForSimpleAppWithPods( _, err := f.CreateServiceForSimpleAppWithPods(
8001, 8001,
8002, 8002,
appName, appName,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment