Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickhuie19 committed Oct 16, 2024
1 parent 5e8cb08 commit 208ec3e
Show file tree
Hide file tree
Showing 10 changed files with 50 additions and 189 deletions.
2 changes: 1 addition & 1 deletion core/monitoring/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package monitoring
import "go.opentelemetry.io/otel/attribute"

func KvMapToOtelAttributes(kvmap map[string]string) []attribute.KeyValue {
otelKVs := make([]attribute.KeyValue, len(kvmap))
otelKVs := make([]attribute.KeyValue, 0, len(kvmap))
for k, v := range kvmap {
otelKVs = append(otelKVs, attribute.String(k, v))
}
Expand Down
45 changes: 43 additions & 2 deletions core/monitoring/utils_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,48 @@
package monitoring

import "testing"
import (
"github.com/stretchr/testify/assert"
"go.opentelemetry.io/otel/attribute"
"testing"
)

func Test_KvMapToOtelAttributes(t *testing.T) {
func TestKvMapToOtelAttributes(t *testing.T) {
tests := []struct {
name string
input map[string]string
expected []attribute.KeyValue
}{
{
name: "empty map",
input: map[string]string{},
expected: []attribute.KeyValue{},
},
{
name: "single key-value pair",
input: map[string]string{
"key1": "value1",
},
expected: []attribute.KeyValue{
attribute.String("key1", "value1"),
},
},
{
name: "multiple key-value pairs",
input: map[string]string{
"key1": "value1",
"key2": "value2",
},
expected: []attribute.KeyValue{
attribute.String("key1", "value1"),
attribute.String("key2", "value2"),
},
},
}

for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
result := KvMapToOtelAttributes(tt.input)
assert.ElementsMatch(t, tt.expected, result, "unexpected KeyValue slice")
})
}
}
2 changes: 1 addition & 1 deletion core/scripts/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ require (
github.com/prometheus/client_golang v1.20.0
github.com/shopspring/decimal v1.4.0
github.com/smartcontractkit/chainlink-automation v0.8.0
github.com/smartcontractkit/chainlink-common v0.3.1-0.20241014122810-6c3cc4d0dc87
github.com/smartcontractkit/chainlink-common v0.3.1-0.20241015212658-06ab6c310f4d
github.com/smartcontractkit/chainlink/integration-tests v0.0.0-00010101000000-000000000000
github.com/smartcontractkit/chainlink/v2 v2.0.0-00010101000000-000000000000
github.com/smartcontractkit/libocr v0.0.0-20241007185508-adbe57025f12
Expand Down
1 change: 1 addition & 0 deletions core/scripts/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1076,6 +1076,7 @@ github.com/smartcontractkit/chainlink-ccip v0.0.0-20241014104242-9227e5c976a7 h1
github.com/smartcontractkit/chainlink-ccip v0.0.0-20241014104242-9227e5c976a7/go.mod h1:H4BTXnZBhwRdsAFjqWZpB1/f3IZnuB/Ql7pXPmokzXg=
github.com/smartcontractkit/chainlink-common v0.3.1-0.20241014122810-6c3cc4d0dc87 h1:48qauRZcdxAOrgeko4RTm9ti4GGbSfzkcI4Dr/1FmjU=
github.com/smartcontractkit/chainlink-common v0.3.1-0.20241014122810-6c3cc4d0dc87/go.mod h1:tsGgeEJc5SUSlfVGSX0wR0EkRU3pM58D6SKF97V68ko=
github.com/smartcontractkit/chainlink-common v0.3.1-0.20241015212658-06ab6c310f4d/go.mod h1:tsGgeEJc5SUSlfVGSX0wR0EkRU3pM58D6SKF97V68ko=
github.com/smartcontractkit/chainlink-cosmos v0.5.1 h1:2xeZWh+4/w7xalTdAu8jqgFuxZ291aYTEwZhlQEv/BY=
github.com/smartcontractkit/chainlink-cosmos v0.5.1/go.mod h1:c1wUtVxXUqW4PzuCQhuHaBDZFv9XAQjhKTqam7GLGIU=
github.com/smartcontractkit/chainlink-data-streams v0.1.0 h1:wcRJRm7eqfbgN+Na+GjAe0/IUn6XwmSagFHqIWHHBGk=
Expand Down
129 changes: 0 additions & 129 deletions core/services/workflows/utils.go

This file was deleted.

54 changes: 0 additions & 54 deletions core/services/workflows/utils_test.go

This file was deleted.

2 changes: 1 addition & 1 deletion integration-tests/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ require (
github.com/smartcontractkit/chain-selectors v1.0.27
github.com/smartcontractkit/chainlink-automation v0.8.0
github.com/smartcontractkit/chainlink-ccip v0.0.0-20241014104242-9227e5c976a7
github.com/smartcontractkit/chainlink-common v0.3.1-0.20241014122810-6c3cc4d0dc87
github.com/smartcontractkit/chainlink-common v0.3.1-0.20241015212658-06ab6c310f4d
github.com/smartcontractkit/chainlink-testing-framework/havoc v1.50.0
github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.11-0.20241011153842-b2804aed25b4
github.com/smartcontractkit/chainlink-testing-framework/lib/grafana v1.50.0
Expand Down
1 change: 1 addition & 0 deletions integration-tests/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1406,6 +1406,7 @@ github.com/smartcontractkit/chainlink-ccip v0.0.0-20241014104242-9227e5c976a7 h1
github.com/smartcontractkit/chainlink-ccip v0.0.0-20241014104242-9227e5c976a7/go.mod h1:H4BTXnZBhwRdsAFjqWZpB1/f3IZnuB/Ql7pXPmokzXg=
github.com/smartcontractkit/chainlink-common v0.3.1-0.20241014122810-6c3cc4d0dc87 h1:48qauRZcdxAOrgeko4RTm9ti4GGbSfzkcI4Dr/1FmjU=
github.com/smartcontractkit/chainlink-common v0.3.1-0.20241014122810-6c3cc4d0dc87/go.mod h1:tsGgeEJc5SUSlfVGSX0wR0EkRU3pM58D6SKF97V68ko=
github.com/smartcontractkit/chainlink-common v0.3.1-0.20241015212658-06ab6c310f4d/go.mod h1:tsGgeEJc5SUSlfVGSX0wR0EkRU3pM58D6SKF97V68ko=
github.com/smartcontractkit/chainlink-cosmos v0.5.1 h1:2xeZWh+4/w7xalTdAu8jqgFuxZ291aYTEwZhlQEv/BY=
github.com/smartcontractkit/chainlink-cosmos v0.5.1/go.mod h1:c1wUtVxXUqW4PzuCQhuHaBDZFv9XAQjhKTqam7GLGIU=
github.com/smartcontractkit/chainlink-data-streams v0.1.0 h1:wcRJRm7eqfbgN+Na+GjAe0/IUn6XwmSagFHqIWHHBGk=
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/load/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ require (
github.com/pkg/errors v0.9.1
github.com/rs/zerolog v1.33.0
github.com/slack-go/slack v0.12.2
github.com/smartcontractkit/chainlink-common v0.3.1-0.20241014122810-6c3cc4d0dc87
github.com/smartcontractkit/chainlink-common v0.3.1-0.20241015212658-06ab6c310f4d
github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.11-0.20241011153842-b2804aed25b4
github.com/smartcontractkit/chainlink-testing-framework/seth v1.50.1
github.com/smartcontractkit/chainlink-testing-framework/wasp v1.50.0
Expand Down
1 change: 1 addition & 0 deletions integration-tests/load/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1383,6 +1383,7 @@ github.com/smartcontractkit/chainlink-ccip v0.0.0-20241014104242-9227e5c976a7 h1
github.com/smartcontractkit/chainlink-ccip v0.0.0-20241014104242-9227e5c976a7/go.mod h1:H4BTXnZBhwRdsAFjqWZpB1/f3IZnuB/Ql7pXPmokzXg=
github.com/smartcontractkit/chainlink-common v0.3.1-0.20241014122810-6c3cc4d0dc87 h1:48qauRZcdxAOrgeko4RTm9ti4GGbSfzkcI4Dr/1FmjU=
github.com/smartcontractkit/chainlink-common v0.3.1-0.20241014122810-6c3cc4d0dc87/go.mod h1:tsGgeEJc5SUSlfVGSX0wR0EkRU3pM58D6SKF97V68ko=
github.com/smartcontractkit/chainlink-common v0.3.1-0.20241015212658-06ab6c310f4d/go.mod h1:tsGgeEJc5SUSlfVGSX0wR0EkRU3pM58D6SKF97V68ko=
github.com/smartcontractkit/chainlink-cosmos v0.5.1 h1:2xeZWh+4/w7xalTdAu8jqgFuxZ291aYTEwZhlQEv/BY=
github.com/smartcontractkit/chainlink-cosmos v0.5.1/go.mod h1:c1wUtVxXUqW4PzuCQhuHaBDZFv9XAQjhKTqam7GLGIU=
github.com/smartcontractkit/chainlink-data-streams v0.1.0 h1:wcRJRm7eqfbgN+Na+GjAe0/IUn6XwmSagFHqIWHHBGk=
Expand Down

0 comments on commit 208ec3e

Please sign in to comment.