CloudMigrations: Add unit tests for snapshot management (#89521)
* add regex support for api tests * revert dumb thing * add api tests * add unit test for core async workflow * add xorm store unit tests * fix typo * remove unnecessary assignment
This commit is contained in:
@@ -535,7 +535,7 @@ func (cma *CloudMigrationAPI) UploadSnapshot(c *contextmodel.ReqContext) respons
|
||||
// 403: forbiddenError
|
||||
// 500: internalServerError
|
||||
func (cma *CloudMigrationAPI) CancelSnapshot(c *contextmodel.ReqContext) response.Response {
|
||||
_, span := cma.tracer.Start(c.Req.Context(), "MigrationAPI.CancelSnapshot")
|
||||
ctx, span := cma.tracer.Start(c.Req.Context(), "MigrationAPI.CancelSnapshot")
|
||||
defer span.End()
|
||||
|
||||
sessUid, snapshotUid := web.Params(c.Req)[":uid"], web.Params(c.Req)[":snapshotUid"]
|
||||
@@ -546,7 +546,9 @@ func (cma *CloudMigrationAPI) CancelSnapshot(c *contextmodel.ReqContext) respons
|
||||
return response.ErrOrFallback(http.StatusBadRequest, "invalid snapshot uid", err)
|
||||
}
|
||||
|
||||
// Implement
|
||||
if err := cma.cloudMigrationService.CancelSnapshot(ctx, sessUid, snapshotUid); err != nil {
|
||||
return response.ErrOrFallback(http.StatusInternalServerError, "error canceling snapshot", err)
|
||||
}
|
||||
|
||||
return response.JSON(http.StatusOK, nil)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user