Skip to content
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

Closed
4 of 9 tasks
cgewecke opened this issue Oct 4, 2019 · 6 comments
Closed
4 of 9 tasks

Proposal to add E2E and Integration testing on 1.x branch #3098

cgewecke opened this issue Oct 4, 2019 · 6 comments
Labels
1.x 1.0 related issues Discussion Enhancement Includes improvements or optimizations

Comments

@cgewecke
Copy link
Collaborator

cgewecke commented Oct 4, 2019

(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:

  • publish a new Web3,
  • install it in Truffle,
  • publish a new Truffle,
  • swap the new Truffle into Zeppelin and run Zeppelin's tests.

Additionally:

  • could be used to verify that built assets are located correctly and usable.
  • ethereum-js may migrate some things to monorepo in future. Any solution developed here might pay dividends there as well.

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:

  • simple send and call
  • events
  • subscriptions
  • errors
  • transaction signing

..and make sure everything executes as expected across this matrix:

Client instamine automine 2s
geth --dev x x
parity --dev x x
ganache-cli x

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:

  • pull down any client version from docker hub
  • abstract away most of command config flags,
  • open all APIs,
  • have many well-funded accounts
  • make it easy for people to generate reproduction cases for client specific problems.

Something that launches like this:

$ web3-geth-dev --period 2 --tag latest

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.

  • Parity dev Node cli wrapper
  • Geth dev Node cli wrapper

Network Emulators

  • Dropped connections are frequently mentioned in the issues. Emulate with comcast?

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.

@cgewecke cgewecke added the 1.x 1.0 related issues label Oct 4, 2019
@nivida nivida added Discussion Enhancement Includes improvements or optimizations labels Oct 8, 2019
@holgerd77
Copy link
Collaborator

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?

@cgewecke
Copy link
Collaborator Author

cgewecke commented Oct 8, 2019

@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.

@holgerd77
Copy link
Collaborator

@cgewecke Ok, thanks!

@nivida
Copy link
Contributor

nivida commented Oct 16, 2019

@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?

@cgewecke
Copy link
Collaborator Author

@nivida Yes, that makes sense to me! Will work in that direction.

@cgewecke
Copy link
Collaborator Author

This is mostly done..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.x 1.0 related issues Discussion Enhancement Includes improvements or optimizations
Projects
None yet
Development

No branches or pull requests

3 participants