As we reevaluate how to best support and maintain Staging Ref in the future, we encourage development teams using this environment to highlight their use cases in the following issue: https://gitlab.com/gitlab-com/gl-infra/software-delivery/framework/software-delivery-framework-issue-tracker/-/issues/36.

Skip to content
Snippets Groups Projects
Unverified Commit a82047f6 authored by Archish Thakkar's avatar Archish Thakkar Committed by GitLab
Browse files

Lint fixes for customaction package

parent c5394a4b
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -8,6 +8,7 @@ import (
"net/http"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"gitlab.com/gitlab-org/gitlab-shell/v14/client/testserver"
Loading
Loading
@@ -24,32 +25,32 @@ func TestExecuteEOFSent(t *testing.T) {
Path: "/geo/proxy/info_refs_receive_pack",
Handler: func(w http.ResponseWriter, r *http.Request) {
b, err := io.ReadAll(r.Body)
require.NoError(t, err)
assert.NoError(t, err)
var request *Request
require.NoError(t, json.Unmarshal(b, &request))
assert.NoError(t, json.Unmarshal(b, &request))
require.Equal(t, request.Data.UserID, who)
require.Empty(t, request.Output)
assert.Equal(t, request.Data.UserID, who)
assert.Empty(t, request.Output)
err = json.NewEncoder(w).Encode(Response{Result: []byte("custom")})
require.NoError(t, err)
assert.NoError(t, err)
},
},
{
Path: "/geo/proxy/receive_pack",
Handler: func(w http.ResponseWriter, r *http.Request) {
b, err := io.ReadAll(r.Body)
require.NoError(t, err)
assert.NoError(t, err)
var request *Request
require.NoError(t, json.Unmarshal(b, &request))
assert.NoError(t, json.Unmarshal(b, &request))
require.Equal(t, request.Data.UserID, who)
require.Equal(t, "0009input", string(request.Output))
assert.Equal(t, request.Data.UserID, who)
assert.Equal(t, "0009input", string(request.Output))
err = json.NewEncoder(w).Encode(Response{Result: []byte("output")})
require.NoError(t, err)
assert.NoError(t, err)
},
},
}
Loading
Loading
@@ -82,7 +83,7 @@ func TestExecuteEOFSent(t *testing.T) {
// expect printing of info message, "custom" string from the first request
// and "output" string from the second request
require.Equal(t, "customoutput", outBuf.String())
assert.Equal(t, "customoutput", outBuf.String())
}
func TestExecuteNoEOFSent(t *testing.T) {
Loading
Loading
@@ -93,32 +94,32 @@ func TestExecuteNoEOFSent(t *testing.T) {
Path: "/geo/proxy/info_refs_upload_pack",
Handler: func(w http.ResponseWriter, r *http.Request) {
b, err := io.ReadAll(r.Body)
require.NoError(t, err)
assert.NoError(t, err)
var request *Request
require.NoError(t, json.Unmarshal(b, &request))
assert.NoError(t, json.Unmarshal(b, &request))
require.Equal(t, request.Data.UserID, who)
require.Empty(t, request.Output)
assert.Equal(t, request.Data.UserID, who)
assert.Empty(t, request.Output)
err = json.NewEncoder(w).Encode(Response{Result: []byte("custom")})
require.NoError(t, err)
assert.NoError(t, err)
},
},
{
Path: "/geo/proxy/upload_pack",
Handler: func(w http.ResponseWriter, r *http.Request) {
b, err := io.ReadAll(r.Body)
require.NoError(t, err)
assert.NoError(t, err)
var request *Request
require.NoError(t, json.Unmarshal(b, &request))
assert.NoError(t, json.Unmarshal(b, &request))
require.Equal(t, request.Data.UserID, who)
require.Equal(t, "0032want 343d70886785dc1f98aaf70f3b4ca87c93a5d0dd\n", string(request.Output))
assert.Equal(t, request.Data.UserID, who)
assert.Equal(t, "0032want 343d70886785dc1f98aaf70f3b4ca87c93a5d0dd\n", string(request.Output))
err = json.NewEncoder(w).Encode(Response{Result: []byte("output")})
require.NoError(t, err)
assert.NoError(t, err)
},
},
}
Loading
Loading
@@ -151,5 +152,5 @@ func TestExecuteNoEOFSent(t *testing.T) {
// expect printing of info message, "custom" string from the first request
// and "output" string from the second request
require.Equal(t, "customoutput", outBuf.String())
assert.Equal(t, "customoutput", outBuf.String())
}
Loading
Loading
@@ -173,26 +173,6 @@ internal/command/readwriter/readwriter.go:7:6: exported: exported type ReadWrite
internal/command/receivepack/gitalycall_test.go:24:4: S1038: should use t.Logf(...) instead of t.Log(fmt.Sprintf(...)) (gosimple)
internal/command/receivepack/gitalycall_test.go:31:5: var-naming: struct field keyId should be keyID (revive)
internal/command/receivepack/gitalycall_test.go:98:5: expected-actual: need to reverse actual and expected values (testifylint)
internal/command/shared/customaction/customaction_test.go:27:5: go-require: do not use require in http handlers (testifylint)
internal/command/shared/customaction/customaction_test.go:30:5: go-require: do not use require in http handlers (testifylint)
internal/command/shared/customaction/customaction_test.go:32:5: go-require: do not use require in http handlers (testifylint)
internal/command/shared/customaction/customaction_test.go:33:5: go-require: do not use require in http handlers (testifylint)
internal/command/shared/customaction/customaction_test.go:36:5: go-require: do not use require in http handlers (testifylint)
internal/command/shared/customaction/customaction_test.go:43:5: go-require: do not use require in http handlers (testifylint)
internal/command/shared/customaction/customaction_test.go:46:5: go-require: do not use require in http handlers (testifylint)
internal/command/shared/customaction/customaction_test.go:48:5: go-require: do not use require in http handlers (testifylint)
internal/command/shared/customaction/customaction_test.go:49:5: go-require: do not use require in http handlers (testifylint)
internal/command/shared/customaction/customaction_test.go:52:5: go-require: do not use require in http handlers (testifylint)
internal/command/shared/customaction/customaction_test.go:96:5: go-require: do not use require in http handlers (testifylint)
internal/command/shared/customaction/customaction_test.go:99:5: go-require: do not use require in http handlers (testifylint)
internal/command/shared/customaction/customaction_test.go:101:5: go-require: do not use require in http handlers (testifylint)
internal/command/shared/customaction/customaction_test.go:102:5: go-require: do not use require in http handlers (testifylint)
internal/command/shared/customaction/customaction_test.go:105:5: go-require: do not use require in http handlers (testifylint)
internal/command/shared/customaction/customaction_test.go:112:5: go-require: do not use require in http handlers (testifylint)
internal/command/shared/customaction/customaction_test.go:115:5: go-require: do not use require in http handlers (testifylint)
internal/command/shared/customaction/customaction_test.go:117:5: go-require: do not use require in http handlers (testifylint)
internal/command/shared/customaction/customaction_test.go:118:5: go-require: do not use require in http handlers (testifylint)
internal/command/shared/customaction/customaction_test.go:121:5: go-require: do not use require in http handlers (testifylint)
internal/config/config.go:1:1: package-comments: should have a package comment (revive)
internal/config/config.go:21:2: G101: Potential hardcoded credentials (gosec)
internal/config/config.go:24:6: exported: exported type YamlDuration should have comment or be unexported (revive)
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment