Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Chu Peng 楚鹏
minikube
提交
6e0aeda4
M
minikube
项目概览
Chu Peng 楚鹏
/
minikube
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
minikube
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
6e0aeda4
编写于
2月 20, 2020
作者:
M
Medya Gh
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
change all time durations
上级
ef43e63e
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
27 addition
and
19 deletion
+27
-19
test/integration/aab_offline_test.go
test/integration/aab_offline_test.go
+1
-1
test/integration/addons_test.go
test/integration/addons_test.go
+1
-1
test/integration/docker_test.go
test/integration/docker_test.go
+1
-1
test/integration/fn_mount_cmd.go
test/integration/fn_mount_cmd.go
+1
-1
test/integration/fn_pvc.go
test/integration/fn_pvc.go
+1
-1
test/integration/fn_tunnel_cmd.go
test/integration/fn_tunnel_cmd.go
+1
-1
test/integration/functional_test.go
test/integration/functional_test.go
+6
-6
test/integration/guest_env_test.go
test/integration/guest_env_test.go
+1
-1
test/integration/gvisor_addon_test.go
test/integration/gvisor_addon_test.go
+1
-1
test/integration/main.go
test/integration/main.go
+10
-2
test/integration/none_test.go
test/integration/none_test.go
+1
-1
test/integration/start_stop_delete_test.go
test/integration/start_stop_delete_test.go
+1
-1
test/integration/version_upgrade_test.go
test/integration/version_upgrade_test.go
+1
-1
未找到文件。
test/integration/aab_offline_test.go
浏览文件 @
6e0aeda4
...
...
@@ -39,7 +39,7 @@ func TestOffline(t *testing.T) {
}
profile
:=
UniqueProfileName
(
fmt
.
Sprintf
(
"offline-%s"
,
runtime
))
ctx
,
cancel
:=
context
.
WithTimeout
(
context
.
Background
(),
15
*
time
.
Minute
)
ctx
,
cancel
:=
context
.
WithTimeout
(
context
.
Background
(),
Minutes
(
15
)
)
defer
CleanupWithLogs
(
t
,
profile
,
cancel
)
startArgs
:=
[]
string
{
"start"
,
"-p"
,
profile
,
"--alsologtostderr"
,
"-v=1"
,
"--wait=true"
,
"--container-runtime"
,
runtime
}
...
...
test/integration/addons_test.go
浏览文件 @
6e0aeda4
...
...
@@ -37,7 +37,7 @@ import (
// TestAddons tests addons that require no special environment -- in parallel
func
TestAddons
(
t
*
testing
.
T
)
{
profile
:=
UniqueProfileName
(
"addons"
)
ctx
,
cancel
:=
context
.
WithTimeout
(
context
.
Background
(),
40
*
time
.
Minute
)
ctx
,
cancel
:=
context
.
WithTimeout
(
context
.
Background
(),
Minutes
(
40
)
)
defer
CleanupWithLogs
(
t
,
profile
,
cancel
)
args
:=
append
([]
string
{
"start"
,
"-p"
,
profile
,
"--wait=false"
,
"--memory=2600"
,
"--alsologtostderr"
,
"-v=1"
,
"--addons=ingress"
,
"--addons=registry"
,
"--addons=metrics-server"
},
StartArgs
()
...
)
...
...
test/integration/docker_test.go
浏览文件 @
6e0aeda4
...
...
@@ -33,7 +33,7 @@ func TestDockerFlags(t *testing.T) {
MaybeParallel
(
t
)
profile
:=
UniqueProfileName
(
"docker-flags"
)
ctx
,
cancel
:=
context
.
WithTimeout
(
context
.
Background
(),
30
*
time
.
Minute
)
ctx
,
cancel
:=
context
.
WithTimeout
(
context
.
Background
(),
Minutes
(
30
)
)
defer
CleanupWithLogs
(
t
,
profile
,
cancel
)
// Use the most verbose logging for the simplest test. If it fails, something is very wrong.
...
...
test/integration/fn_mount_cmd.go
浏览文件 @
6e0aeda4
...
...
@@ -56,7 +56,7 @@ func validateMountCmd(ctx context.Context, t *testing.T, profile string) {
t
.
Fatalf
(
"Unexpected error while creating tempDir: %v"
,
err
)
}
ctx
,
cancel
:=
context
.
WithTimeout
(
ctx
,
10
*
time
.
Minute
)
ctx
,
cancel
:=
context
.
WithTimeout
(
ctx
,
Minutes
(
10
)
)
args
:=
[]
string
{
"mount"
,
"-p"
,
profile
,
fmt
.
Sprintf
(
"%s:%s"
,
tempDir
,
guestMount
),
"--alsologtostderr"
,
"-v=1"
}
ss
,
err
:=
Start
(
t
,
exec
.
CommandContext
(
ctx
,
Target
(),
args
...
))
...
...
test/integration/fn_pvc.go
浏览文件 @
6e0aeda4
...
...
@@ -34,7 +34,7 @@ import (
)
func
validatePersistentVolumeClaim
(
ctx
context
.
Context
,
t
*
testing
.
T
,
profile
string
)
{
ctx
,
cancel
:=
context
.
WithTimeout
(
ctx
,
10
*
time
.
Minute
)
ctx
,
cancel
:=
context
.
WithTimeout
(
ctx
,
Minutes
(
10
)
)
defer
cancel
()
if
_
,
err
:=
PodWait
(
ctx
,
t
,
profile
,
"kube-system"
,
"integration-test=storage-provisioner"
,
4
*
time
.
Minute
);
err
!=
nil
{
...
...
test/integration/fn_tunnel_cmd.go
浏览文件 @
6e0aeda4
...
...
@@ -38,7 +38,7 @@ import (
)
func
validateTunnelCmd
(
ctx
context
.
Context
,
t
*
testing
.
T
,
profile
string
)
{
ctx
,
cancel
:=
context
.
WithTimeout
(
ctx
,
20
*
time
.
Minute
)
ctx
,
cancel
:=
context
.
WithTimeout
(
ctx
,
Minutes
(
20
)
)
defer
cancel
()
if
runtime
.
GOOS
!=
"windows"
{
...
...
test/integration/functional_test.go
浏览文件 @
6e0aeda4
...
...
@@ -55,7 +55,7 @@ type validateFunc func(context.Context, *testing.T, string)
func
TestFunctional
(
t
*
testing
.
T
)
{
profile
:=
UniqueProfileName
(
"functional"
)
ctx
,
cancel
:=
context
.
WithTimeout
(
context
.
Background
(),
40
*
time
.
Minute
)
ctx
,
cancel
:=
context
.
WithTimeout
(
context
.
Background
(),
Minutes
(
40
)
)
defer
func
()
{
p
:=
localSyncTestPath
()
if
err
:=
os
.
Remove
(
p
);
err
!=
nil
{
...
...
@@ -125,7 +125,7 @@ func TestFunctional(t *testing.T) {
// check functionality of minikube after evaling docker-env
func
validateDockerEnv
(
ctx
context
.
Context
,
t
*
testing
.
T
,
profile
string
)
{
mctx
,
cancel
:=
context
.
WithTimeout
(
ctx
,
13
*
time
.
Second
)
mctx
,
cancel
:=
context
.
WithTimeout
(
ctx
,
Seconds
(
13
)
)
defer
cancel
()
// we should be able to get minikube status with a bash which evaled docker-env
c
:=
exec
.
CommandContext
(
mctx
,
"/bin/bash"
,
"-c"
,
"eval $("
+
Target
()
+
" -p "
+
profile
+
" docker-env) && "
+
Target
()
+
" status -p "
+
profile
)
...
...
@@ -137,7 +137,7 @@ func validateDockerEnv(ctx context.Context, t *testing.T, profile string) {
t
.
Fatalf
(
"Expected status output to include 'Running' after eval docker-env but got
\n
%s"
,
rr
.
Output
())
}
mctx
,
cancel
=
context
.
WithTimeout
(
ctx
,
13
*
time
.
Second
)
mctx
,
cancel
=
context
.
WithTimeout
(
ctx
,
Seconds
(
13
)
)
defer
cancel
()
// do a eval $(minikube -p profile docker-env) and check if we are point to docker inside minikube
c
=
exec
.
CommandContext
(
mctx
,
"/bin/bash"
,
"-c"
,
"eval $("
+
Target
()
+
" -p "
+
profile
+
" docker-env) && docker images"
)
...
...
@@ -294,7 +294,7 @@ func validateDashboardCmd(ctx context.Context, t *testing.T, profile string) {
}()
start
:=
time
.
Now
()
s
,
err
:=
ReadLineWithTimeout
(
ss
.
Stdout
,
300
*
time
.
Second
)
s
,
err
:=
ReadLineWithTimeout
(
ss
.
Stdout
,
Seconds
(
300
)
)
if
err
!=
nil
{
if
runtime
.
GOOS
==
"windows"
{
t
.
Skipf
(
"failed to read url within %s: %v
\n
output: %q
\n
"
,
time
.
Since
(
start
),
err
,
s
)
...
...
@@ -351,7 +351,7 @@ func validateDNS(ctx context.Context, t *testing.T, profile string) {
// validateDryRun asserts that the dry-run mode quickly exits with the right code
func
validateDryRun
(
ctx
context
.
Context
,
t
*
testing
.
T
,
profile
string
)
{
// dry-run mode should always be able to finish quickly (<5s)
mctx
,
cancel
:=
context
.
WithTimeout
(
ctx
,
5
*
time
.
Second
)
mctx
,
cancel
:=
context
.
WithTimeout
(
ctx
,
Seconds
(
5
)
)
defer
cancel
()
// Too little memory!
...
...
@@ -364,7 +364,7 @@ func validateDryRun(ctx context.Context, t *testing.T, profile string) {
t
.
Errorf
(
"dry-run(250MB) exit code = %d, wanted = %d: %v"
,
rr
.
ExitCode
,
wantCode
,
err
)
}
dctx
,
cancel
:=
context
.
WithTimeout
(
ctx
,
5
*
time
.
Second
)
dctx
,
cancel
:=
context
.
WithTimeout
(
ctx
,
Seconds
(
5
)
)
defer
cancel
()
startArgs
=
append
([]
string
{
"start"
,
"-p"
,
profile
,
"--dry-run"
,
"--alsologtostderr"
,
"-v=1"
},
StartArgs
()
...
)
c
=
exec
.
CommandContext
(
dctx
,
Target
(),
startArgs
...
)
...
...
test/integration/guest_env_test.go
浏览文件 @
6e0aeda4
...
...
@@ -32,7 +32,7 @@ func TestGuestEnvironment(t *testing.T) {
MaybeParallel
(
t
)
profile
:=
UniqueProfileName
(
"guest"
)
ctx
,
cancel
:=
context
.
WithTimeout
(
context
.
Background
(),
15
*
time
.
Minute
)
ctx
,
cancel
:=
context
.
WithTimeout
(
context
.
Background
(),
Minutes
(
15
)
)
defer
CleanupWithLogs
(
t
,
profile
,
cancel
)
args
:=
append
([]
string
{
"start"
,
"-p"
,
profile
,
"--install-addons=false"
,
"--wait=false"
},
StartArgs
()
...
)
...
...
test/integration/gvisor_addon_test.go
浏览文件 @
6e0aeda4
...
...
@@ -36,7 +36,7 @@ func TestGvisorAddon(t *testing.T) {
MaybeParallel
(
t
)
profile
:=
UniqueProfileName
(
"gvisor"
)
ctx
,
cancel
:=
context
.
WithTimeout
(
context
.
Background
(),
60
*
time
.
Minute
)
ctx
,
cancel
:=
context
.
WithTimeout
(
context
.
Background
(),
Minutes
(
60
)
)
defer
func
()
{
if
t
.
Failed
()
{
rr
,
err
:=
Run
(
t
,
exec
.
CommandContext
(
ctx
,
"kubectl"
,
"--context"
,
profile
,
"logs"
,
"gvisor"
,
"-n"
,
"kube-system"
))
...
...
test/integration/main.go
浏览文件 @
6e0aeda4
...
...
@@ -34,7 +34,7 @@ var forceProfile = flag.String("profile", "", "force tests to run against a part
var
cleanup
=
flag
.
Bool
(
"cleanup"
,
true
,
"cleanup failed test run"
)
var
enableGvisor
=
flag
.
Bool
(
"gvisor"
,
false
,
"run gvisor integration test (slow)"
)
var
postMortemLogs
=
flag
.
Bool
(
"postmortem-logs"
,
true
,
"show logs after a failed test run"
)
var
slowMachine
=
flag
.
Bool
(
"slow-machine"
,
false
,
"
wait longer
for tests to finish"
)
var
slowMachine
=
flag
.
Bool
(
"slow-machine"
,
false
,
"
double the timeout
for tests to finish"
)
// Paths to files - normally set for CI
var
binaryPath
=
flag
.
String
(
"binary"
,
"../../out/minikube"
,
"path to minikube binary"
)
...
...
@@ -81,8 +81,16 @@ func CanCleanup() bool {
// Minutes will return timeout in minutes based on how slow the machine is
func
Minutes
(
n
int
)
time
.
Duration
{
if
*
slowMachine
{
if
*
slowMachine
{
// double time out for slow machines
return
time
.
Duration
(
2
)
*
time
.
Duration
(
n
)
*
time
.
Minute
}
return
time
.
Duration
(
n
)
*
time
.
Minute
}
// Seconds will return timeout in minutes based on how slow the machine is
func
Seconds
(
n
int
)
time
.
Duration
{
if
*
slowMachine
{
// double time out for slow machines
return
time
.
Duration
(
3
)
*
time
.
Duration
(
n
)
*
time
.
Second
}
return
time
.
Duration
(
n
)
*
time
.
Second
}
test/integration/none_test.go
浏览文件 @
6e0aeda4
...
...
@@ -41,7 +41,7 @@ func TestChangeNoneUser(t *testing.T) {
MaybeParallel
(
t
)
profile
:=
UniqueProfileName
(
"none"
)
ctx
,
cancel
:=
context
.
WithTimeout
(
context
.
Background
(),
10
*
time
.
Minute
)
ctx
,
cancel
:=
context
.
WithTimeout
(
context
.
Background
(),
Minutes
(
10
)
)
defer
CleanupWithLogs
(
t
,
profile
,
cancel
)
startArgs
:=
append
([]
string
{
"CHANGE_MINIKUBE_NONE_USER=true"
,
Target
(),
"start"
,
"--wait=false"
},
StartArgs
()
...
)
...
...
test/integration/start_stop_delete_test.go
浏览文件 @
6e0aeda4
...
...
@@ -84,7 +84,7 @@ func TestStartStop(t *testing.T) {
}
profile
:=
UniqueProfileName
(
tc
.
name
)
ctx
,
cancel
:=
context
.
WithTimeout
(
context
.
Background
(),
40
*
time
.
Minute
)
ctx
,
cancel
:=
context
.
WithTimeout
(
context
.
Background
(),
Minutes
(
40
)
)
defer
CleanupWithLogs
(
t
,
profile
,
cancel
)
startArgs
:=
append
([]
string
{
"start"
,
"-p"
,
profile
,
"--alsologtostderr"
,
"-v=3"
,
"--wait=true"
},
tc
.
args
...
)
...
...
test/integration/version_upgrade_test.go
浏览文件 @
6e0aeda4
...
...
@@ -43,7 +43,7 @@ import (
func
TestVersionUpgrade
(
t
*
testing
.
T
)
{
MaybeParallel
(
t
)
profile
:=
UniqueProfileName
(
"vupgrade"
)
ctx
,
cancel
:=
context
.
WithTimeout
(
context
.
Background
(),
55
*
time
.
Minute
)
ctx
,
cancel
:=
context
.
WithTimeout
(
context
.
Background
(),
Minutes
(
55
)
)
defer
CleanupWithLogs
(
t
,
profile
,
cancel
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录