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
001437a7
Commit
001437a7
authored
Nov 13, 2015
by
Avesh Agarwal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
This commit fixes tests.
parent
a2299253
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
23 additions
and
8 deletions
+23
-8
integration_test.go
contrib/mesos/pkg/scheduler/integration/integration_test.go
+7
-6
event_test.go
pkg/client/record/event_test.go
+0
-0
events_cache_test.go
pkg/client/record/events_cache_test.go
+1
-0
events_test.go
pkg/client/unversioned/events_test.go
+3
-0
describe_test.go
pkg/kubectl/describe_test.go
+3
-0
resource_printer_test.go
pkg/kubectl/resource_printer_test.go
+4
-0
sorted_event_list_test.go
pkg/kubectl/sorted_event_list_test.go
+3
-0
util.go
test/e2e/util.go
+2
-2
No files found.
contrib/mesos/pkg/scheduler/integration/integration_test.go
View file @
001437a7
...
...
@@ -313,6 +313,7 @@ func NewTestOffer(id string) *mesos.Offer {
// Add assertions to reason about event streams
type
Event
struct
{
Object
runtime
.
Object
Type
string
Reason
string
Message
string
}
...
...
@@ -334,15 +335,15 @@ func NewEventObserver() *EventObserver {
}
}
func
(
o
*
EventObserver
)
Event
(
object
runtime
.
Object
,
reason
,
message
string
)
{
o
.
fifo
<-
Event
{
Object
:
object
,
Reason
:
reason
,
Message
:
message
}
func
(
o
*
EventObserver
)
Event
(
object
runtime
.
Object
,
eventtype
,
reason
,
message
string
)
{
o
.
fifo
<-
Event
{
Object
:
object
,
Type
:
eventtype
,
Reason
:
reason
,
Message
:
message
}
}
func
(
o
*
EventObserver
)
Eventf
(
object
runtime
.
Object
,
reason
,
messageFmt
string
,
args
...
interface
{})
{
o
.
fifo
<-
Event
{
Object
:
object
,
Reason
:
reason
,
Message
:
fmt
.
Sprintf
(
messageFmt
,
args
...
)}
func
(
o
*
EventObserver
)
Eventf
(
object
runtime
.
Object
,
eventtype
,
reason
,
messageFmt
string
,
args
...
interface
{})
{
o
.
fifo
<-
Event
{
Object
:
object
,
Type
:
eventtype
,
Reason
:
reason
,
Message
:
fmt
.
Sprintf
(
messageFmt
,
args
...
)}
}
func
(
o
*
EventObserver
)
PastEventf
(
object
runtime
.
Object
,
timestamp
unversioned
.
Time
,
reason
,
messageFmt
string
,
args
...
interface
{})
{
o
.
fifo
<-
Event
{
Object
:
object
,
Reason
:
reason
,
Message
:
fmt
.
Sprintf
(
messageFmt
,
args
...
)}
func
(
o
*
EventObserver
)
PastEventf
(
object
runtime
.
Object
,
timestamp
unversioned
.
Time
,
eventtype
,
reason
,
messageFmt
string
,
args
...
interface
{})
{
o
.
fifo
<-
Event
{
Object
:
object
,
Type
:
eventtype
,
Reason
:
reason
,
Message
:
fmt
.
Sprintf
(
messageFmt
,
args
...
)}
}
func
(
a
*
EventAssertions
)
Event
(
observer
*
EventObserver
,
pred
EventPredicate
,
msgAndArgs
...
interface
{})
bool
{
...
...
pkg/client/record/event_test.go
View file @
001437a7
This diff is collapsed.
Click to expand it.
pkg/client/record/events_cache_test.go
View file @
001437a7
...
...
@@ -50,6 +50,7 @@ func makeEvent(reason, message string, involvedObject api.ObjectReference) api.E
Count
:
1
,
FirstTimestamp
:
eventTime
,
LastTimestamp
:
eventTime
,
Type
:
api
.
EventTypeNormal
,
}
return
event
}
...
...
pkg/client/unversioned/events_test.go
View file @
001437a7
...
...
@@ -74,6 +74,7 @@ func TestEventCreate(t *testing.T) {
FirstTimestamp
:
timeStamp
,
LastTimestamp
:
timeStamp
,
Count
:
1
,
Type
:
api
.
EventTypeNormal
,
}
c
:=
&
testClient
{
Request
:
testRequest
{
...
...
@@ -113,6 +114,7 @@ func TestEventGet(t *testing.T) {
FirstTimestamp
:
timeStamp
,
LastTimestamp
:
timeStamp
,
Count
:
1
,
Type
:
api
.
EventTypeNormal
,
}
c
:=
&
testClient
{
Request
:
testRequest
{
...
...
@@ -152,6 +154,7 @@ func TestEventList(t *testing.T) {
FirstTimestamp
:
timeStamp
,
LastTimestamp
:
timeStamp
,
Count
:
1
,
Type
:
api
.
EventTypeNormal
,
},
},
}
...
...
pkg/kubectl/describe_test.go
View file @
001437a7
...
...
@@ -85,6 +85,7 @@ func TestPodDescribeResultsSorted(t *testing.T) {
FirstTimestamp
:
unversioned
.
NewTime
(
time
.
Date
(
2014
,
time
.
January
,
15
,
0
,
0
,
0
,
0
,
time
.
UTC
)),
LastTimestamp
:
unversioned
.
NewTime
(
time
.
Date
(
2014
,
time
.
January
,
15
,
0
,
0
,
0
,
0
,
time
.
UTC
)),
Count
:
1
,
Type
:
api
.
EventTypeNormal
,
},
{
Source
:
api
.
EventSource
{
Component
:
"scheduler"
},
...
...
@@ -92,6 +93,7 @@ func TestPodDescribeResultsSorted(t *testing.T) {
FirstTimestamp
:
unversioned
.
NewTime
(
time
.
Date
(
1987
,
time
.
June
,
17
,
0
,
0
,
0
,
0
,
time
.
UTC
)),
LastTimestamp
:
unversioned
.
NewTime
(
time
.
Date
(
1987
,
time
.
June
,
17
,
0
,
0
,
0
,
0
,
time
.
UTC
)),
Count
:
1
,
Type
:
api
.
EventTypeNormal
,
},
{
Source
:
api
.
EventSource
{
Component
:
"kubelet"
},
...
...
@@ -99,6 +101,7 @@ func TestPodDescribeResultsSorted(t *testing.T) {
FirstTimestamp
:
unversioned
.
NewTime
(
time
.
Date
(
2002
,
time
.
December
,
25
,
0
,
0
,
0
,
0
,
time
.
UTC
)),
LastTimestamp
:
unversioned
.
NewTime
(
time
.
Date
(
2002
,
time
.
December
,
25
,
0
,
0
,
0
,
0
,
time
.
UTC
)),
Count
:
1
,
Type
:
api
.
EventTypeNormal
,
},
},
})
...
...
pkg/kubectl/resource_printer_test.go
View file @
001437a7
...
...
@@ -507,6 +507,7 @@ func TestPrintEventsResultSorted(t *testing.T) {
FirstTimestamp
:
unversioned
.
NewTime
(
time
.
Date
(
2014
,
time
.
January
,
15
,
0
,
0
,
0
,
0
,
time
.
UTC
)),
LastTimestamp
:
unversioned
.
NewTime
(
time
.
Date
(
2014
,
time
.
January
,
15
,
0
,
0
,
0
,
0
,
time
.
UTC
)),
Count
:
1
,
Type
:
api
.
EventTypeNormal
,
},
{
Source
:
api
.
EventSource
{
Component
:
"scheduler"
},
...
...
@@ -514,6 +515,7 @@ func TestPrintEventsResultSorted(t *testing.T) {
FirstTimestamp
:
unversioned
.
NewTime
(
time
.
Date
(
1987
,
time
.
June
,
17
,
0
,
0
,
0
,
0
,
time
.
UTC
)),
LastTimestamp
:
unversioned
.
NewTime
(
time
.
Date
(
1987
,
time
.
June
,
17
,
0
,
0
,
0
,
0
,
time
.
UTC
)),
Count
:
1
,
Type
:
api
.
EventTypeNormal
,
},
{
Source
:
api
.
EventSource
{
Component
:
"kubelet"
},
...
...
@@ -521,6 +523,7 @@ func TestPrintEventsResultSorted(t *testing.T) {
FirstTimestamp
:
unversioned
.
NewTime
(
time
.
Date
(
2002
,
time
.
December
,
25
,
0
,
0
,
0
,
0
,
time
.
UTC
)),
LastTimestamp
:
unversioned
.
NewTime
(
time
.
Date
(
2002
,
time
.
December
,
25
,
0
,
0
,
0
,
0
,
time
.
UTC
)),
Count
:
1
,
Type
:
api
.
EventTypeNormal
,
},
},
}
...
...
@@ -902,6 +905,7 @@ func TestPrintHumanReadableWithNamespace(t *testing.T) {
FirstTimestamp
:
unversioned
.
NewTime
(
time
.
Date
(
2014
,
time
.
January
,
15
,
0
,
0
,
0
,
0
,
time
.
UTC
)),
LastTimestamp
:
unversioned
.
NewTime
(
time
.
Date
(
2014
,
time
.
January
,
15
,
0
,
0
,
0
,
0
,
time
.
UTC
)),
Count
:
1
,
Type
:
api
.
EventTypeNormal
,
},
isNamespaced
:
true
,
},
...
...
pkg/kubectl/sorted_event_list_test.go
View file @
001437a7
...
...
@@ -60,6 +60,7 @@ func TestSortableEvents(t *testing.T) {
FirstTimestamp
:
unversioned
.
NewTime
(
time
.
Date
(
2014
,
time
.
January
,
15
,
0
,
0
,
0
,
0
,
time
.
UTC
)),
LastTimestamp
:
unversioned
.
NewTime
(
time
.
Date
(
2014
,
time
.
January
,
15
,
0
,
0
,
0
,
0
,
time
.
UTC
)),
Count
:
1
,
Type
:
api
.
EventTypeNormal
,
},
{
Source
:
api
.
EventSource
{
Component
:
"scheduler"
},
...
...
@@ -67,6 +68,7 @@ func TestSortableEvents(t *testing.T) {
FirstTimestamp
:
unversioned
.
NewTime
(
time
.
Date
(
1987
,
time
.
June
,
17
,
0
,
0
,
0
,
0
,
time
.
UTC
)),
LastTimestamp
:
unversioned
.
NewTime
(
time
.
Date
(
1987
,
time
.
June
,
17
,
0
,
0
,
0
,
0
,
time
.
UTC
)),
Count
:
1
,
Type
:
api
.
EventTypeNormal
,
},
{
Source
:
api
.
EventSource
{
Component
:
"kubelet"
},
...
...
@@ -74,6 +76,7 @@ func TestSortableEvents(t *testing.T) {
FirstTimestamp
:
unversioned
.
NewTime
(
time
.
Date
(
2002
,
time
.
December
,
25
,
0
,
0
,
0
,
0
,
time
.
UTC
)),
LastTimestamp
:
unversioned
.
NewTime
(
time
.
Date
(
2002
,
time
.
December
,
25
,
0
,
0
,
0
,
0
,
time
.
UTC
)),
Count
:
1
,
Type
:
api
.
EventTypeNormal
,
},
})
...
...
test/e2e/util.go
View file @
001437a7
...
...
@@ -1665,8 +1665,8 @@ func dumpNodeDebugInfo(c *client.Client, nodeNames []string) {
Logf
(
"
\n
Logging kubelet events for node %v"
,
n
)
for
_
,
e
:=
range
getNodeEvents
(
c
,
n
)
{
Logf
(
"source %v message %v reason %v first ts %v last ts %v, involved obj %+v"
,
e
.
Source
,
e
.
Message
,
e
.
Reason
,
e
.
FirstTimestamp
,
e
.
LastTimestamp
,
e
.
InvolvedObject
)
Logf
(
"source %v
type %v
message %v reason %v first ts %v last ts %v, involved obj %+v"
,
e
.
Source
,
e
.
Type
,
e
.
Message
,
e
.
Reason
,
e
.
FirstTimestamp
,
e
.
LastTimestamp
,
e
.
InvolvedObject
)
}
Logf
(
"
\n
Logging pods the kubelet thinks is on node %v"
,
n
)
podList
,
err
:=
GetKubeletPods
(
c
,
n
)
...
...
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