-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
Proposal to add E2E and Integration testing on 1.x branch #3098
Comments
Can't completely judge any measure from this proposal but I think that such strong and practical integrational testing might really be a game changer for the future stability of the library, my general feeling for the situation of the web3 library is still limited though. @cgewecke do you have got a rough estimate about the scope of work a stripped-down barebone version of this would eventually take? |
@holgerd77 I'm not sure. Days? It's kind of hard to tell. Some things like test suites might take a bit longer to develop a good set of cases. |
@cgewecke Ok, thanks! |
@cgewecke I think we should now first focus on adding all e2e test cases. We can after extend the e2e tests with the virtual registry and the headless browser tests. Do you agree with that? |
@nivida Yes, that makes sense to me! Will work in that direction. |
This is mostly done.. |
(This proposal is continuation of #2682, a companion to #3070, and a tracking issue for all integration testing related topics for the 1.x branch)
E2E
Web3 1.x's stability might benefit from following ethereum/solidity's example and E2E testing its latest state against large projects that already use the package. Solidity does this nightly in CI - they build a new solc, swap it into Zeppelin, Gnosis and Colony and run those projects' own tests using the new version.
Some targets that seem promising for this purpose here are:
Technical
Web3 is a Lerna monorepo and so are two of the potential targets listed above. Because its repo structure and published formats are quite different it won't just
npm install
from a github url.However, there's a nice tool called verdaccio that lets you set up a local private npm registry in CI. Web3 could "publish" a candidate branch to this ephemeral registry, clone an E2E target (ex: embark) and install the new web3 via npm proxy. Then run the target's tests.
It's also possible to chain publications together. For example, openzeppelin-solidity uses truffle so you could:
Additionally:
Integration
Clients
To recap #2682 - Web3 1.x's unit tests rely primarily on mocked server responses. They're super fast but some things are hard to validate without testing against a node. There's also variance in behavior between the three most widely used clients. It would be good to create a small suite of tests for stuff like:
..and make sure everything executes as expected across this matrix:
Client Helpers
To simplify things in CI and make this work portable, Web3 could also publish small Node cli wrappers for the dockerized Parity and Geth dev clients.
These would:
Something that launches like this:
See also: #2688 and #2693: I think access to these clients can be provided in a flexible way with JS wrappers alone - e.g without building any containers or using docker compose.
Network Emulators
Installation
The EF has an account with CircleCI. (EthereumJS uses it). They let you specify which OS a job is run with pretty easily.
cf: #3034 (Azure Pipelines)
Other stuff 🐘
There is definitely other stuff to test. Would be grateful for any and all community suggestions about this topic.
The text was updated successfully, but these errors were encountered: