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
bc94a3c5
Unverified
Commit
bc94a3c5
authored
Mar 29, 2019
by
Kubernetes Prow Robot
Committed by
GitHub
Mar 29, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #75871 from SataQiu/fix-test-golint-20190329
Fix golint failures of e2e/framework/test_context.go
parents
6fef6e86
a232c326
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
6 deletions
+8
-6
gce.go
test/e2e/framework/providers/gce/gce.go
+1
-1
test_context.go
test/e2e/framework/test_context.go
+7
-5
No files found.
test/e2e/framework/providers/gce/gce.go
View file @
bc94a3c5
...
@@ -58,7 +58,7 @@ func factory() (framework.ProviderInterface, error) {
...
@@ -58,7 +58,7 @@ func factory() (framework.ProviderInterface, error) {
}
}
gceCloud
,
err
:=
gcecloud
.
CreateGCECloud
(
&
gcecloud
.
CloudConfig
{
gceCloud
,
err
:=
gcecloud
.
CreateGCECloud
(
&
gcecloud
.
CloudConfig
{
APIEndpoint
:
framework
.
TestContext
.
CloudConfig
.
A
pi
Endpoint
,
APIEndpoint
:
framework
.
TestContext
.
CloudConfig
.
A
PI
Endpoint
,
ProjectID
:
framework
.
TestContext
.
CloudConfig
.
ProjectID
,
ProjectID
:
framework
.
TestContext
.
CloudConfig
.
ProjectID
,
Region
:
region
,
Region
:
region
,
Zone
:
zone
,
Zone
:
zone
,
...
...
test/e2e/framework/test_context.go
View file @
bc94a3c5
...
@@ -203,8 +203,9 @@ type NodeTestContextType struct {
...
@@ -203,8 +203,9 @@ type NodeTestContextType struct {
ExtraEnvs
map
[
string
]
string
ExtraEnvs
map
[
string
]
string
}
}
// CloudConfig holds the cloud configuration for e2e test suites.
type
CloudConfig
struct
{
type
CloudConfig
struct
{
A
pi
Endpoint
string
A
PI
Endpoint
string
ProjectID
string
ProjectID
string
Zone
string
// for multizone tests, arbitrarily chosen zone
Zone
string
// for multizone tests, arbitrarily chosen zone
Region
string
Region
string
...
@@ -224,9 +225,10 @@ type CloudConfig struct {
...
@@ -224,9 +225,10 @@ type CloudConfig struct {
Provider
ProviderInterface
Provider
ProviderInterface
}
}
// TestContext should be used by all tests to access common context data.
var
TestContext
TestContextType
var
TestContext
TestContextType
// Register flags common to all e2e test suites.
// Register
CommonFlags registers
flags common to all e2e test suites.
func
RegisterCommonFlags
()
{
func
RegisterCommonFlags
()
{
// Turn on verbose by default to get spec names
// Turn on verbose by default to get spec names
config
.
DefaultReporterConfig
.
Verbose
=
true
config
.
DefaultReporterConfig
.
Verbose
=
true
...
@@ -269,7 +271,7 @@ func RegisterCommonFlags() {
...
@@ -269,7 +271,7 @@ func RegisterCommonFlags() {
flag
.
BoolVar
(
&
TestContext
.
ListImages
,
"list-images"
,
false
,
"If true, will show list of images used for runnning tests."
)
flag
.
BoolVar
(
&
TestContext
.
ListImages
,
"list-images"
,
false
,
"If true, will show list of images used for runnning tests."
)
}
}
// Register flags specific to the cluster e2e test suite.
// Register
ClusterFlags registers
flags specific to the cluster e2e test suite.
func
RegisterClusterFlags
()
{
func
RegisterClusterFlags
()
{
flag
.
BoolVar
(
&
TestContext
.
VerifyServiceAccount
,
"e2e-verify-service-account"
,
true
,
"If true tests will verify the service account before running."
)
flag
.
BoolVar
(
&
TestContext
.
VerifyServiceAccount
,
"e2e-verify-service-account"
,
true
,
"If true tests will verify the service account before running."
)
flag
.
StringVar
(
&
TestContext
.
KubeConfig
,
clientcmd
.
RecommendedConfigPathFlag
,
os
.
Getenv
(
clientcmd
.
RecommendedConfigPathEnvVar
),
"Path to kubeconfig containing embedded authinfo."
)
flag
.
StringVar
(
&
TestContext
.
KubeConfig
,
clientcmd
.
RecommendedConfigPathFlag
,
os
.
Getenv
(
clientcmd
.
RecommendedConfigPathEnvVar
),
"Path to kubeconfig containing embedded authinfo."
)
...
@@ -293,7 +295,7 @@ func RegisterClusterFlags() {
...
@@ -293,7 +295,7 @@ func RegisterClusterFlags() {
// TODO: Flags per provider? Rename gce-project/gce-zone?
// TODO: Flags per provider? Rename gce-project/gce-zone?
cloudConfig
:=
&
TestContext
.
CloudConfig
cloudConfig
:=
&
TestContext
.
CloudConfig
flag
.
StringVar
(
&
cloudConfig
.
MasterName
,
"kube-master"
,
""
,
"Name of the kubernetes master. Only required if provider is gce or gke"
)
flag
.
StringVar
(
&
cloudConfig
.
MasterName
,
"kube-master"
,
""
,
"Name of the kubernetes master. Only required if provider is gce or gke"
)
flag
.
StringVar
(
&
cloudConfig
.
A
pi
Endpoint
,
"gce-api-endpoint"
,
""
,
"The GCE APIEndpoint being used, if applicable"
)
flag
.
StringVar
(
&
cloudConfig
.
A
PI
Endpoint
,
"gce-api-endpoint"
,
""
,
"The GCE APIEndpoint being used, if applicable"
)
flag
.
StringVar
(
&
cloudConfig
.
ProjectID
,
"gce-project"
,
""
,
"The GCE project being used, if applicable"
)
flag
.
StringVar
(
&
cloudConfig
.
ProjectID
,
"gce-project"
,
""
,
"The GCE project being used, if applicable"
)
flag
.
StringVar
(
&
cloudConfig
.
Zone
,
"gce-zone"
,
""
,
"GCE zone being used, if applicable"
)
flag
.
StringVar
(
&
cloudConfig
.
Zone
,
"gce-zone"
,
""
,
"GCE zone being used, if applicable"
)
flag
.
StringVar
(
&
cloudConfig
.
Region
,
"gce-region"
,
""
,
"GCE region being used, if applicable"
)
flag
.
StringVar
(
&
cloudConfig
.
Region
,
"gce-region"
,
""
,
"GCE region being used, if applicable"
)
...
@@ -326,7 +328,7 @@ func RegisterClusterFlags() {
...
@@ -326,7 +328,7 @@ func RegisterClusterFlags() {
flag
.
DurationVar
(
&
nodeKiller
.
SimulatedDowntime
,
"node-killer-simulated-downtime"
,
10
*
time
.
Minute
,
"A delay between node death and recreation"
)
flag
.
DurationVar
(
&
nodeKiller
.
SimulatedDowntime
,
"node-killer-simulated-downtime"
,
10
*
time
.
Minute
,
"A delay between node death and recreation"
)
}
}
// Register flags specific to the node e2e test suite.
// Register
NodeFlags registers
flags specific to the node e2e test suite.
func
RegisterNodeFlags
()
{
func
RegisterNodeFlags
()
{
// Mark the test as node e2e when node flags are api.Registry.
// Mark the test as node e2e when node flags are api.Registry.
TestContext
.
NodeE2E
=
true
TestContext
.
NodeE2E
=
true
...
...
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