GithubHelp home page GithubHelp logo

paritytech / ink-waterfall Goto Github PK

View Code? Open in Web Editor NEW
15.0 15.0 5.0 833 KB

End-to-end tests for ink! ➜ cargo-contract ➜ canvas-ui || polkadot-js ➜ substrate-contracts-node.

License: Apache License 2.0

Shell 2.92% Rust 97.08%

ink-waterfall's People

Contributors

agryaznov avatar alvicsam avatar andwehaveaplan avatar ascjones avatar athei avatar cmichi avatar hcastano avatar nuke-web3 avatar sergejparity avatar xgreenx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ink-waterfall's Issues

Make e2e tests more sustainable

Currently ink-waterfall tests have the following drawbacks (regarding the CI job running them):

1. A test could be easily broken by some change on the UI side, which is out of our control, while it would still block all ink! PRs because of non-green CI.

Currently e2e tests are simply being run versus currently deployed version of polkadot-js. The good effect of this is that it lets us catch any issue which ink! (and pallet_contract) users face while interacting with them on https://polkadot.js.org/apps, which is by now the most likely usage case. However, once these tests run on the CI, this some(not so rare)times leads to a PR stuck for ink!, which, again, could be caused by a bug\change on a UI side. So basically we are maintaining tests for the UI part, at the costs of longer PR delivery for our products.

Possible actions to solve this could be:

  • Make UI projects run contracts e2e tests (on ink! examples) as part of CI\CD process of their deployment.
    Solely depends on @jacogr for polkadot-js, and on @statictype for contracts-ui.
  • As part of the CI job run on a ink! PR, run ink-waterfall tests versus a concrete UI version, specially deployed for that particular run as part of that CI pipeline.
  • Make ink-waterfall use cargo-contract for interactions with contracts. We could make this option to be used in ink! PR CI jobs.

2. Quite unsustainable test results like this one are noticed, which generally dissapear after one or a couple of restarts.

thread 'tests::erc721::erc721_operator_approvals' panicked at 'upload must have succeeded, but events contain only []', src/uis/polkadot_js.rs:470:9

or

 thread 'tests::erc1155::erc1155_approvals' panicked at 'upload must have succeeded, but events contain only []', src/uis/polkadot_js.rs:470:9=

These ones could suddenly happen on different examples on different runs, and just a restart is an only so far known way to treat this. I think we should look into it and make it more sustainable.

Support running the tests on Mac

We are using the psutil crate to assert that a canvas node process is runnning. This happens here.

On Mac this is not supported though, resulting in a panic:

---- tests::multisig_plain::multisig_works_with_payable_transaction stdout ----
thread 'main' panicked at 'not yet implemented', ~/.cargo/registry/src/github.com-1ecc6299db9ec823/psutil-3.2.1/src/process/sys/macos/process.rs:103:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

We should investigate using either a different crate or a different function from the psutils crate. I would try the latter first, there are a number of functions supported for Mac, just not the one we're using atm.

Support for Arbitrary Contracts

From the README it looks like ink-waterfall only tests the example contracts in the ink! repo. It would be nice to have ink-waterfall run on any ink! smart contracts so that third-party developers could have a way to automatically perform end-to-end tests. I think this is especially important given some of the complexities in testing certain scenarios (e.g cross contract) in the off-chain environment.

Detect contract size regressions

For each CI run we already build each ink! example contract. We should utilize this information to provide insights on how the contract file sizes would change for a particular PR.

ToDo

  • Persist the Wasm size of each compiled contract from master in the artifacts.
  • After each example contract build on a PR compare this size to the size from the artifacts and output the difference. This output should be human-readable, in tabular format.
  • If the contract size got bigger post a comment to the parent PR with the size diffs for all contracts. We don't want to make CI fail if contracts get bigger, since there might be features where the trade-off makes sense. So for now it's just for informational purposes.

Fix polkadot.js interaction

Currently the polkadot.js UI interaction does not work, the main issue is OutOfGas from calling contracts.

This is likely because the polkadot.js UI frontend does not currently support WeightsV2. See polkadot-js/apps#8364.

The fix would be to adapt the apps frontend to allow using the proofSize returned from the call dry run, and optionally allowing the user to specify the proof size in the UI.

CI fails on `master` on redis lookup

Our master CI currently fails due to:

…
$ echo "$REDIS_SIZES_KEY will be compared to $REDIS_SIZES_KEY_MASTER"
ink-waterfall::ink::bug/doesnt-revert-on-error::sizes will be compared to ink-waterfall::ink::master::sizes
$ redis-cli -u $GITLAB_REDIS_URI --raw lrange $REDIS_SIZES_KEY 0 -1 | tee $REDIS_SIZES_KEY.csv
tee: 'ink-waterfall::ink::bug/doesnt-revert-on-error::sizes.csv': No such file or directory
contract-terminate, 19.86, 1.532
…

Full error log: https://gitlab.parity.io/parity/ink-waterfall/-/jobs/1191960.

cc @HCastano

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.