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 faad9d1a authored by Ash McKenzie's avatar Ash McKenzie Committed by GitLab
Browse files

Merge branch 'pb-set-random-colleration-id-uploadarchive-test' into 'main'

Set random correlation ID in uploadarchive test

See merge request https://gitlab.com/gitlab-org/gitlab-shell/-/merge_requests/955



Merged-by: default avatarAsh McKenzie <amckenzie@gitlab.com>
Approved-by: default avatarAsh McKenzie <amckenzie@gitlab.com>
Co-authored-by: default avatarPatrick Bajao <ebajao@gitlab.com>
parents b1898a2c 318bb14b
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -53,7 +53,8 @@ func TestUploadArchive(t *testing.T) {
ReadWriter: &readwriter.ReadWriter{ErrOut: output, Out: output, In: input},
}
ctx := correlation.ContextWithCorrelation(context.Background(), "a-correlation-id")
correlationID := correlation.SafeRandomID()
ctx := correlation.ContextWithCorrelation(context.Background(), correlationID)
ctx = correlation.ContextWithClientName(ctx, "gitlab-shell-tests")
_, err := cmd.Execute(ctx)
Loading
Loading
@@ -75,7 +76,7 @@ func TestUploadArchive(t *testing.T) {
require.Equal(t, v, actual[0])
}
require.Empty(t, testServer.ReceivedMD["some-other-ff"])
require.Equal(t, testServer.ReceivedMD["x-gitlab-correlation-id"][0], "a-correlation-id")
require.Equal(t, testServer.ReceivedMD["x-gitlab-correlation-id"][0], correlationID)
})
}
}
Loading
Loading
@@ -6,6 +6,7 @@ import (
"testing"
"github.com/stretchr/testify/require"
"gitlab.com/gitlab-org/labkit/correlation"
"gitlab.com/gitlab-org/gitlab-shell/v14/client/testserver"
"gitlab.com/gitlab-org/gitlab-shell/v14/internal/command"
Loading
Loading
@@ -21,7 +22,10 @@ func TestAllowedAccess(t *testing.T) {
cmd, _ := setup(t, "1", requests)
cmd.Config.GitalyClient.InitSidechannelRegistry(context.Background())
ctxWithLogData, err := cmd.Execute(context.Background())
correlationID := correlation.SafeRandomID()
ctx := correlation.ContextWithCorrelation(context.Background(), correlationID)
ctx = correlation.ContextWithClientName(ctx, "gitlab-shell-tests")
ctxWithLogData, err := cmd.Execute(ctx)
require.NoError(t, err)
data := ctxWithLogData.Value("logData").(command.LogData)
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