Commit 538e8297 authored by Michelle Noorali's avatar Michelle Noorali

ref(*): add namespace info to failing test msg

* also cleanup comments
parent bf9ae52e
...@@ -79,8 +79,7 @@ service ReleaseService { ...@@ -79,8 +79,7 @@ service ReleaseService {
rpc GetHistory(GetHistoryRequest) returns (GetHistoryResponse) { rpc GetHistory(GetHistoryRequest) returns (GetHistoryResponse) {
} }
//TODO: move this to a test release service or rename to RunReleaseTest // RunReleaseTest executes the tests defined of a named release
// TestRelease runs the tests for a given release
rpc RunReleaseTest(TestReleaseRequest) returns (stream TestReleaseResponse) { rpc RunReleaseTest(TestReleaseRequest) returns (stream TestReleaseResponse) {
} }
} }
...@@ -318,8 +317,7 @@ message TestReleaseRequest { ...@@ -318,8 +317,7 @@ message TestReleaseRequest {
int64 timeout = 2; int64 timeout = 2;
} }
// TestReleaseResponse // TestReleaseResponse represents a message from executing a test
message TestReleaseResponse { message TestReleaseResponse {
// TODO: change to repeated hapi.release.Release.Test results = 1; (for stream)
string msg = 1; string msg = 1;
} }
...@@ -26,7 +26,7 @@ import ( ...@@ -26,7 +26,7 @@ import (
) )
const releaseTestDesc = ` const releaseTestDesc = `
Th test command runs the tests for a release. The test command runs the tests for a release.
The argument this command takes is the name of a deployed release. The argument this command takes is the name of a deployed release.
The tests to be run are defined in the chart that was installed. The tests to be run are defined in the chart that was installed.
......
...@@ -43,8 +43,8 @@ func streamError(info string, stream services.ReleaseService_RunReleaseTestServe ...@@ -43,8 +43,8 @@ func streamError(info string, stream services.ReleaseService_RunReleaseTestServe
return err return err
} }
func streamFailed(name string, stream services.ReleaseService_RunReleaseTestServer) error { func streamFailed(name, namespace string, stream services.ReleaseService_RunReleaseTestServer) error {
msg := fmt.Sprintf("FAILED: %s, run `kubectl logs %s` for more info", name, name) msg := fmt.Sprintf("FAILED: %s, run `kubectl logs %s --namespace %s` for more info", name, name, namespace)
err := streamMessage(msg, stream) err := streamMessage(msg, stream)
return err return err
} }
......
...@@ -103,10 +103,10 @@ func (t *TestSuite) Run(env *Environment) error { ...@@ -103,10 +103,10 @@ func (t *TestSuite) Run(env *Environment) error {
} }
} else if resourceCreated && resourceCleanExit && status == api.PodFailed { } else if resourceCreated && resourceCleanExit && status == api.PodFailed {
test.result.Status = release.TestRun_FAILURE test.result.Status = release.TestRun_FAILURE
if streamErr := streamFailed(test.result.Name, env.Stream); streamErr != nil { if streamErr := streamFailed(test.result.Name, env.Namespace, env.Stream); streamErr != nil {
return err return err
} }
} //else if resourceCreated && resourceCleanExit && status == api.PodUnkown { }
test.result.CompletedAt = timeconv.Now() test.result.CompletedAt = timeconv.Now()
t.Results = append(t.Results, test.result) t.Results = append(t.Results, test.result)
......
...@@ -128,7 +128,7 @@ kind: Pod ...@@ -128,7 +128,7 @@ kind: Pod
metadata: metadata:
name: finding-nemo, name: finding-nemo,
annotations: annotations:
"helm.sh/hook": test "helm.sh/hook": test-success
spec: spec:
containers: containers:
- name: nemo-test - name: nemo-test
......
...@@ -58,7 +58,7 @@ kind: Pod ...@@ -58,7 +58,7 @@ kind: Pod
metadata: metadata:
name: finding-nemo, name: finding-nemo,
annotations: annotations:
"helm.sh/hook": test "helm.sh/hook": test-success
spec: spec:
containers: containers:
- name: nemo-test - name: nemo-test
......
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