TEST: add some rudimentary test code for helm test logs

Signed-off-by: Jeff Knurek <j.knurek@travelaudience.com>
pull/6612/head
Jeff Knurek 6 years ago committed by Matthew Fisher
parent 6529abe85f
commit a2e8b188c2
No known key found for this signature in database
GPG Key ID: 92AA783CBAAE8E3B

@ -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

Loading…
Cancel
Save