diff --git a/pkg/modules/chromium/routes_test.go b/pkg/modules/chromium/routes_test.go index e841ffcf..281d0d3f 100644 --- a/pkg/modules/chromium/routes_test.go +++ b/pkg/modules/chromium/routes_test.go @@ -680,7 +680,7 @@ func TestConvertURL(t *testing.T) { options: DefaultOptions(), expectErr: true, expectHTTPErr: true, - expectHTTPStatus: http.StatusForbidden, + expectHTTPStatus: http.StatusBadRequest, }, { ctx: &api.ContextMock{Context: &api.Context{}}, diff --git a/pkg/modules/libreoffice/uno/uno_test.go b/pkg/modules/libreoffice/uno/uno_test.go index bea5c2ab..fdd91a77 100644 --- a/pkg/modules/libreoffice/uno/uno_test.go +++ b/pkg/modules/libreoffice/uno/uno_test.go @@ -752,7 +752,7 @@ func TestUNO_Extensions(t *testing.T) { extensions := mod.Extensions() actual := len(extensions) - expect := 76 + expect := 79 if actual != expect { t.Errorf("expected %d extensions, but got %d", expect, actual) diff --git a/pkg/modules/webhook/client.go b/pkg/modules/webhook/client.go index 7ad40adf..d1eb7d46 100644 --- a/pkg/modules/webhook/client.go +++ b/pkg/modules/webhook/client.go @@ -58,7 +58,7 @@ func (c client) send(body io.Reader, headers map[string]string, erroed bool) err // Worse, the "Content-Length" header is also removed. Therefore, in // order to keep this valuable information, we have to trust the caller // by reading the value of the "Content-Length" entry and set it as the - // content length of the request. It's kinda sub-optimal, but hey, at + // content length of the request. It's kinda suboptimal, but hey, at // least it works. bodySize, err := strconv.ParseInt(contentLength, 10, 64) diff --git a/pkg/modules/webhook/middleware_test.go b/pkg/modules/webhook/middleware_test.go index 60459182..9089f00e 100644 --- a/pkg/modules/webhook/middleware_test.go +++ b/pkg/modules/webhook/middleware_test.go @@ -359,7 +359,7 @@ func TestWebhookMiddlewareAsynchronousProcess(t *testing.T) { mod: buildWebhookModule(), next: func() echo.HandlerFunc { return func(c echo.Context) error { - return nil + return api.NewSentinelHTTPError(http.StatusBadRequest, http.StatusText(http.StatusBadRequest)) } }(), expectWebhookContentType: echo.MIMEApplicationJSONCharsetUTF8, @@ -400,14 +400,15 @@ func TestWebhookMiddlewareAsynchronousProcess(t *testing.T) { return func(c echo.Context) error { ctx := c.Get("context").(*api.Context) - return ctx.AddOutputPaths("/tests/test/testdata/api/sample3.pdf") + return ctx.AddOutputPaths("/tests/test/testdata/api/sample1.pdf") } }(), - returnedError: echo.ErrInternalServerError, - // Even though an error is returned the expected response is still a pdf, since the webhook error is only logged - expectWebhookContentType: "application/pdf", - expectWebhookMethod: http.MethodPost, - expectWebhookFilename: "foo", + returnedError: echo.ErrInternalServerError, + expectWebhookContentType: echo.MIMEApplicationJSONCharsetUTF8, + expectWebhookMethod: http.MethodPost, + expectWebhookErrorStatus: http.StatusInternalServerError, + expectWebhookErrorMessage: http.StatusText(http.StatusInternalServerError), + expectWebhookFilename: "foo", }, } { func() { diff --git a/test/gotest.sh b/test/gotest.sh index f5ff4099..d9c2de80 100755 --- a/test/gotest.sh +++ b/test/gotest.sh @@ -2,6 +2,5 @@ set -x -# TODO: remove -buildvcs=false when fix for https://github.com/golang/go/issues/51723 is live. -go test -buildvcs=false -race -covermode=atomic -coverprofile=/tests/coverage.txt ./... +go test -race -covermode=atomic -coverprofile=/tests/coverage.txt ./... go tool cover -html=coverage.txt -o /tests/coverage.html \ No newline at end of file