Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
H
helm3
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
helm3
Commits
1d04646c
Commit
1d04646c
authored
Aug 08, 2016
by
fibonacci1729
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update failing tests to use new storage / driver apis
parent
cba0c661
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
9 deletions
+11
-9
environment_test.go
cmd/tiller/environment/environment_test.go
+9
-6
release_server_test.go
cmd/tiller/release_server_test.go
+2
-1
tiller_test.go
cmd/tiller/tiller_test.go
+0
-2
No files found.
cmd/tiller/environment/environment_test.go
View file @
1d04646c
...
...
@@ -22,6 +22,8 @@ import (
"testing"
"k8s.io/helm/pkg/chartutil"
"k8s.io/helm/pkg/storage"
"k8s.io/helm/pkg/storage/driver"
"k8s.io/helm/pkg/proto/hapi/chart"
"k8s.io/helm/pkg/proto/hapi/release"
)
...
...
@@ -38,12 +40,14 @@ type mockReleaseStorage struct {
rel
*
release
.
Release
}
var
_
driver
.
Driver
=
(
*
mockReleaseStorage
)(
nil
)
func
(
r
*
mockReleaseStorage
)
Create
(
v
*
release
.
Release
)
error
{
r
.
rel
=
v
return
nil
}
func
(
r
*
mockReleaseStorage
)
Read
(
k
string
)
(
*
release
.
Release
,
error
)
{
func
(
r
*
mockReleaseStorage
)
Get
(
k
string
)
(
*
release
.
Release
,
error
)
{
return
r
.
rel
,
nil
}
...
...
@@ -56,7 +60,7 @@ func (r *mockReleaseStorage) Delete(k string) (*release.Release, error) {
return
r
.
rel
,
nil
}
func
(
r
*
mockReleaseStorage
)
List
()
([]
*
release
.
Release
,
error
)
{
func
(
r
*
mockReleaseStorage
)
List
(
func
(
*
release
.
Release
)
bool
)
([]
*
release
.
Release
,
error
)
{
return
[]
*
release
.
Release
{},
nil
}
...
...
@@ -66,7 +70,7 @@ func (r *mockReleaseStorage) Query(labels map[string]string) ([]*release.Release
func
(
r
*
mockReleaseStorage
)
History
(
n
string
)
([]
*
release
.
Release
,
error
)
{
res
:=
[]
*
release
.
Release
{}
rel
,
err
:=
r
.
Read
(
n
)
rel
,
err
:=
r
.
Get
(
n
)
if
err
!=
nil
{
return
res
,
err
}
...
...
@@ -88,7 +92,6 @@ func (k *mockKubeClient) WatchUntilReady(ns string, r io.Reader) error {
}
var
_
Engine
=
&
mockEngine
{}
var
_
ReleaseStorage
=
&
mockReleaseStorage
{}
var
_
KubeClient
=
&
mockKubeClient
{}
var
_
KubeClient
=
&
PrintingKubeClient
{}
...
...
@@ -110,7 +113,7 @@ func TestEngine(t *testing.T) {
func
TestReleaseStorage
(
t
*
testing
.
T
)
{
rs
:=
&
mockReleaseStorage
{}
env
:=
New
()
env
.
Releases
=
rs
env
.
Releases
=
storage
.
Init
(
rs
)
release
:=
&
release
.
Release
{
Name
:
"mariner"
}
...
...
@@ -122,7 +125,7 @@ func TestReleaseStorage(t *testing.T) {
t
.
Fatalf
(
"failed to update release: %s"
,
err
)
}
if
v
,
err
:=
env
.
Releases
.
Read
(
"albatross"
);
err
!=
nil
{
if
v
,
err
:=
env
.
Releases
.
Get
(
"albatross"
);
err
!=
nil
{
t
.
Errorf
(
"Error fetching release: %s"
,
err
)
}
else
if
v
.
Name
!=
"mariner"
{
t
.
Errorf
(
"Expected mariner, got %q"
,
v
.
Name
)
...
...
cmd/tiller/release_server_test.go
View file @
1d04646c
...
...
@@ -31,6 +31,7 @@ import (
"k8s.io/helm/pkg/proto/hapi/chart"
"k8s.io/helm/pkg/proto/hapi/release"
"k8s.io/helm/pkg/proto/hapi/services"
"k8s.io/helm/pkg/storage/driver"
"k8s.io/helm/pkg/storage"
)
...
...
@@ -487,7 +488,7 @@ func TestListReleasesFilter(t *testing.T) {
func
mockEnvironment
()
*
environment
.
Environment
{
e
:=
environment
.
New
()
e
.
Releases
=
storage
.
NewMemory
(
)
e
.
Releases
=
storage
.
Init
(
driver
.
NewMemory
()
)
e
.
KubeClient
=
&
environment
.
PrintingKubeClient
{
Out
:
os
.
Stdout
}
return
e
}
...
...
cmd/tiller/tiller_test.go
View file @
1d04646c
...
...
@@ -21,13 +21,11 @@ import (
"k8s.io/helm/cmd/tiller/environment"
"k8s.io/helm/pkg/engine"
"k8s.io/helm/pkg/storage"
)
// These are canary tests to make sure that the default server actually
// fulfills its requirements.
var
_
environment
.
Engine
=
&
engine
.
Engine
{}
var
_
environment
.
ReleaseStorage
=
storage
.
NewMemory
()
func
TestInit
(
t
*
testing
.
T
)
{
defer
func
()
{
...
...
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