Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
gitpod-io
GitHub Repository: gitpod-io/gitpod
Path: blob/main/components/common-go/log/fields_test.go
2498 views
1
// Copyright (c) 2023 Gitpod GmbH. All rights reserved.
2
// Licensed under the GNU Affero General Public License (AGPL).
3
// See License.AGPL.txt in the project root for license information.
4
5
package log
6
7
import (
8
"testing"
9
10
"github.com/sirupsen/logrus"
11
"github.com/stretchr/testify/require"
12
)
13
14
func TestCompose(t *testing.T) {
15
fields := Compose(
16
WorkspaceOwner("owner"),
17
WorkspaceID("workspace"),
18
WorkspaceInstanceID("instance"),
19
ProjectID("project"),
20
OrganizationID("org"),
21
)
22
require.Equal(t, logrus.Fields{
23
OwnerIDField: "owner",
24
OrganizationIDField: "org",
25
TeamIDField: "org",
26
ProjectIDField: "project",
27
WorkspaceInstanceIDField: "instance",
28
WorkspaceIDField: "workspace",
29
}, fields)
30
}
31
32