Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Chu Peng 楚鹏
minikube
提交
f758fb06
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 搜索 >>
未验证
提交
f758fb06
编写于
10月 15, 2020
作者:
M
Medya Ghazizadeh
提交者:
GitHub
10月 15, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #9466 from priyawadhwa/test-pause
Combine pause status test into existing pause test
上级
6153beb7
2bc1f531
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
22 addition
and
40 deletion
+22
-40
.github/workflows/pr.yml
.github/workflows/pr.yml
+2
-2
test/integration/pause_test.go
test/integration/pause_test.go
+20
-0
test/integration/status_test.go
test/integration/status_test.go
+0
-38
未找到文件。
.github/workflows/pr.yml
浏览文件 @
f758fb06
...
...
@@ -1074,7 +1074,7 @@ jobs:
chmod a+x e2e-*
chmod a+x minikube-*
START_TIME=$(date -u +%s)
KUBECONFIG=$(pwd)/testhome/kubeconfig MINIKUBE_HOME=$(pwd)/testhome ./e2e-linux-amd64 -minikube-start-args=--driver=docker -test.run "(TestPause|TestPreload|TestDockerFlags)" -test.timeout=
15
m -test.v -timeout-multiplier=1.5 -binary=./minikube-linux-amd64 2>&1 | tee ./report/testout.txt
KUBECONFIG=$(pwd)/testhome/kubeconfig MINIKUBE_HOME=$(pwd)/testhome ./e2e-linux-amd64 -minikube-start-args=--driver=docker -test.run "(TestPause|TestPreload|TestDockerFlags)" -test.timeout=
20
m -test.v -timeout-multiplier=1.5 -binary=./minikube-linux-amd64 2>&1 | tee ./report/testout.txt
END_TIME=$(date -u +%s)
TIME_ELAPSED=$(($END_TIME-$START_TIME))
min=$((${TIME_ELAPSED}/60))
...
...
@@ -1164,7 +1164,7 @@ jobs:
chmod a+x e2e-*
chmod a+x minikube-*
START_TIME=$(date -u +%s)
KUBECONFIG=$(pwd)/testhome/kubeconfig MINIKUBE_HOME=$(pwd)/testhome ./e2e-darwin-amd64 -minikube-start-args=--vm-driver=virtualbox -test.run "(TestPause|TestPreload|TestDockerFlags)" -test.timeout=
15
m -test.v -timeout-multiplier=1.5 -binary=./minikube-darwin-amd64 2>&1 | tee ./report/testout.txt
KUBECONFIG=$(pwd)/testhome/kubeconfig MINIKUBE_HOME=$(pwd)/testhome ./e2e-darwin-amd64 -minikube-start-args=--vm-driver=virtualbox -test.run "(TestPause|TestPreload|TestDockerFlags)" -test.timeout=
20
m -test.v -timeout-multiplier=1.5 -binary=./minikube-darwin-amd64 2>&1 | tee ./report/testout.txt
END_TIME=$(date -u +%s)
TIME_ELAPSED=$(($END_TIME-$START_TIME))
min=$((${TIME_ELAPSED}/60))
...
...
test/integration/pause_test.go
浏览文件 @
f758fb06
...
...
@@ -24,6 +24,8 @@ import (
"os/exec"
"strings"
"testing"
"k8s.io/minikube/cmd/minikube/cmd"
)
func
TestPause
(
t
*
testing
.
T
)
{
...
...
@@ -43,6 +45,7 @@ func TestPause(t *testing.T) {
{
"Start"
,
validateFreshStart
},
{
"SecondStartNoReconfiguration"
,
validateStartNoReconfigure
},
{
"Pause"
,
validatePause
},
{
"VerifyStatus"
,
validateStatus
},
{
"Unpause"
,
validateUnpause
},
{
"PauseAgain"
,
validatePause
},
{
"DeletePaused"
,
validateDelete
},
...
...
@@ -166,3 +169,20 @@ func validateVerifyDeleted(ctx context.Context, t *testing.T, profile string) {
}
}
func
validateStatus
(
ctx
context
.
Context
,
t
*
testing
.
T
,
profile
string
)
{
defer
PostMortemLogs
(
t
,
profile
)
statusOutput
:=
runStatusCmd
(
ctx
,
t
,
profile
,
false
)
var
cs
cmd
.
ClusterState
if
err
:=
json
.
Unmarshal
(
statusOutput
,
&
cs
);
err
!=
nil
{
t
.
Fatalf
(
"unmarshalling: %v"
,
err
)
}
// verify the status looks as we expect
if
cs
.
StatusCode
!=
cmd
.
Paused
{
t
.
Fatalf
(
"incorrect status code: %v"
,
cs
.
StatusCode
)
}
if
cs
.
StatusName
!=
"Paused"
{
t
.
Fatalf
(
"incorrect status name: %v"
,
cs
.
StatusName
)
}
}
test/integration/status_test.go
浏览文件 @
f758fb06
...
...
@@ -98,41 +98,3 @@ func verifyClusterState(t *testing.T, contents []byte) {
}
}
}
func
TestPauseStatus
(
t
*
testing
.
T
)
{
// run start
profile
:=
UniqueProfileName
(
"pause-status"
)
ctx
,
cancel
:=
context
.
WithTimeout
(
context
.
Background
(),
Minutes
(
5
))
defer
Cleanup
(
t
,
profile
,
cancel
)
startArgs
:=
[]
string
{
"start"
,
"-p"
,
profile
,
"--output=json"
,
"--wait=true"
}
startArgs
=
append
(
startArgs
,
StartArgs
()
...
)
c
:=
exec
.
CommandContext
(
ctx
,
Target
(),
startArgs
...
)
rr
,
err
:=
Run
(
t
,
c
)
if
err
!=
nil
{
t
.
Fatalf
(
"minikube start failed %v
\n
%v"
,
rr
.
Command
(),
err
)
}
// run pause
pauseArgs
:=
[]
string
{
"pause"
,
"-p"
,
profile
}
c
=
exec
.
CommandContext
(
ctx
,
Target
(),
pauseArgs
...
)
rr
,
err
=
Run
(
t
,
c
)
if
err
!=
nil
{
t
.
Fatalf
(
"minikube pause failed %v
\n
%v"
,
rr
.
Command
(),
err
)
}
// run status
statusOutput
:=
runStatusCmd
(
context
.
Background
(),
t
,
profile
,
false
)
var
cs
cmd
.
ClusterState
if
err
:=
json
.
Unmarshal
(
statusOutput
,
&
cs
);
err
!=
nil
{
t
.
Fatalf
(
"unmarshalling: %v"
,
err
)
}
// verify the status looks as we expect
if
cs
.
StatusCode
!=
cmd
.
Paused
{
t
.
Fatalf
(
"incorrect status code: %v"
,
cs
.
StatusCode
)
}
if
cs
.
StatusName
!=
"Paused"
{
t
.
Fatalf
(
"incorrect status name: %v"
,
cs
.
StatusName
)
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录