Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
14d9764b
Commit
14d9764b
authored
Apr 14, 2016
by
k8s-merge-robot
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #24271 from pwittrock/flaky
Automatic merge from submit-queue Only output log files if tests fail
parents
f4473af9
e88fdb85
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
7 deletions
+34
-7
e2e_node_suite_test.go
test/e2e_node/e2e_node_suite_test.go
+34
-7
No files found.
test/e2e_node/e2e_node_suite_test.go
View file @
14d9764b
...
@@ -30,6 +30,8 @@ import (
...
@@ -30,6 +30,8 @@ import (
"github.com/golang/glog"
"github.com/golang/glog"
.
"github.com/onsi/ginkgo"
.
"github.com/onsi/ginkgo"
"github.com/onsi/ginkgo/config"
"github.com/onsi/ginkgo/types"
.
"github.com/onsi/gomega"
.
"github.com/onsi/gomega"
)
)
...
@@ -46,7 +48,8 @@ func TestE2eNode(t *testing.T) {
...
@@ -46,7 +48,8 @@ func TestE2eNode(t *testing.T) {
flag
.
Parse
()
flag
.
Parse
()
rand
.
Seed
(
time
.
Now
()
.
UTC
()
.
UnixNano
())
rand
.
Seed
(
time
.
Now
()
.
UTC
()
.
UnixNano
())
RegisterFailHandler
(
Fail
)
RegisterFailHandler
(
Fail
)
RunSpecs
(
t
,
"E2eNode Suite"
)
reporters
:=
[]
Reporter
{
&
LogReporter
{}}
RunSpecsWithDefaultAndCustomReporters
(
t
,
"E2eNode Suite"
,
reporters
)
}
}
// Setup the kubelet on the node
// Setup the kubelet on the node
...
@@ -78,15 +81,39 @@ var _ = AfterSuite(func() {
...
@@ -78,15 +81,39 @@ var _ = AfterSuite(func() {
if
e2es
!=
nil
&&
*
startServices
&&
*
stopServices
{
if
e2es
!=
nil
&&
*
startServices
&&
*
stopServices
{
glog
.
Infof
(
"Stopping node services..."
)
glog
.
Infof
(
"Stopping node services..."
)
e2es
.
stop
()
e2es
.
stop
()
}
})
var
_
Reporter
=
&
LogReporter
{}
type
LogReporter
struct
{}
func
(
lr
*
LogReporter
)
SpecSuiteWillBegin
(
config
config
.
GinkgoConfigType
,
summary
*
types
.
SuiteSummary
)
{
b
:=
&
bytes
.
Buffer
{}
b
:=
&
bytes
.
Buffer
{}
b
.
WriteString
(
"******************************************************
\n
"
)
glog
.
V
(
2
)
.
Infof
(
b
.
String
())
}
func
(
lr
*
LogReporter
)
BeforeSuiteDidRun
(
setupSummary
*
types
.
SetupSummary
)
{}
func
(
lr
*
LogReporter
)
SpecWillRun
(
specSummary
*
types
.
SpecSummary
)
{}
func
(
lr
*
LogReporter
)
SpecDidComplete
(
specSummary
*
types
.
SpecSummary
)
{}
func
(
lr
*
LogReporter
)
AfterSuiteDidRun
(
setupSummary
*
types
.
SetupSummary
)
{}
func
(
lr
*
LogReporter
)
SpecSuiteDidEnd
(
summary
*
types
.
SuiteSummary
)
{
// Only log the binary output if the suite failed.
b
:=
&
bytes
.
Buffer
{}
if
e2es
!=
nil
&&
!
summary
.
SuiteSucceeded
{
b
.
WriteString
(
fmt
.
Sprintf
(
"Process Log For Failed Suite On %s
\n
"
,
*
nodeName
))
b
.
WriteString
(
"-------------------------------------------------------------
\n
"
)
b
.
WriteString
(
"-------------------------------------------------------------
\n
"
)
b
.
WriteString
(
fmt
.
Sprintf
(
"kubelet output:
\n
%s
\n
"
,
e2es
.
kubeletCombinedOut
.
String
()))
b
.
WriteString
(
fmt
.
Sprintf
(
"kubelet output:
\n
%s
\n
"
,
e2es
.
kubeletCombinedOut
.
String
()))
b
.
WriteString
(
"-------------------------------------------------------------
\n
"
)
b
.
WriteString
(
"-------------------------------------------------------------
\n
"
)
b
.
WriteString
(
fmt
.
Sprintf
(
"apiserver output:
\n
%s"
,
e2es
.
apiServerCombinedOut
.
String
()))
b
.
WriteString
(
fmt
.
Sprintf
(
"apiserver output:
\n
%s
\n
"
,
e2es
.
apiServerCombinedOut
.
String
()))
b
.
WriteString
(
"-------------------------------------------------------------
\n
"
)
b
.
WriteString
(
"-------------------------------------------------------------
\n
"
)
b
.
WriteString
(
fmt
.
Sprintf
(
"etcd output:
\n
%s"
,
e2es
.
etcdCombinedOut
.
String
()))
b
.
WriteString
(
fmt
.
Sprintf
(
"etcd output:
\n
%s
\n
"
,
e2es
.
etcdCombinedOut
.
String
()))
b
.
WriteString
(
"-------------------------------------------------------------
\n
"
)
glog
.
V
(
2
)
.
Infof
(
b
.
String
())
}
}
})
b
.
WriteString
(
"******************************************************
\n
"
)
glog
.
V
(
2
)
.
Infof
(
b
.
String
())
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment