Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Chu Peng 楚鹏
minikube
提交
21ab32ea
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,发现更多精彩内容 >>
提交
21ab32ea
编写于
7月 12, 2019
作者:
T
tstromberg
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Make GlobalArgs vs StartArgs more explicit
上级
69b90f0d
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
12 addition
and
13 deletion
+12
-13
test/integration/docker_test.go
test/integration/docker_test.go
+2
-2
test/integration/flags.go
test/integration/flags.go
+3
-3
test/integration/mount_test.go
test/integration/mount_test.go
+1
-1
test/integration/persistence_test.go
test/integration/persistence_test.go
+1
-2
test/integration/proxy_test.go
test/integration/proxy_test.go
+1
-1
test/integration/util/util.go
test/integration/util/util.go
+4
-4
未找到文件。
test/integration/docker_test.go
浏览文件 @
21ab32ea
...
...
@@ -28,7 +28,7 @@ import (
func
TestDocker
(
t
*
testing
.
T
)
{
mk
:=
NewMinikubeRunner
(
t
,
"--wait=false"
)
if
strings
.
Contains
(
mk
.
StartArgs
,
"--vm-driver=none"
)
{
if
usingNoneDriver
(
mk
)
{
t
.
Skip
(
"skipping test as none driver does not bundle docker"
)
}
...
...
@@ -40,7 +40,7 @@ func TestDocker(t *testing.T) {
t
.
Logf
(
"pre-delete failed (probably ok): %v"
,
err
)
}
startCmd
:=
fmt
.
Sprintf
(
"start %s %s %s"
,
mk
.
StartArgs
,
mk
.
Args
,
startCmd
:=
fmt
.
Sprintf
(
"start %s %s %s"
,
mk
.
StartArgs
,
mk
.
Global
Args
,
"--docker-env=FOO=BAR --docker-env=BAZ=BAT --docker-opt=debug --docker-opt=icc=true"
)
stdout
,
stderr
,
err
:=
mk
.
RunWithContext
(
ctx
,
startCmd
)
if
err
!=
nil
{
...
...
test/integration/flags.go
浏览文件 @
21ab32ea
...
...
@@ -32,7 +32,7 @@ func TestMain(m *testing.M) {
}
var
binaryPath
=
flag
.
String
(
"binary"
,
"../../out/minikube"
,
"path to minikube binary"
)
var
a
rgs
=
flag
.
String
(
"minikube-args"
,
""
,
"Arguments to pass to minikube"
)
var
globalA
rgs
=
flag
.
String
(
"minikube-args"
,
""
,
"Arguments to pass to minikube"
)
var
startArgs
=
flag
.
String
(
"minikube-start-args"
,
""
,
"Arguments to pass to minikube start"
)
var
mountArgs
=
flag
.
String
(
"minikube-mount-args"
,
""
,
"Arguments to pass to minikube mount"
)
var
testdataDir
=
flag
.
String
(
"testdata-dir"
,
"testdata"
,
"the directory relative to test/integration where the testdata lives"
)
...
...
@@ -40,9 +40,9 @@ var testdataDir = flag.String("testdata-dir", "testdata", "the directory relativ
// NewMinikubeRunner creates a new MinikubeRunner
func
NewMinikubeRunner
(
t
*
testing
.
T
,
extraArgs
...
string
)
util
.
MinikubeRunner
{
return
util
.
MinikubeRunner
{
Args
:
*
args
+
strings
.
Join
(
extraArgs
,
" "
),
BinaryPath
:
*
binaryPath
,
StartArgs
:
*
startArgs
,
StartArgs
:
*
startArgs
+
strings
.
Join
(
extraArgs
,
" "
),
GlobalArgs
:
*
globalArgs
,
MountArgs
:
*
mountArgs
,
T
:
t
,
}
...
...
test/integration/mount_test.go
浏览文件 @
21ab32ea
...
...
@@ -38,7 +38,7 @@ func testMounting(t *testing.T) {
if
runtime
.
GOOS
==
"darwin"
{
t
.
Skip
(
"mount tests disabled in darwin due to timeout (issue#3200)"
)
}
if
strings
.
Contains
(
*
a
rgs
,
"--vm-driver=none"
)
{
if
strings
.
Contains
(
*
globalA
rgs
,
"--vm-driver=none"
)
{
t
.
Skip
(
"skipping test for none driver as it does not need mount"
)
}
...
...
test/integration/persistence_test.go
浏览文件 @
21ab32ea
...
...
@@ -21,7 +21,6 @@ package integration
import
(
"path"
"path/filepath"
"strings"
"testing"
"time"
...
...
@@ -31,7 +30,7 @@ import (
func
TestPersistence
(
t
*
testing
.
T
)
{
mk
:=
NewMinikubeRunner
(
t
,
"--wait=false"
)
if
strings
.
Contains
(
mk
.
StartArgs
,
"--vm-driver=none"
)
{
if
usingNoneDriver
(
mk
)
{
t
.
Skip
(
"skipping test as none driver does not support persistence"
)
}
mk
.
EnsureRunning
()
...
...
test/integration/proxy_test.go
浏览文件 @
21ab32ea
...
...
@@ -112,7 +112,7 @@ func testProxyWarning(t *testing.T) {
r
:=
NewMinikubeRunner
(
t
,
"--wait=false"
)
ctx
,
cancel
:=
context
.
WithTimeout
(
context
.
Background
(),
10
*
time
.
Minute
)
defer
cancel
()
startCmd
:=
fmt
.
Sprintf
(
"start %s %s
%s"
,
r
.
StartArgs
,
r
.
Args
,
"--alsologtostderr --v=5"
)
startCmd
:=
fmt
.
Sprintf
(
"start %s %s
"
,
r
.
StartArgs
,
r
.
GlobalArgs
)
stdout
,
stderr
,
err
:=
r
.
RunWithContext
(
ctx
,
startCmd
)
if
err
!=
nil
{
t
.
Fatalf
(
"start: %v
\n
stdout: %s
\n
stderr: %s"
,
err
,
stdout
,
stderr
)
...
...
test/integration/util/util.go
浏览文件 @
21ab32ea
...
...
@@ -43,7 +43,7 @@ const kubectlBinary = "kubectl"
type
MinikubeRunner
struct
{
T
*
testing
.
T
BinaryPath
string
Args
string
GlobalArgs
string
StartArgs
string
MountArgs
string
Runtime
string
...
...
@@ -210,7 +210,7 @@ func (m *MinikubeRunner) SSH(command string) (string, error) {
// Start starts the cluster
func
(
m
*
MinikubeRunner
)
Start
(
opts
...
string
)
{
cmd
:=
fmt
.
Sprintf
(
"start %s %s %s --alsologtostderr --v=2"
,
m
.
StartArgs
,
m
.
Args
,
strings
.
Join
(
opts
,
" "
))
cmd
:=
fmt
.
Sprintf
(
"start %s %s %s --alsologtostderr --v=2"
,
m
.
StartArgs
,
m
.
Global
Args
,
strings
.
Join
(
opts
,
" "
))
m
.
RunCommand
(
cmd
,
true
)
}
...
...
@@ -234,12 +234,12 @@ func (m *MinikubeRunner) ParseEnvCmdOutput(out string) map[string]string {
// GetStatus returns the status of a service
func
(
m
*
MinikubeRunner
)
GetStatus
()
string
{
return
m
.
RunCommand
(
fmt
.
Sprintf
(
"status --format={{.Host}} %s"
,
m
.
Args
),
false
)
return
m
.
RunCommand
(
fmt
.
Sprintf
(
"status --format={{.Host}} %s"
,
m
.
Global
Args
),
false
)
}
// GetLogs returns the logs of a service
func
(
m
*
MinikubeRunner
)
GetLogs
()
string
{
return
m
.
RunCommand
(
fmt
.
Sprintf
(
"logs %s"
,
m
.
Args
),
true
)
return
m
.
RunCommand
(
fmt
.
Sprintf
(
"logs %s"
,
m
.
Global
Args
),
true
)
}
// CheckStatus makes sure the service has the desired status, or cause fatal error
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录