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