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
0b932384
Commit
0b932384
authored
Dec 17, 2015
by
k8s-merge-robot
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #18536 from mikedanese/ns-label
Auto commit by PR queue bot
parents
15a57daf
a3b6674f
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
17 additions
and
5 deletions
+17
-5
e2e_test.go
test/e2e/e2e_test.go
+1
-0
example_cluster_dns.go
test/e2e/example_cluster_dns.go
+1
-1
framework.go
test/e2e/framework.go
+3
-1
namespace.go
test/e2e/namespace.go
+1
-1
service.go
test/e2e/service.go
+1
-1
util.go
test/e2e/util.go
+10
-1
No files found.
test/e2e/e2e_test.go
View file @
0b932384
...
...
@@ -180,5 +180,6 @@ func TestE2E(t *testing.T) {
if
*
reportDir
!=
""
{
r
=
append
(
r
,
reporters
.
NewJUnitReporter
(
path
.
Join
(
*
reportDir
,
fmt
.
Sprintf
(
"junit_%02d.xml"
,
config
.
GinkgoConfig
.
ParallelNode
))))
}
glog
.
Infof
(
"Starting e2e run; %q"
,
runId
)
ginkgo
.
RunSpecsWithDefaultAndCustomReporters
(
t
,
"Kubernetes e2e suite"
,
r
)
}
test/e2e/example_cluster_dns.go
View file @
0b932384
...
...
@@ -75,7 +75,7 @@ var _ = Describe("[Example] ClusterDns", func() {
namespaces
:=
[]
*
api
.
Namespace
{
nil
,
nil
}
for
i
:=
range
namespaces
{
var
err
error
namespaces
[
i
],
err
=
createTestingNS
(
fmt
.
Sprintf
(
"dnsexample%d"
,
i
),
c
)
namespaces
[
i
],
err
=
createTestingNS
(
fmt
.
Sprintf
(
"dnsexample%d"
,
i
),
c
,
nil
)
if
testContext
.
DeleteNamespace
{
if
namespaces
[
i
]
!=
nil
{
defer
deleteNS
(
c
,
namespaces
[
i
]
.
Name
,
5
*
time
.
Minute
/* namespace deletion timeout */
)
...
...
test/e2e/framework.go
View file @
0b932384
...
...
@@ -74,7 +74,9 @@ func (f *Framework) beforeEach() {
f
.
Client
=
c
By
(
"Building a namespace api object"
)
namespace
,
err
:=
createTestingNS
(
f
.
BaseName
,
f
.
Client
)
namespace
,
err
:=
createTestingNS
(
f
.
BaseName
,
f
.
Client
,
map
[
string
]
string
{
"e2e-framework"
:
f
.
BaseName
,
})
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
f
.
Namespace
=
namespace
...
...
test/e2e/namespace.go
View file @
0b932384
...
...
@@ -40,7 +40,7 @@ func extinguish(c *client.Client, totalNS int, maxAllowedAfterDel int, maxSecond
go
func
(
n
int
)
{
defer
wg
.
Done
()
defer
GinkgoRecover
()
_
,
err
=
createTestingNS
(
fmt
.
Sprintf
(
"nslifetest-%v"
,
n
),
c
)
_
,
err
=
createTestingNS
(
fmt
.
Sprintf
(
"nslifetest-%v"
,
n
),
c
,
nil
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
}(
n
)
}
...
...
test/e2e/service.go
View file @
0b932384
...
...
@@ -784,7 +784,7 @@ var _ = Describe("Services", func() {
ns1
:=
f
.
Namespace
.
Name
By
(
"Building a second namespace api object"
)
namespacePtr
,
err
:=
createTestingNS
(
"services"
,
c
)
namespacePtr
,
err
:=
createTestingNS
(
"services"
,
c
,
nil
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
ns2
:=
namespacePtr
.
Name
extraNamespaces
=
append
(
extraNamespaces
,
ns2
)
...
...
test/e2e/util.go
View file @
0b932384
...
...
@@ -119,6 +119,9 @@ type CloudConfig struct {
Provider
cloudprovider
.
Interface
}
// unique identifier of the e2e run
var
runId
=
util
.
NewUUID
()
type
TestContextType
struct
{
KubeConfig
string
KubeContext
string
...
...
@@ -554,11 +557,17 @@ func waitForPersistentVolumePhase(phase api.PersistentVolumePhase, c *client.Cli
// createTestingNS should be used by every test, note that we append a common prefix to the provided test name.
// Please see NewFramework instead of using this directly.
func
createTestingNS
(
baseName
string
,
c
*
client
.
Client
)
(
*
api
.
Namespace
,
error
)
{
func
createTestingNS
(
baseName
string
,
c
*
client
.
Client
,
labels
map
[
string
]
string
)
(
*
api
.
Namespace
,
error
)
{
if
labels
==
nil
{
labels
=
map
[
string
]
string
{}
}
labels
[
"e2e-run"
]
=
string
(
runId
)
namespaceObj
:=
&
api
.
Namespace
{
ObjectMeta
:
api
.
ObjectMeta
{
GenerateName
:
fmt
.
Sprintf
(
"e2e-tests-%v-"
,
baseName
),
Namespace
:
""
,
Labels
:
labels
,
},
Status
:
api
.
NamespaceStatus
{},
}
...
...
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