Skip to content

Commit 827b282

Browse files
committed
fix lints
1 parent 570ebaa commit 827b282

File tree

10 files changed

+44
-76
lines changed

10 files changed

+44
-76
lines changed

go.md

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -2,60 +2,3 @@
22
```mermaid
33
flowchart LR
44
5-
chainlink-testing-framework/examples_wasp --> chainlink-testing-framework/seth
6-
chainlink-testing-framework/examples_wasp --> chainlink-testing-framework/wasp
7-
click chainlink-testing-framework/examples_wasp href "https://github.com/smartcontractkit/chainlink-testing-framework"
8-
chainlink-testing-framework/framework
9-
click chainlink-testing-framework/framework href "https://github.com/smartcontractkit/chainlink-testing-framework"
10-
chainlink-testing-framework/framework/examples --> chainlink-testing-framework/framework
11-
chainlink-testing-framework/framework/examples --> chainlink-testing-framework/seth
12-
chainlink-testing-framework/framework/examples --> chainlink-testing-framework/wasp
13-
click chainlink-testing-framework/framework/examples href "https://github.com/smartcontractkit/chainlink-testing-framework"
14-
chainlink-testing-framework/framework/examples_cll --> chainlink-testing-framework/framework
15-
click chainlink-testing-framework/framework/examples_cll href "https://github.com/smartcontractkit/chainlink-testing-framework"
16-
chainlink-testing-framework/grafana
17-
click chainlink-testing-framework/grafana href "https://github.com/smartcontractkit/chainlink-testing-framework"
18-
chainlink-testing-framework/havoc --> chainlink-testing-framework/lib/grafana
19-
click chainlink-testing-framework/havoc href "https://github.com/smartcontractkit/chainlink-testing-framework"
20-
chainlink-testing-framework/lib --> chainlink-testing-framework/seth
21-
chainlink-testing-framework/lib --> chainlink-testing-framework/wasp
22-
click chainlink-testing-framework/lib href "https://github.com/smartcontractkit/chainlink-testing-framework"
23-
chainlink-testing-framework/lib/grafana
24-
click chainlink-testing-framework/lib/grafana href "https://github.com/smartcontractkit/chainlink-testing-framework"
25-
chainlink-testing-framework/seth --> seth
26-
click chainlink-testing-framework/seth href "https://github.com/smartcontractkit/chainlink-testing-framework"
27-
chainlink-testing-framework/tools/citool --> chainlink-testing-framework/lib
28-
click chainlink-testing-framework/tools/citool href "https://github.com/smartcontractkit/chainlink-testing-framework"
29-
chainlink-testing-framework/tools/envresolve --> chainlink-testing-framework/lib
30-
click chainlink-testing-framework/tools/envresolve href "https://github.com/smartcontractkit/chainlink-testing-framework"
31-
chainlink-testing-framework/tools/gotestloghelper --> chainlink-testing-framework/lib
32-
click chainlink-testing-framework/tools/gotestloghelper href "https://github.com/smartcontractkit/chainlink-testing-framework"
33-
chainlink-testing-framework/wasp --> chainlink-testing-framework/grafana
34-
chainlink-testing-framework/wasp --> chainlink-testing-framework/lib/grafana
35-
click chainlink-testing-framework/wasp href "https://github.com/smartcontractkit/chainlink-testing-framework"
36-
chainlink-testing-framework/wasp-tests --> chainlink-testing-framework/wasp
37-
click chainlink-testing-framework/wasp-tests href "https://github.com/smartcontractkit/chainlink-testing-framework"
38-
seth
39-
click seth href "https://github.com/smartcontractkit/seth"
40-
41-
subgraph chainlink-testing-framework-repo[chainlink-testing-framework]
42-
chainlink-testing-framework/examples_wasp
43-
chainlink-testing-framework/framework
44-
chainlink-testing-framework/framework/examples
45-
chainlink-testing-framework/framework/examples_cll
46-
chainlink-testing-framework/grafana
47-
chainlink-testing-framework/havoc
48-
chainlink-testing-framework/lib
49-
chainlink-testing-framework/lib/grafana
50-
chainlink-testing-framework/seth
51-
chainlink-testing-framework/tools/citool
52-
chainlink-testing-framework/tools/envresolve
53-
chainlink-testing-framework/tools/gotestloghelper
54-
chainlink-testing-framework/wasp
55-
chainlink-testing-framework/wasp-tests
56-
end
57-
click chainlink-testing-framework-repo href "https://github.com/smartcontractkit/chainlink-testing-framework"
58-
59-
classDef outline stroke-dasharray:6,fill:none;
60-
class chainlink-testing-framework-repo outline
61-
```

