-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Remove testutil/network package #12527
Comments
After some consideration, the full network end-to-end tests in In #12546 I'm planning to move all deps on Mocking the network layer like this issue describes would introduce a very useful tier of tests just below end-to-end network tests, but I'm not sure it will solve the "ball of mud problem" where module tests spin up an entire app to test their specific functionality. The ones I have reviewed are often relying on module interactions above the network layer and break when the wiring logic in |
Also, there's a CLI command I know some app developers just copy/paste |
There are no tests in
What tests are "they" in this context?
This is orthogonal to the usage and removal of
That's OK for the super short term, but the proposal here to completely remove
I think there is some confusion. We don't really have E2E tests, what That being said, we do have a liveness tests, which you would consider E2E, but this uses a more sophisticated Docker approach, which is correct IMO. |
I am speaking to the extensive usage of My original sentence should read: After some consideration, the full network end-to-end tests relying on
The adoption of
Not really so for removal. Since |
That's exactly my point, they should have never used
Where are these tests? Please point me to them. I know of no such E2E tests in the SDK.
This is not an E2E tests and also should not be using |
We seem to have a disagreement on terms. The working definition for E2E test I'm using is as I've layed out in the example above, and as used in #12398. What do you consider an E2E test, can you point me to an example? If the example I've linked above (here again) is not an E2E test, how should we identify it? I might suggest network-backed integration test. |
I call those integration tests :) and they don't need |
Right, they need Once module interactions are better understood, I think we'll be in a good position to address network mocking. |
This framing feels odd to me. The goal should have no Tendermint OR message routing. The CLI has three (or four) roles:
The issue is these are all bundled into one method in code and tests right now, so we have this very convoluted test. Tx broadcast is being suggested to be removed, by mocking tendermint. But I claim that tx execution should also be removed / all simulation of a network. I want my average CLI test to be some type of table driven test, where I supply CLI command args + some blockchain state setup. (Block height, etc.). Then I get out of the CLI, a constructed message (maybe tx depending on API), and then I can test that the message generated satisfies properties I want. (Could also just run validate basic for good measure if wanted) But I don't think tx execution should be here for CLI tests either. (Goal is to get YML specification of CLI, and then were just unit testing integration against state) |
This 100% |
closing this as the path for testutil has changed a little. Ill open a new issue |
We use the
testutil/network
to run an in-process single Tendermint node. We use this primarily for CLI integration tests and handful of gRPC tests.Using this approach/package has proven to be troublesome because of the requirement to run tests with the race detector on due to Tendermint needing to be single-threaded (it has many globals as state, especially within the RPC layer).
Many times these race-enabled tests fail, requiring tests to be reran multiple times, which causes developers to waste time having to rerun CI.
A cleaner approach would be to just "mock" Tendermint indirectly. Meaning, we wrap
BaseApp
as a fixture/wrapper that allows us access to the message router and context. This allows us to execute txs/messages,EndBlock
, orBeginBlock
, giving us roughly the same functionality that we require now.As a reference, see what Regen has:
Note, we don't need to copy the approach verbatim, but we can use it as guidance for the fixture and tests.
Acceptance Criteria:
testutil/network
are migrated to use fixturetestutil/network
The text was updated successfully, but these errors were encountered: