Unverified Commit a2e8b188 authored by Jeff Knurek's avatar Jeff Knurek Committed by Matthew Fisher

TEST: add some rudimentary test code for helm test logs

Signed-off-by: 's avatarJeff Knurek <j.knurek@travelaudience.com>
parent 6529abe8
......@@ -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},
}
}
......@@ -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
}
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment