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
21d3662c
Commit
21d3662c
authored
Dec 02, 2014
by
Brendan Burns
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for TAP (test anything protocol) output
parent
7cf0c4d7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
9 deletions
+39
-9
e2e.go
cmd/e2e/e2e.go
+39
-9
No files found.
cmd/e2e/e2e.go
View file @
21d3662c
...
...
@@ -351,6 +351,33 @@ func TestNetwork(c *client.Client) bool {
return
false
}
type
TestSpec
struct
{
// The test to run
test
func
(
c
*
client
.
Client
)
bool
// The human readable name of this test
name
string
// The id for this test. It should be constant for the life of the test.
id
int
}
type
TestInfo
struct
{
passed
bool
spec
TestSpec
}
// Output a summary in the TAP (test anything protocol) format for automated processing.
// See http://testanything.org/ for more info
func
outputTAPSummary
(
infoList
[]
TestInfo
)
{
glog
.
Infof
(
"1..%d"
,
len
(
infoList
))
for
_
,
info
:=
range
infoList
{
if
info
.
passed
{
glog
.
Infof
(
"ok %d - %s"
,
info
.
spec
.
id
,
info
.
spec
.
name
)
}
else
{
glog
.
Infof
(
"not ok %d - %s"
,
info
.
spec
.
id
,
info
.
spec
.
name
)
}
}
}
func
main
()
{
flag
.
Parse
()
goruntime
.
GOMAXPROCS
(
goruntime
.
NumCPU
())
...
...
@@ -366,23 +393,26 @@ func main() {
c
:=
loadClientOrDie
()
tests
:=
[]
func
(
c
*
client
.
Client
)
bool
{
TestKubernetesROService
,
TestKubeletSendsEvent
,
TestImportantURLs
,
TestPodUpdate
,
TestNetwork
,
// Define the tests. Important: for a clean test grid, please keep ids for a test constant.
tests
:=
[]
TestSpec
{
{
TestKubernetesROService
,
"TestKubernetesROService"
,
1
},
{
TestKubeletSendsEvent
,
"TestKubeletSendsEvent"
,
2
},
{
TestImportantURLs
,
"TestImportantURLs"
,
3
},
{
TestPodUpdate
,
"TestPodUpdate"
,
4
},
{
TestNetwork
,
"TestNetwork"
,
5
},
}
info
:=
[]
TestInfo
{}
passed
:=
true
for
_
,
test
:=
range
tests
{
testPassed
:=
test
(
c
)
testPassed
:=
test
.
test
(
c
)
if
!
testPassed
{
passed
=
false
}
// TODO: clean up objects created during a test after the test, so cases
}
// TODO: clean up objects created during a test after the test, so cases
// are independent.
info
=
append
(
info
,
TestInfo
{
testPassed
,
test
})
}
outputTAPSummary
(
info
)
if
!
passed
{
glog
.
Fatalf
(
"Tests failed"
)
}
...
...
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