wasp/benchspy/generator_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,7 @@ func TestBenchSpy_GeneratorQueryExecutor_Execute(t *testing.T) {
314314

315315
cfg.Gun = fakeGun
316316
gen, err := wasp.NewGenerator(cfg)
317+
require.NoError(t, err)
317318

318319
executor, _ := NewGeneratorQueryExecutor(gen)
319320
err = executor.Execute(context.Background())

wasp/benchspy/loki_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212
"github.com/smartcontractkit/chainlink-testing-framework/lib/client"
1313
"github.com/smartcontractkit/chainlink-testing-framework/wasp"
1414
"github.com/stretchr/testify/assert"
15+
"github.com/stretchr/testify/require"
1516
)
1617

1718
// TestLokiClient_QueryLogs tests the LokiClient's ability to query Loki logs
@@ -135,9 +136,9 @@ func TestBenchSpy_LokiClient_InternalServerError(t *testing.T) {
135136
}
136137

137138
func TestBenchSpy_LokiClient_DebugMode(t *testing.T) {
138-
// Set the RESTY_DEBUG environment variable
139-
os.Setenv("RESTY_DEBUG", "true")
140-
defer os.Unsetenv("RESTY_DEBUG") // Clean up after the test
139+
err := os.Setenv("RESTY_DEBUG", "true")
140+
require.NoError(t, err)
141+
t.Cleanup(func() { _ = os.Unsetenv("RESTY_DEBUG") })
141142

142143
// Create a mock Loki server
143144
mockServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {

wasp/benchspy/prometheus.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,6 @@ func (r *PrometheusQueryExecutor) MustResultsAsValue() map[string]model.Value {
183183
func (r *PrometheusQueryExecutor) TimeRange(startTime, endTime time.Time) {
184184
r.StartTime = startTime
185185
r.EndTime = endTime
186-
return
187186
}
188187

189188
func (r *PrometheusQueryExecutor) standardQuery(metric StandardResourceMetric, nameRegexPattern string, startTime, endTime time.Time) (string, error) {

wasp/benchspy/prometheus_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,6 @@ func (m *mockQueryExecutor) Kind() string {
351351
}
352352

353353
func (r *mockQueryExecutor) TimeRange(startTime, endTime time.Time) {
354-
return
355354
}
356355

357356
func (m *mockQueryExecutor) Results() map[string]interface{} {

wasp/benchspy/report_test.go

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,22 @@ func TestBenchSpy_NewStandardReport(t *testing.T) {
8989
})
9090

9191
t.Run("missing loki config", func(t *testing.T) {
92-
gen := *basicGen
93-
gen.Cfg.LokiConfig = nil
92+
gen := &wasp.Generator{
93+
Cfg: &wasp.Config{
94+
T: t,
95+
GenName: "test-gen",
96+
Labels: map[string]string{
97+
"branch": "main",
98+
"commit": "abc123",
99+
},
100+
Schedule: []*wasp.Segment{
101+
{StartTime: baseTime, EndTime: baseTime.Add(time.Hour)},
102+
},
103+
// no loki config
104+
},
105+
}
94106

95-
report, err := NewStandardReport("test-commit", WithQueryExecutorType(StandardQueryExecutor_Loki), WithGenerators(&gen))
107+
report, err := NewStandardReport("test-commit", WithQueryExecutorType(StandardQueryExecutor_Loki), WithGenerators(gen))
96108
require.Nil(t, report)
97109
require.Error(t, err)
98110
assert.Contains(t, err.Error(), "loki config is missing")

wasp/benchspy/storage_test.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -380,8 +380,9 @@ func TestBenchSpy_LocalStorage_Store(t *testing.T) {
380380
_, err = os.Stat(filepath.Join(DEFAULT_DIRECTORY, "test-abc123.json"))
381381
require.NoError(t, err)
382382

383-
// Cleanup
384-
os.RemoveAll(DEFAULT_DIRECTORY)
383+
t.Cleanup(func() {
384+
_ = os.RemoveAll(DEFAULT_DIRECTORY)
385+
})
385386
})
386387

387388
t.Run("handles special characters in test name and commit", func(t *testing.T) {
@@ -407,7 +408,7 @@ func TestBenchSpy_LocalStorage_Store(t *testing.T) {
407408
require.Error(t, err)
408409

409410
// Restore permissions for cleanup
410-
require.NoError(t, os.Chmod(restrictedDir, 0755))
411+
t.Cleanup(func() { _ = os.Chmod(restrictedDir, 0755) })
411412
})
412413
}
413414
func TestBenchSpy_LocalStorage_Load_GitEdgeCases(t *testing.T) {
@@ -485,7 +486,7 @@ func TestBenchSpy_LocalStorage_Load_GitEdgeCases(t *testing.T) {
485486
func TestBenchSpy_LocalStorage_Load_PathEdgeCases(t *testing.T) {
486487
t.Run("loads with relative directory path", func(t *testing.T) {
487488
relDir := "./test_reports"
488-
defer os.RemoveAll(relDir)
489+
t.Cleanup(func() { _ = os.RemoveAll(relDir) })
489490

490491
storage := &LocalStorage{Directory: relDir}
491492
testData := testReport{Data: "test"}

wasp/examples/go.mod

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ go 1.23
55
toolchain go1.23.3
66

77
replace github.com/smartcontractkit/chainlink-testing-framework/wasp => ../
8-
replace github.com/smartcontractkit/chainlink-testing-framework/lib => ../../lib
98

109
require (
1110
github.com/K-Phoen/grabana v0.22.2
1211
github.com/go-resty/resty/v2 v2.15.3
12+
github.com/prometheus/common v0.60.0
1313
github.com/smartcontractkit/chainlink-testing-framework/wasp v1.50.1
1414
github.com/stretchr/testify v1.9.0
1515
go.uber.org/ratelimit v0.3.1
@@ -206,7 +206,6 @@ require (
206206
github.com/prometheus/alertmanager v0.26.0 // indirect
207207
github.com/prometheus/client_golang v1.20.5 // indirect
208208
github.com/prometheus/client_model v0.6.1 // indirect
209-
github.com/prometheus/common v0.60.0 // indirect
210209
github.com/prometheus/common/sigv4 v0.1.0 // indirect
211210
github.com/prometheus/exporter-toolkit v0.10.1-0.20230714054209-2f4150c63f97 // indirect
212211
github.com/prometheus/procfs v0.15.1 // indirect
@@ -220,7 +219,7 @@ require (
220219
github.com/shoenig/go-m1cpu v0.1.6 // indirect
221220
github.com/shopspring/decimal v1.2.0 // indirect
222221
github.com/sirupsen/logrus v1.9.3 // indirect
223-
github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.18 // indirect
222+
github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.20-0.20241211181913-305088e7925a // indirect
224223
github.com/smartcontractkit/chainlink-testing-framework/lib/grafana v1.50.0 // indirect
225224
github.com/soheilhy/cmux v0.1.5 // indirect
226225
github.com/sony/gobreaker v0.5.0 // indirect

wasp/examples/go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ github.com/Masterminds/sprig/v3 v3.2.3/go.mod h1:rXcFaZ2zZbLRJv/xSysmlgIM1u11eBa
8686
github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY=
8787
github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU=
8888
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
89-
github.com/OneOfOne/xxhash v1.2.8 h1:31czK/TI9sNkxIKfaUfGlU47BAxQ0ztGgd9vPyqimf8=
90-
github.com/OneOfOne/xxhash v1.2.8/go.mod h1:eZbhyaAYD41SGSSsnmcpxVoRiQ/MPUTjUdIIOT9Um7Q=
89+
github.com/OneOfOne/xxhash v1.2.6 h1:U68crOE3y3MPttCMQGywZOLrTeF5HHJ3/vDBCJn9/bA=
90+
github.com/OneOfOne/xxhash v1.2.6/go.mod h1:eZbhyaAYD41SGSSsnmcpxVoRiQ/MPUTjUdIIOT9Um7Q=
9191
github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
9292
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
9393
github.com/Workiva/go-datastructures v1.1.0 h1:hu20UpgZneBhQ3ZvwiOGlqJSKIosin2Rd5wAKUHEO/k=
@@ -862,8 +862,8 @@ github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6Mwd
862862
github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88=
863863
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
864864
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
865-
github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.18 h1:a3xetGZh2nFO1iX5xd9OuqiCkgbWLvW6fTN6fgVubPo=
866-
github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.18/go.mod h1:NwmlNKqrb02v4Sci4b5KW644nfH2BW+FrKbWwTN5r6M=
865+
github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.20-0.20241211181913-305088e7925a h1:mUidQlqrBDqQ06eCFgRQOSt96m76P6SibVkduHQJCVA=
866+
github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.20-0.20241211181913-305088e7925a/go.mod h1:ag7LEgejsVtPXaUNkcoFPpAoDkl1J8V2HSbqVUxfEtk=
867867
github.com/smartcontractkit/chainlink-testing-framework/lib/grafana v1.50.0 h1:VIxK8u0Jd0Q/VuhmsNm6Bls6Tb31H/sA3A/rbc5hnhg=
868868
github.com/smartcontractkit/chainlink-testing-framework/lib/grafana v1.50.0/go.mod h1:lyAu+oMXdNUzEDScj2DXB2IueY+SDXPPfyl/kb63tMM=
869869
github.com/soheilhy/cmux v0.1.5 h1:jjzc5WVemNEDTLwv9tlmemhC73tI08BNOIGwBOo10Js=

wasp/schedule_test.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,17 @@ func TestSmokeSchedules(t *testing.T) {
2222
{
2323
From: 10,
2424
Duration: 10 * time.Second,
25+
Type: SegmentType_Steps,
2526
},
2627
{
2728
From: 20,
2829
Duration: 10 * time.Second,
30+
Type: SegmentType_Steps,
2931
},
3032
{
3133
From: 30,
3234
Duration: 10 * time.Second,
35+
Type: SegmentType_Steps,
3336
},
3437
},
3538
},
@@ -40,14 +43,17 @@ func TestSmokeSchedules(t *testing.T) {
4043
{
4144
From: 100,
4245
Duration: 10 * time.Second,
46+
Type: SegmentType_Steps,
4347
},
4448
{
4549
From: 90,
4650
Duration: 10 * time.Second,
51+
Type: SegmentType_Steps,
4752
},
4853
{
4954
From: 80,
5055
Duration: 10 * time.Second,
56+
Type: SegmentType_Steps,
5157
},
5258
},
5359
},
@@ -58,6 +64,7 @@ func TestSmokeSchedules(t *testing.T) {
5864
{
5965
From: 1,
6066
Duration: 1 * time.Second,
67+
Type: SegmentType_Plain,
6168
},
6269
},
6370
},
@@ -71,10 +78,12 @@ func TestSmokeSchedules(t *testing.T) {
7178
{
7279
From: 200,
7380
Duration: 1 * time.Second,
81+
Type: SegmentType_Plain,
7482
},
7583
{
7684
From: 300,
7785
Duration: 1 * time.Second,
86+
Type: SegmentType_Plain,
7887
},
7988
},
8089
},
@@ -89,18 +98,22 @@ func TestSmokeSchedules(t *testing.T) {
8998
{
9099
From: 1,
91100
Duration: 1 * time.Second,
101+
Type: SegmentType_Plain,
92102
},
93103
{
94104
From: 100,
95105
Duration: 1 * time.Second,
106+
Type: SegmentType_Plain,
96107
},
97108
{
98109
From: 1,
99110
Duration: 1 * time.Second,
111+
Type: SegmentType_Plain,
100112
},
101113
{
102114
From: 100,
103115
Duration: 1 * time.Second,
116+
Type: SegmentType_Plain,
104117
},
105118
},
106119
},

0 commit comments

Comments
 (0)