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
a2e8b188
Unverified
Commit
a2e8b188
authored
Aug 06, 2019
by
Jeff Knurek
Committed by
Matthew Fisher
Oct 08, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TEST: add some rudimentary test code for helm test logs
Signed-off-by:
Jeff Knurek
<
j.knurek@travelaudience.com
>
parent
6529abe8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
0 deletions
+25
-0
environment_test.go
pkg/releasetesting/environment_test.go
+18
-0
environment_test.go
pkg/tiller/environment/environment_test.go
+4
-0
release_server_test.go
pkg/tiller/release_server_test.go
+3
-0
No files found.
pkg/releasetesting/environment_test.go
View file @
a2e8b188
...
...
@@ -89,6 +89,14 @@ func TestDeleteTestPodsFailingDelete(t *testing.T) {
}
}
func
TestGetTestPodLogs
(
t
*
testing
.
T
)
{
mockTestSuite
:=
testSuiteFixture
([]
string
{
manifestWithTestSuccessHook
})
mockTestEnv
:=
newMockTestingEnvironment
()
mockTestEnv
.
KubeClient
=
newGetLogKubeClient
()
mockTestEnv
.
GetLogs
(
mockTestSuite
.
TestManifests
)
}
func
TestStreamMessage
(
t
*
testing
.
T
)
{
mockTestEnv
:=
newMockTestingEnvironment
()
...
...
@@ -181,3 +189,13 @@ func newCreateFailingKubeClient() *createFailingKubeClient {
func
(
p
*
createFailingKubeClient
)
Create
(
ns
string
,
r
io
.
Reader
,
t
int64
,
shouldWait
bool
)
error
{
return
errors
.
New
(
"We ran out of budget and couldn't create finding-nemo"
)
}
type
getLogKubeClient
struct
{
tillerEnv
.
PrintingKubeClient
}
func
newGetLogKubeClient
()
*
getLogKubeClient
{
return
&
getLogKubeClient
{
PrintingKubeClient
:
tillerEnv
.
PrintingKubeClient
{
Out
:
ioutil
.
Discard
},
}
}
pkg/tiller/environment/environment_test.go
View file @
a2e8b188
...
...
@@ -78,6 +78,10 @@ func (k *mockKubeClient) WaitAndGetCompletedPodStatus(namespace string, reader i
return
""
,
nil
}
func
(
k
*
mockKubeClient
)
GetPodLogs
(
name
,
namespace
string
)
(
string
,
error
)
{
return
""
,
nil
}
func
(
k
*
mockKubeClient
)
WaitUntilCRDEstablished
(
reader
io
.
Reader
,
timeout
time
.
Duration
)
error
{
return
nil
}
...
...
pkg/tiller/release_server_test.go
View file @
a2e8b188
...
...
@@ -679,6 +679,9 @@ func (kc *mockHooksKubeClient) Validate(ns string, reader io.Reader) error {
func
(
kc
*
mockHooksKubeClient
)
WaitAndGetCompletedPodPhase
(
namespace
string
,
reader
io
.
Reader
,
timeout
time
.
Duration
)
(
v1
.
PodPhase
,
error
)
{
return
v1
.
PodUnknown
,
nil
}
func
(
kc
*
mockHooksKubeClient
)
GetPodLogs
(
name
,
namespace
string
)
(
string
,
error
)
{
return
""
,
nil
}
func
(
kc
*
mockHooksKubeClient
)
WaitUntilCRDEstablished
(
reader
io
.
Reader
,
timeout
time
.
Duration
)
error
{
return
nil
...
...
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