-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Testing, Tooling] Expose integration app via gRPC/HTTP/WS #1017
base: main
Are you sure you want to change the base?
Conversation
resp := rpctypes.RPCResponse{ | ||
JSONRPC: "2.0", | ||
ID: req.ID, | ||
// TODO_IN_THIS_COMMIT: generate a mock result... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[linter-name (fail-on-found)] reported by reviewdog 🐶
// TODO_IN_THIS_COMMIT: generate a mock result...
} | ||
} | ||
|
||
// TODO_IN_THIS_COMMIT: also wrap RunMsgs... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[linter-name (fail-on-found)] reported by reviewdog 🐶
// TODO_IN_THIS_COMMIT: also wrap RunMsgs...
} | ||
|
||
// TODO_IN_THIS_COMMIT: also wrap RunMsgs... | ||
// TODO_IN_THIS_COMMIT: godoc... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[linter-name (fail-on-found)] reported by reviewdog 🐶
// TODO_IN_THIS_COMMIT: godoc...
return NewFlagSet(t, CometLocalTCPURL) | ||
} | ||
|
||
// TODO_IN_THIS_COMMIT: godoc... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[linter-name (fail-on-found)] reported by reviewdog 🐶
// TODO_IN_THIS_COMMIT: godoc...
func NewE2ETxContext( | ||
t *testing.T, | ||
keyring cosmoskeyring.Keyring, | ||
flagSet *pflag.FlagSet, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[linter-name (fail-on-found)] reported by reviewdog 🐶
// TODO_IN_THIS_COMMIT: godoc...
|
||
func TestNewE2EApp(t *testing.T) { | ||
initialHeight := int64(7553) | ||
// TODO_IN_THIS_COMMIT: does this 👆 need to be reconciled with the internal height of app? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[linter-name (fail-on-found)] reported by reviewdog 🐶
// TODO_IN_THIS_COMMIT: does this 👆 need to be reconciled with the internal height of app?
gateway2Addr, err := rec.GetAddress() | ||
require.NoError(t, err) | ||
|
||
// TODO_IN_THIS_COMMOT: fund gateway2 account. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[linter-name (fail-on-found)] reported by reviewdog 🐶
// TODO_IN_THIS_COMMOT: fund gateway2 account.
blockClient, err := block.NewBlockClient(app.GetSdkCtx(), deps) | ||
require.NoError(t, err) | ||
|
||
// TODO_IN_THIS_COMMIT: NOT localnet flagset NOR context, should be |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[linter-name (fail-on-found)] reported by reviewdog 🐶
// TODO_IN_THIS_COMMIT: NOT localnet flagset NOR context, should be
), | ||
) | ||
|
||
// TODO_IN_THIS_COMMIT: signal to the WS server to send another block result event... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[linter-name (fail-on-found)] reported by reviewdog 🐶
// TODO_IN_THIS_COMMIT: signal to the WS server to send another block result event...
go app.handleWebSocketConnection(conn) | ||
} | ||
|
||
// TODO_IN_THIS_COMMIT: move |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[linter-name (fail-on-found)] reported by reviewdog 🐶
// TODO_IN_THIS_COMMIT: move
response := rpctypes.RPCResponse{ | ||
JSONRPC: "2.0", | ||
ID: nil, // Events don't have an ID | ||
// TODO_IN_THIS_COMMIT: make this dynamic! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[linter-name (fail-on-found)] reported by reviewdog 🐶
// TODO_IN_THIS_COMMIT: make this dynamic!
@@ -963,6 +966,11 @@ func (app *App) setupDefaultActorsState( | |||
app.NextBlock(t) | |||
} | |||
|
|||
// TODO_IN_THIS_COMMIT: godoc... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[linter-name (fail-on-found)] reported by reviewdog 🐶
// TODO_IN_THIS_COMMIT: godoc...
testutil/e2e/comet.go
Outdated
// if req.Method != "abci_query" { | ||
// fmt.Printf(">>>> WRONG METHOD") | ||
// | ||
// // TODO_IN_THIS_COMMIT: consolidate with other error response logic... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[linter-name (fail-on-found)] reported by reviewdog 🐶
// // TODO_IN_THIS_COMMIT: consolidate with other error response logic...
@@ -563,32 +563,43 @@ func NewCompleteIntegrationApp(t *testing.T, opts ...IntegrationAppOptionFn) *Ap | |||
opts..., | |||
) | |||
|
|||
configurator := module.NewConfigurator(cdc, msgRouter, queryHelper) | |||
//// TODO_IN_THIS_COMMIT: clean up... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[linter-name (fail-on-found)] reported by reviewdog 🐶
//// TODO_IN_THIS_COMMIT: clean up...
@@ -70,3 +73,10 @@ func WithTokenLogicModules(tokenLogicModules []tlm.TokenLogicModule) Integration | |||
config.TokenLogicModules = tokenLogicModules | |||
} | |||
} | |||
|
|||
// TODO_IN_THIS_COMMIT: godoc... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[linter-name (fail-on-found)] reported by reviewdog 🐶
// TODO_IN_THIS_COMMIT: godoc...
"github.com/grpc-ecosystem/grpc-gateway/runtime" | ||
) | ||
|
||
// TODO_IN_THIS_COMMIT: godoc... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[linter-name (fail-on-found)] reported by reviewdog 🐶
// TODO_IN_THIS_COMMIT: godoc...
// TODO_IN_THIS_COMMIT: godoc... | ||
type CometBFTMethod string | ||
|
||
// TODO_IN_THIS_COMMIT: godoc... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[linter-name (fail-on-found)] reported by reviewdog 🐶
// TODO_IN_THIS_COMMIT: godoc...
|
||
var response rpctypes.RPCResponse | ||
switch CometBFTMethod(req.Method) { | ||
// TODO_IN_THIS_COMMIT: extract... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[linter-name (fail-on-found)] reported by reviewdog 🐶
// TODO_IN_THIS_COMMIT: extract...
} | ||
} | ||
|
||
// TODO_IN_THIS_COMMIT: godoc... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[linter-name (fail-on-found)] reported by reviewdog 🐶
// TODO_IN_THIS_COMMIT: godoc...
writeErrorResponse(w, req, errMsg, "") | ||
} | ||
|
||
// TODO_IN_THIS_COMMIT: godoc... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[linter-name (fail-on-found)] reported by reviewdog 🐶
// TODO_IN_THIS_COMMIT: godoc...
func writeErrorResponse(w http.ResponseWriter, req rpctypes.RPCRequest, msg, data string) { | ||
errRes := rpctypes.NewRPCErrorResponse(req.ID, 500, msg, data) | ||
if err := json.NewEncoder(w).Encode(errRes); err != nil { | ||
// TODO_IN_THIS_COMMIT: log error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[linter-name (fail-on-found)] reported by reviewdog 🐶
// TODO_IN_THIS_COMMIT: log error
return txMsgResps, nil | ||
} | ||
|
||
// TODO_IN_THIS_COMMIT: godoc... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[linter-name (fail-on-found)] reported by reviewdog 🐶
// TODO_IN_THIS_COMMIT: godoc...
Summary
This branch is currently a spike towards a PoC of wrapping an
integration.App
in gRPC/HTTP/WS servers such that (off-chain) clients can be used in app integration level tests.Issue
These testutils are necessary in order to cover client usage at this testing level, which is preferred over higher levels for most kinds of tests.
The client caching work (#543) will depend on this for coverage over its usage of
EventsReplayClient
, once event-drive cache warming is implemented (eminent - #994). Otherwise, this coverage can only be expressed at the in-memory network or E2E levels, which we SHOULD NOT do.Type of change
Select one or more from the following:
consensus-breaking
label if so. See [Infra] Automatically add theconsensus-breaking
label #791 for detailsTesting
make docusaurus_start
; only needed if you make doc changesmake go_develop_and_test
make test_e2e
devnet-test-e2e
label to the PR.Sanity Checklist