git clone https://github.com/crypto-org-chain/cronos.git
Install nix
https://nixos.org/download.html
Multi-user installation:
sh <(curl -L https://nixos.org/nix/install) --daemon
Make sure the following line has been added to your shell profile (e.g. ~/.profile
):
source ~/.nix-profile/etc/profile.d/nix.sh
Then re-login shell, the nix installation is completed.
Install cachix
nix-env -iA cachix -f https://cachix.org/api/v1/install
Binary caches will save a lot of build times.
cachix use cronos
cachix use dapp # it's necessary to use dapp's binary cache on new macos system.
make run-integration-tests
To customize the test runner, you can also issue commands separately.
It'll prepare all dependencies.
$ nix-shell integration_tests/shell.nix
<nix-shell> $
$ cd integration_tests/contracts
$ HUSKY_SKIP_INSTALL=1 npm install
$ npm run typechain
$ cd ../../
We use pytest
to discover the test cases and run them, follow pytest doc for more options.
You can invoke pytest
after entering the nix shell:
$ cd integration_tests
$ pytest -s -vv
You can use -k
to select test cases by patterns in name:
$ cd integration_tests
$ pytest -k test_basic
Some test cases will run on both geth
and cronos
, you can also select the platform to run using -k
:
$ cd integration_tests
$ # run against cronos only
$ pytest -k cronos
$ # run against geth only
$ pytest -k geth
$ jsonnet integration_tests/configs/default.jsonnet | yq -P