Add instructions how to prepare/run e2e tests (#577)

This commit is contained in:
Dmitry Shulyak 2018-01-29 12:14:55 +02:00 committed by Ivan Daniluk
parent ba0b20e53f
commit ba0433367c
2 changed files with 55 additions and 4 deletions

View File

@ -36,6 +36,7 @@ Make sure the dependencies are installed first by running:
make lint-install
make mock-install
```
To test fully statusgo, use:
```
make ci
@ -51,6 +52,8 @@ To test statusgo using a given network by number ID, use:
make ci networkid=3
```
If you have problems running tests on public network we suggest reading [e2e guide](e2e/README.md).
If you want to launch specific test, for instance `RPCSendTransactions`, use the following command:
```
go test -v ./geth/api/ -testify.m ^RPCSendTransaction$

View File

@ -15,19 +15,67 @@ for running all test. It by default uses the `StatusChain` network.
#### Usage
First of all you need to export an ACCOUNT_PASSWORD environment variable. It should be a passphrase
that was used to generate accounts used in tests. If you don't know this variable for default accounts
you will have to create your own accounts and request some funds from rinkeby or ropsten faucet.
Please see Preparation section for details.
To use the `ropsten` network for testing using network name:
```bash
go test -v ./e2e/... -network=ropsten
ACCOUNT_PASSWORD=test go test -v ./e2e/... -p= 1 -network=ropsten
```
To use the `rinkeby` network with chain id `4` for testing:
```bash
go test -v ./e2e/... -network=4
ACCOUNT_PASSWORD=test go test -v ./e2e/... -p=1 -network=4
```
#### Preparation
## Run
You will need `geth` in your PATH. Please visit: https://www.ethereum.org/cli.
Once installed - generate 2 accounts and remember the passphrase for them, so run this command twice:
`make test-e2e`
```bash
geth account new --keystore=static/keys/
Your new account is locked with a password. Please give a password. Do not forget this password.
Passphrase:
Repeat passphrase:
Address: {b6120ddd881593537c2bd4280bae509ec94b1a6b}
```
We expect that accounts will be named in a certain way:
```bash
pushd static/keys/
mv UTC--2018-01-26T13-46-53.657752811Z--b6120ddd881593537c2bd4280bae509ec94b1a6b test-account1.pk
mv UTC--2018-01-26T13-47-49.289567120Z--9f04dc05c4c3ec3b8b1f36f7d7d153f3934b1f07 test-account2.pk
popd
```
Update config for tests with new accounts `static/config/public-chain-accounts.json`:
```
{
"Account1": {
"Address": "0xb6120ddd881593537c2bd4280bae509ec94b1a6b"
},
"Account2": {
"Address": "0x9f04dc05c4c3ec3b8b1f36f7d7d153f3934b1f07"
}
}
```
Embed keys as a binary data, you will need to install `npm` tool and web3.js lib:
```bash
npm install web3
make generate
```
As a final step request funds from faucet for a chosen network:
- [Rinkeby](https://faucet.rinkeby.io/)
- [Ropsten](http://faucet.ropsten.be:3001/)
Finally, you are ready to run tests!