Add function test CLI tests (#2871)
* Add function test CLI tests * Add few more services to tests Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
This commit is contained in:
@@ -164,13 +164,13 @@ func (opts *TestSubCommand) do(input cli.Input) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
console.Errorf("Error calling function %s: %d; Please try again or fix the error: %s\n", m.Name, resp.StatusCode, string(body))
|
||||
err = printPodLogs(input.Context(), opts.Client(), m)
|
||||
console.Errorf("calling function %s: %d; Please try again or fix the error: %s\n", m.Name, resp.StatusCode, string(body))
|
||||
err = util.FunctionPodLogs(input.Context(), m.Name, m.Namespace, opts.Client())
|
||||
if err != nil {
|
||||
console.Errorf("Error getting function logs from controller: %v. Try to get logs from log database.", err)
|
||||
console.Errorf("getting function logs: %v. Try to get logs from log database.", err)
|
||||
err = Log(input)
|
||||
if err != nil {
|
||||
return errors.Wrapf(err, "error retrieving function log from log database")
|
||||
console.Errorf("getting function logs from log database: %v", err)
|
||||
}
|
||||
}
|
||||
return errors.New("error getting function response")
|
||||
@@ -236,13 +236,3 @@ func doHTTPRequest(ctx context.Context, url string, headers []string, method, bo
|
||||
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
func printPodLogs(ctx context.Context, client cmd.Client, fnMeta *metav1.ObjectMeta) error {
|
||||
err := util.FunctionPodLogs(ctx, fnMeta.Name, fnMeta.Namespace, client)
|
||||
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "error executing get logs request")
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user