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

Extend testing configuration to run integration tests on the CI server #150

Closed
rrtoledo opened this issue Jan 24, 2020 · 7 comments
Closed
Labels
ci Task related to the Continuous Integration (configuration, service etc.) function:devops Tasks for the DevOps function python Task related to the Python part of the code base solidity Task related to the Solidity part of the code base test Task related to the testing of the project

Comments

@rrtoledo
Copy link
Contributor

This issue is specific to tests on the python client and contracts, located in pyClient/test.

So far, the "make" commands do not execute most of the tests [1], and it is unclear whether they need to be updated as the code evolved considerably for the past month. It is worth doing a review of the code and list new potential tests (needed, desirable...).

This issue is about updating, and creating contract and client tests as well as facilitating their use. Ideally, Travis would run them after each push.

I propose to have, for instance, make commands such as:

  • make test_contracts, to test all contracts
  • make test_client, to test (at least the essentials functionalities of) the client
  • make test_all, to run all tests (unit, contract, client tests). It is worth considering merging this command with make check to also test syntax.

[1] I have created a command in the packing branch to test a couple of contracts but they need truffle to be running.

@rrtoledo rrtoledo added help wanted Help is needed test Task related to the testing of the project todo security Flag a security issue in the project labels Jan 24, 2020
@rrtoledo
Copy link
Contributor Author

  • Is it possible to run ganache on travis? How should we do that (process wrappers, tmux, docker compose ...)?
  • Testing contracts
    • create zeth-contracts/tests for test contracts
    • move python code to zeth-contracts dir?
    • reuse pyClient by importing relevant modules
    • limit the use of Web3 and try to use low level functions (as the library is not very stable)
  • look into reusing the keys and proofs from prover_server for further tests
  • look at packages for standard testing (ganache test was used before, look at pytest and so on)

@AntoineRondelet AntoineRondelet added solidity Task related to the Solidity part of the code base python Task related to the Python part of the code base labels May 6, 2020
@AntoineRondelet
Copy link
Contributor

Over the past few months, the CI and testing scripts have been refactored quite a bit.

Furthermore, #313 has just been closed (as well as #258), meaning that we now have a working pipeline for consistently publishing new docker images to the Hub.
This, coupled with the various testing scripts (https://github.com/clearmatics/zeth/tree/master/scripts), paves the way for what comes next: using docker-compose-type tools to run the full integration tests on the CI server.
The goal here will be to write a docker-compose.yml file to spin up:

  1. a prover_server (image: clearmatics/zeth-prover),
  2. a client (image clearmatics/zeth-client), and
  3. a ganache instance (preferably the image built from our fork - that contains custom pre-compiled contracts for arithmetic over BLS12: Fix docker configuration ganache-cli#1)

to run the integration tests on the CI (wallet > prover_server > blockchain/ganache/contracts).

Likewise, a similar configuration will be used to run the mpc integration tests (e.g. 1 coordinator service and 2 contributor services generating an SRS for the simple_gadget).

@AntoineRondelet AntoineRondelet changed the title Increase and Facilitate tests Extend testing configuration to run integration tests on the CI server Nov 23, 2020
@AntoineRondelet
Copy link
Contributor

cc @eastata

@eastata eastata added the function:devops Tasks for the DevOps function label Nov 24, 2020
@AntoineRondelet AntoineRondelet added ci Task related to the Continuous Integration (configuration, service etc.) and removed help wanted Help is needed security Flag a security issue in the project labels Nov 24, 2020
@dtebbs
Copy link
Contributor

dtebbs commented Dec 3, 2020

This could be worth investigating this for slow dependencies on the ci:
https://docs.github.com/en/free-pro-team@latest/actions/guides/caching-dependencies-to-speed-up-workflows

Looks pretty flexible and should be uniform over mac and linux.

@AntoineRondelet
Copy link
Contributor

3\. a ganache instance (preferably the image built from our fork - that contains custom pre-compiled contracts for arithmetic over BLS12: [clearmatics/ganache-cli#1](https://github.com/clearmatics/ganache-cli/pull/1))

The PR linked here (i.e. clearmatics/ganache-cli#1) has finally been fixed and merged. As such, it is now possible to launch our custom ganache-cli instance in a docker container, paving the way for integration tests (in linux) via docker-compose.

@AntoineRondelet
Copy link
Contributor

This ticket is addressed in #326

@AntoineRondelet
Copy link
Contributor

Closing this ticket now that #326 is merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci Task related to the Continuous Integration (configuration, service etc.) function:devops Tasks for the DevOps function python Task related to the Python part of the code base solidity Task related to the Solidity part of the code base test Task related to the testing of the project
Projects
None yet
Development

No branches or pull requests

4 participants