Skip to content

Commit

Permalink
Wasp deps remove (#1102)
Browse files Browse the repository at this point in the history
* downgrade protobuf, remove replace from wasp

* remove all old wasp references from Go files

* exclude linting for examples, goimports

* goimports

* fix wasp dashboard import

* go mod tidy examples
  • Loading branch information
skudasov authored Aug 28, 2024
1 parent 4055cb3 commit 9ea5d6a
Show file tree
Hide file tree
Showing 27 changed files with 189 additions and 164 deletions.
1 change: 1 addition & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,5 @@ issues:
- examples
- imports
- wasp/examples/*
- seth/examples_wasp/*
- k8s
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ require (
github.com/rs/zerolog v1.30.0
github.com/slack-go/slack v0.12.2
github.com/smartcontractkit/chainlink-testing-framework/seth v1.2.1-0.20240827112945-bd8c580392d6
github.com/smartcontractkit/wasp v0.4.8-0.20240826201742-8c8d2e49efb0
github.com/smartcontractkit/chainlink-testing-framework/wasp v0.4.9
github.com/spf13/cobra v1.8.0
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.9.0
Expand Down
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -603,10 +603,6 @@ github.com/grafana/loki v1.6.2-0.20231215164305-b51b7d7b5503 h1:gdrsYbmk8822v6qv
github.com/grafana/loki v1.6.2-0.20231215164305-b51b7d7b5503/go.mod h1:d8seWXCEXkL42mhuIJYcGi6DxfehzoIpLrMQWJojvOo=
github.com/grafana/loki/pkg/push v0.0.0-20231124142027-e52380921608 h1:ZYk42718kSXOiIKdjZKljWLgBpzL5z1yutKABksQCMg=
github.com/grafana/loki/pkg/push v0.0.0-20231124142027-e52380921608/go.mod h1:f3JSoxBTPXX5ec4FxxeC19nTBSxoTz+cBgS3cYLMcr0=
github.com/grafana/pyroscope-go v1.1.2 h1:7vCfdORYQMCxIzI3NlYAs3FcBP760+gWuYWOyiVyYx8=
github.com/grafana/pyroscope-go v1.1.2/go.mod h1:HSSmHo2KRn6FasBA4vK7BMiQqyQq8KSuBKvrhkXxYPU=
github.com/grafana/pyroscope-go/godeltaprof v0.1.8 h1:iwOtYXeeVSAeYefJNaxDytgjKtUuKQbJqgAIjlnicKg=
github.com/grafana/pyroscope-go/godeltaprof v0.1.8/go.mod h1:2+l7K7twW49Ct4wFluZD3tZ6e0SjanjcUUBPVD/UuGU=
github.com/grafana/regexp v0.0.0-20221122212121-6b5c0a4cb7fd h1:PpuIBO5P3e9hpqBD0O/HjhShYuM6XE0i/lbE6J94kww=
github.com/grafana/regexp v0.0.0-20221122212121-6b5c0a4cb7fd/go.mod h1:M5qHK+eWfAv8VR/265dIuEpL3fNfeC21tXXp9itM24A=
github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 h1:+ngKgrYPPJrOjhax5N+uePQ0Fh1Z7PheYoUI/0nzkPA=
Expand Down Expand Up @@ -990,6 +986,10 @@ github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k
github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo=
github.com/prometheus/prometheus v0.47.2-0.20231010075449-4b9c19fe5510 h1:6ksZ7t1hNOzGPPs8DK7SvXQf6UfWzi+W5Z7PCBl8gx4=
github.com/prometheus/prometheus v0.47.2-0.20231010075449-4b9c19fe5510/go.mod h1:UC0TwJiF90m2T3iYPQBKnGu8gv3s55dF/EgpTq8gyvo=
github.com/pyroscope-io/client v0.7.1 h1:yFRhj3vbgjBxehvxQmedmUWJQ4CAfCHhn+itPsuWsHw=
github.com/pyroscope-io/client v0.7.1/go.mod h1:4h21iOU4pUOq0prKyDlvYRL+SCKsBc5wKiEtV+rJGqU=
github.com/pyroscope-io/godeltaprof v0.1.2 h1:MdlEmYELd5w+lvIzmZvXGNMVzW2Qc9jDMuJaPOR75g4=
github.com/pyroscope-io/godeltaprof v0.1.2/go.mod h1:psMITXp90+8pFenXkKIpNhrfmI9saQnPbba27VIaiQE=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis=
github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
Expand Down Expand Up @@ -1047,8 +1047,8 @@ github.com/smartcontractkit/chainlink-testing-framework/grafana v0.0.0-202403282
github.com/smartcontractkit/chainlink-testing-framework/grafana v0.0.0-20240328204215-ac91f55f1449/go.mod h1:DC8sQMyTlI/44UCTL8QWFwb0bYNoXCfjwCv2hMivYZU=
github.com/smartcontractkit/chainlink-testing-framework/seth v1.2.1-0.20240827112945-bd8c580392d6 h1:ItZ75xmt+VHR/lw+GJwSWj9XICpgZ94dJ+I/5jdet7c=
github.com/smartcontractkit/chainlink-testing-framework/seth v1.2.1-0.20240827112945-bd8c580392d6/go.mod h1:afY3QmNgeR/VI1pRbGH8g3YXGy7C2RrFOwUzEFvL3L8=
github.com/smartcontractkit/wasp v0.4.8-0.20240826201742-8c8d2e49efb0 h1:jpcpzNqvmOkpit1zjv7+tAH6Ga1xvpJREkA52kx0crY=
github.com/smartcontractkit/wasp v0.4.8-0.20240826201742-8c8d2e49efb0/go.mod h1:gFD/Jh87jPSuuVTc9tACkZVY0h5SxnX96Tt8fYekdlA=
github.com/smartcontractkit/chainlink-testing-framework/wasp v0.4.9 h1:zyp3Ic0lvseZEKh4/Afcsjk9RAnnxHEI6ajqNXWbRL0=
github.com/smartcontractkit/chainlink-testing-framework/wasp v0.4.9/go.mod h1:OMadmu2D8J0ju4XZ+tiTX3EOz0QBsfrw1zym+ZXuNVk=
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
github.com/soheilhy/cmux v0.1.5 h1:jjzc5WVemNEDTLwv9tlmemhC73tI08BNOIGwBOo10Js=
Expand Down
4 changes: 1 addition & 3 deletions k8s-test-runner/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ module github.com/smartcontractkit/chainlink-testing-framework/k8s-test-runner

go 1.21

replace github.com/gogo/protobuf => github.com/gogo/protobuf v1.3.2

require (
github.com/BurntSushi/toml v1.3.2
github.com/aws/aws-sdk-go-v2 v1.25.2
Expand Down Expand Up @@ -40,7 +38,7 @@ require (
github.com/go-openapi/swag v0.22.4 // indirect
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/gogo/protobuf v1.3.3 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/gofuzz v1.2.0 // indirect
Expand Down
3 changes: 2 additions & 1 deletion logstream/logstream.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ import (
"github.com/avast/retry-go"
"github.com/google/uuid"
"github.com/rs/zerolog"
"github.com/smartcontractkit/wasp"
"github.com/testcontainers/testcontainers-go"
tc "github.com/testcontainers/testcontainers-go"

"github.com/smartcontractkit/chainlink-testing-framework/wasp"

"github.com/smartcontractkit/chainlink-testing-framework/config"
"github.com/smartcontractkit/chainlink-testing-framework/logging"
"github.com/smartcontractkit/chainlink-testing-framework/testsummary"
Expand Down
3 changes: 2 additions & 1 deletion logstream/logstream_handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import (
"time"

"github.com/prometheus/common/model"
"github.com/smartcontractkit/wasp"

"github.com/smartcontractkit/chainlink-testing-framework/wasp"

"github.com/smartcontractkit/chainlink-testing-framework/config"
)
Expand Down
3 changes: 2 additions & 1 deletion seth/examples_wasp/client_wasp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ import (
"testing"
"time"

"github.com/smartcontractkit/wasp"
"github.com/stretchr/testify/require"

"github.com/smartcontractkit/chainlink-testing-framework/wasp"

"github.com/smartcontractkit/chainlink-testing-framework/seth"
)

Expand Down
11 changes: 4 additions & 7 deletions seth/examples_wasp/go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/smartcontractkit/seth-wasp-test
module github.com/smartcontractkit/chainlink-testing-framework/seth-wasp-test

go 1.22.5

Expand All @@ -8,7 +8,7 @@ require (
github.com/ethereum/go-ethereum v1.13.8
github.com/pkg/errors v0.9.1
github.com/smartcontractkit/chainlink-testing-framework/seth v1.2.0
github.com/smartcontractkit/wasp v0.4.7-0.20240328221214-00cd8313cfd4
github.com/smartcontractkit/chainlink-testing-framework/wasp v0.4.9
github.com/stretchr/testify v1.9.0
)

Expand Down Expand Up @@ -81,7 +81,7 @@ require (
github.com/go-resty/resty/v2 v2.14.0 // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/gogo/googleapis v1.4.1 // indirect
github.com/gogo/protobuf v1.3.3 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/gogo/status v1.1.1 // indirect
github.com/golang-jwt/jwt/v4 v4.5.0 // indirect
github.com/golang/protobuf v1.5.3 // indirect
Expand Down Expand Up @@ -222,7 +222,4 @@ require (
sigs.k8s.io/yaml v1.3.0 // indirect
)

replace (
github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1
github.com/smartcontractkit/chainlink-testing-framework/seth => ../
)
replace github.com/smartcontractkit/chainlink-testing-framework/seth => ../
10 changes: 5 additions & 5 deletions seth/examples_wasp/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,9 @@ github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14j
github.com/gogo/googleapis v0.0.0-20180223154316-0cd9801be74a/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s=
github.com/gogo/googleapis v1.4.1 h1:1Yx4Myt7BxzvUr5ldGSbwYiZG6t9wGBZ+8/fX3Wvtq0=
github.com/gogo/googleapis v1.4.1/go.mod h1:2lpHqI5OcWCtVElxXnPt+s8oJvMpySlOyM6xDCrzib4=
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/gogo/status v1.1.1 h1:DuHXlSFHNKqTQ+/ACf5Vs6r4X/dH2EgIzR9Vr+H65kg=
github.com/gogo/status v1.1.1/go.mod h1:jpG3dM5QPcqu19Hg8lkUhBFBa3TcLs1DG7+2Jqci7oU=
github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg=
Expand Down Expand Up @@ -746,8 +749,6 @@ github.com/pyroscope-io/client v0.7.1 h1:yFRhj3vbgjBxehvxQmedmUWJQ4CAfCHhn+itPsu
github.com/pyroscope-io/client v0.7.1/go.mod h1:4h21iOU4pUOq0prKyDlvYRL+SCKsBc5wKiEtV+rJGqU=
github.com/pyroscope-io/godeltaprof v0.1.2 h1:MdlEmYELd5w+lvIzmZvXGNMVzW2Qc9jDMuJaPOR75g4=
github.com/pyroscope-io/godeltaprof v0.1.2/go.mod h1:psMITXp90+8pFenXkKIpNhrfmI9saQnPbba27VIaiQE=
github.com/regen-network/protobuf v1.3.3-alpha.regen.1 h1:OHEc+q5iIAXpqiqFKeLpu5NwTIkVXUs48vFMwzqpqY4=
github.com/regen-network/protobuf v1.3.3-alpha.regen.1/go.mod h1:2DjTFR1HhMQhiWC5sZ4OhQ3+NtdbZ6oBDKQwq5Ou+FI=
github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
Expand Down Expand Up @@ -781,8 +782,8 @@ github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6Mwd
github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88=
github.com/smartcontractkit/chainlink-testing-framework/grafana v0.0.0-20240328204215-ac91f55f1449 h1:fX/xmGm1GBsD1ZZnooNT+eWA0hiTAqFlHzOC5CY4dy8=
github.com/smartcontractkit/chainlink-testing-framework/grafana v0.0.0-20240328204215-ac91f55f1449/go.mod h1:DC8sQMyTlI/44UCTL8QWFwb0bYNoXCfjwCv2hMivYZU=
github.com/smartcontractkit/wasp v0.4.7-0.20240328221214-00cd8313cfd4 h1:JO2hGwIa5dBrd/ffj047/Iqms73JMH7ht3cgMkt1PZk=
github.com/smartcontractkit/wasp v0.4.7-0.20240328221214-00cd8313cfd4/go.mod h1:jeabvyXikb2aNoLQwcZGqaz17efrR8NJhpq4seAmdgs=
github.com/smartcontractkit/chainlink-testing-framework/wasp v0.4.9 h1:zyp3Ic0lvseZEKh4/Afcsjk9RAnnxHEI6ajqNXWbRL0=
github.com/smartcontractkit/chainlink-testing-framework/wasp v0.4.9/go.mod h1:OMadmu2D8J0ju4XZ+tiTX3EOz0QBsfrw1zym+ZXuNVk=
github.com/soheilhy/cmux v0.1.5 h1:jjzc5WVemNEDTLwv9tlmemhC73tI08BNOIGwBOo10Js=
github.com/soheilhy/cmux v0.1.5/go.mod h1:T7TcVDs9LWfQgPlPsdngu6I6QIoyIFZDDC6sNE1GqG0=
github.com/sony/gobreaker v0.5.0 h1:dRCvqm0P490vZPmy7ppEk2qCnCieBooFJ+YoXGYB+yg=
Expand Down Expand Up @@ -1238,7 +1239,6 @@ google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfG
google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200324203455-a04cca1dde73/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
Expand Down
2 changes: 1 addition & 1 deletion wasp/examples/alerts/gun.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package main

import (
"github.com/go-resty/resty/v2"
"github.com/smartcontractkit/wasp"
"github.com/smartcontractkit/chainlink-testing-framework/wasp"
)

type ExampleGun struct {
Expand Down
21 changes: 11 additions & 10 deletions wasp/examples/alerts/main_test.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
package main

import (
"github.com/smartcontractkit/chainlink-testing-framework/wasp"
"github.com/smartcontractkit/chainlink-testing-framework/wasp/dashboard"
"os"
"testing"
"time"

"github.com/K-Phoen/grabana/alert"
"github.com/K-Phoen/grabana/timeseries"
"github.com/smartcontractkit/wasp"
"github.com/stretchr/testify/require"
)

Expand Down Expand Up @@ -41,35 +42,35 @@ func TestMain(m *testing.M) {
// - stress - another custom NFRs for stress
// WaspAlert can be defined on per Generator level
// usually, you define it once per project, generate your dashboard and upload it, it's here only for example purposes
d, err := wasp.NewDashboard([]wasp.WaspAlert{
d, err := dashboard.NewDashboard([]dashboard.WaspAlert{
// baseline group alerts
{
Name: "99th latency percentile is out of SLO for first API",
AlertType: wasp.AlertTypeQuantile99,
AlertType: dashboard.AlertTypeQuantile99,
TestName: "TestBaselineRequirements",
GenName: FirstGenName,
RequirementGroupName: BaselineRequirementGroupName,
AlertIf: alert.IsAbove(50),
},
{
Name: "first API has errors",
AlertType: wasp.AlertTypeErrors,
AlertType: dashboard.AlertTypeErrors,
TestName: "TestBaselineRequirements",
GenName: FirstGenName,
RequirementGroupName: BaselineRequirementGroupName,
AlertIf: alert.IsAbove(0),
},
{
Name: "99th latency percentile is out of SLO for second API",
AlertType: wasp.AlertTypeQuantile99,
AlertType: dashboard.AlertTypeQuantile99,
TestName: "TestBaselineRequirements",
GenName: FirstGenName,
RequirementGroupName: BaselineRequirementGroupName,
AlertIf: alert.IsAbove(50),
},
{
Name: "second API has errors",
AlertType: wasp.AlertTypeErrors,
AlertType: dashboard.AlertTypeErrors,
TestName: "TestBaselineRequirements",
GenName: FirstGenName,
RequirementGroupName: BaselineRequirementGroupName,
Expand All @@ -78,7 +79,7 @@ func TestMain(m *testing.M) {
// stress group alerts
{
Name: "first API has errors > threshold",
AlertType: wasp.AlertTypeErrors,
AlertType: dashboard.AlertTypeErrors,
TestName: "TestStressRequirements",
GenName: FirstGenName,
RequirementGroupName: StressRequirementGroupName,
Expand All @@ -96,7 +97,7 @@ func TestMain(m *testing.M) {
alert.Tags(map[string]string{
"service": "wasp",
// set group label so it can be filtered
wasp.DefaultRequirementLabelKey: StressRequirementGroupName,
dashboard.DefaultRequirementLabelKey: StressRequirementGroupName,
}),
alert.WithLokiQuery(
"MyCustomAlert",
Expand Down Expand Up @@ -159,7 +160,7 @@ func TestBaselineRequirements(t *testing.T) {
// we are checking all active alerts for dashboard with UUID = "wasp" which have label "requirement_name" = "baseline"
// if any alerts of particular group, for example "baseline" were raised - we fail the test
// change some data in NewHTTPMockServer to make alerts disappear
_, err = wasp.NewAlertChecker(t).AnyAlerts(wasp.DefaultDashboardUUID, BaselineRequirementGroupName)
_, err = wasp.NewAlertChecker(t).AnyAlerts(dashboard.DefaultDashboardUUID, BaselineRequirementGroupName)
require.NoError(t, err)
}

Expand Down Expand Up @@ -190,6 +191,6 @@ func TestStressRequirements(t *testing.T) {
// we are checking all active alerts for dashboard with UUID = "wasp" which have label "requirement_name" = "stress"
// if any alerts of particular group, for example "stress" were raised - we fail the test
// change some data in NewHTTPMockServer to make alerts disappear
_, err = wasp.NewAlertChecker(t).AnyAlerts(wasp.DefaultDashboardUUID, StressRequirementGroupName)
_, err = wasp.NewAlertChecker(t).AnyAlerts(dashboard.DefaultDashboardUUID, StressRequirementGroupName)
require.NoError(t, err)
}
Loading

0 comments on commit 9ea5d6a

Please sign in to comment.