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
Commit b6732e6a authored by nanmu42's avatar nanmu42
Browse files

fix: refactor per code review

parent 907dafba
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -7,7 +7,6 @@ import (
"net/http"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"gitlab.com/gitlab-org/gitlab-shell/v14/client/testserver"
"gitlab.com/gitlab-org/gitlab-shell/v14/internal/command/commandargs"
Loading
Loading
@@ -36,16 +35,13 @@ func TestGitAudit(t *testing.T) {
var request *gitauditevent.Request
require.NoError(t, json.Unmarshal(body, &request))
assert.Equal(t, testUsername, request.Username)
assert.Equal(t, testRepo, request.Repo)
require.Equal(t, testUsername, request.Username)
require.Equal(t, testRepo, request.Repo)
w.WriteHeader(http.StatusOK)
},
},
}
defer func() {
assert.True(t, called)
}()
s := &commandargs.Shell{
CommandType: commandargs.UploadArchive,
Loading
Loading
@@ -56,4 +52,6 @@ func TestGitAudit(t *testing.T) {
Username: testUsername,
Repo: testRepo,
}, nil)
require.True(t, called)
}
Loading
Loading
@@ -7,7 +7,6 @@ import (
"net/http"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
pb "gitlab.com/gitlab-org/gitaly/v16/proto/go/gitalypb"
"gitlab.com/gitlab-org/gitlab-shell/v14/client/testserver"
Loading
Loading
@@ -54,12 +53,12 @@ func setup(t *testing.T, responseStatus int) *Client {
var request *Request
require.NoError(t, json.Unmarshal(body, &request))
assert.Equal(t, testUsername, request.Username)
assert.Equal(t, testAction, request.Action)
assert.Equal(t, testRepo, request.Repo)
assert.Equal(t, "ssh", request.Protocol)
assert.Equal(t, testPackfileWants, request.PackfileStats.Wants)
assert.Equal(t, testPackfileHaves, request.PackfileStats.Haves)
require.Equal(t, testUsername, request.Username)
require.Equal(t, testAction, request.Action)
require.Equal(t, testRepo, request.Repo)
require.Equal(t, "ssh", request.Protocol)
require.Equal(t, testPackfileWants, request.PackfileStats.Wants)
require.Equal(t, testPackfileHaves, request.PackfileStats.Haves)
w.WriteHeader(responseStatus)
},
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