Conversation
| // | ||
| // logQuery is the same log query that is used in the Grafana UI, e.g. | ||
| // `{container="don-node1"} | json | logger="SomeLoggerName" | msg="SomeMessage"`. | ||
| func WaitForLokiLogs(ctx context.Context, lokiWSURL, logQuery string) (string, error) { |
There was a problem hiding this comment.
This is basically a stripped down Loki log streamer compared to the logasserter package in chainlink-ccv. Eventually I think we should have a common library but this'll do for now.
There was a problem hiding this comment.
I like this. In the past the options for assertions were really limited.
| golang.org/x/sync v0.20.0 | ||
| ) | ||
|
|
||
| require github.com/gorilla/websocket v1.5.3 |
There was a problem hiding this comment.
Used for loki log streaming
| // lokiPingQuery is a minimal valid LogQL selector for /tail. Loki rejects an empty `{}` | ||
| // selector (HTTP 400 before the WebSocket upgrade, seen as "bad handshake"). | ||
| // Devenv pushes CCIP streams with a `job` label (see chainimpl monitoring). | ||
| const lokiPingQuery = `{job=~".+"}` |
There was a problem hiding this comment.
AFAIK we're moving away from loki, so this test has an expiration date
There was a problem hiding this comment.
Really? Even for development?
| // | ||
| // logQuery is the same log query that is used in the Grafana UI, e.g. | ||
| // `{container="don-node1"} | json | logger="SomeLoggerName" | msg="SomeMessage"`. | ||
| func WaitForLokiLogs(ctx context.Context, lokiWSURL, logQuery string) (string, error) { |
There was a problem hiding this comment.
I like this. In the past the options for assertions were really limited.
| // Ping the loki URL to ensure its available, else skip the test. | ||
| err := PingLoki(t.Context(), DefaultLokiURL) | ||
| if err != nil { | ||
| t.Skipf("failed to ping Loki WebSocket URL, is loki running?: %v", err) |
There was a problem hiding this comment.
How robust are these checks? Could we get into a situation where they're accidentally skipped and nobody knows about it?
There was a problem hiding this comment.
The ping part specifically? It seems to "work" based on the local testing I did (the ping fails if the loki API server is not up) but it may be different for real Loki deployments
| curseAdapter, ok := fastcurse.GetCurseRegistry().GetCurseAdapter(destFamily, semver.MustParse("1.6.0")) | ||
| if !ok { | ||
| t.Skipf("no curse adapter registered for chain family: %s and version: %s", destFamily, semver.MustParse("1.6.0")) | ||
| } | ||
| require.NotNil(t, curseAdapter, "registered curse adapter is nil") |
There was a problem hiding this comment.
No new interface needed, using the deployment API directly here.
| output, err := curseCS.Apply(*e, fastcurse.RMNCurseConfig{ | ||
| CurseActions: []fastcurse.CurseActionInput{ | ||
| { | ||
| ChainSelector: toImpl.ChainSelector(), | ||
| SubjectChainSelector: fromImpl.ChainSelector(), | ||
| Version: semver.MustParse("1.6.0"), | ||
| IsGlobalCurse: false, | ||
| }, | ||
| }, | ||
| }) | ||
| require.NoError(t, err) | ||
| require.Greater(t, len(output.Reports), 0) |
There was a problem hiding this comment.
Applying the changeset to curse.
|
Add a test that curses a source chain on the destination and asserts that the commit plugin doesn't commit those messages.