Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion e2e-tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,29 @@ This crate contains e2e test scenarios for the aleph-node.
The most basic way to run (assuming a local node is listening on 9944) is:

```bash
$ NODE=ws://127.0.0.1:9944 cargo test name_of_one_test
$ NODE_URL=ws://127.0.0.1:9944 cargo test name_of_one_test
```

Note that the particular test cases might require different numbers of launched nodes, validators, or a particular
configuration of the launched nodes, see the documentation for a particular test case for details.

Additional options are passed to the tests via env variables. See `src/config.rs` for docs on available options.

## Running on devnet (or other-net)

You can also run the tests on some other network. For example, to run the contract test for the `adder` contract on
devnet:

1. Prepare an account with some money, note the seed of the account.
2. Deploy the contract to devnet:

```bash
contracts/adder$ NODE_URL=wss://ws.dev.azero.dev AUTHORITY="$THE_SEED" ./deploy.sh
```

3. Run the tests:

```bash
e2e-tests$ RUST_BACKTRACE=1 SUDO_SEED="$THE_SEED" NODE_URL=wss://ws.dev.azero.dev:443 \
ADDER=$DEPLOY_ADDRESS ADDER_METADATA=../contracts/adder/target/ink/metadata.json cargo test adder -- --nocapture
```
4 changes: 2 additions & 2 deletions e2e-tests/src/test/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ pub async fn transfer<S: SignedConnectionApi>(
to: &KeyPair,
amount: Balance,
) -> Result<()> {
conn.transfer(to.signer().public().into(), amount, TxStatus::InBlock)
conn.transfer(to.signer().public().into(), amount, TxStatus::Finalized)
.await
.map(|_| ())
}
Expand All @@ -78,7 +78,7 @@ pub async fn basic_test_context(
let authority = KeyPairWrapper(aleph_client::keypair_from_string(&config.sudo_seed));
let account = random_account();

transfer(&authority.sign(&conn), &account, alephs(100)).await?;
transfer(&authority.sign(&conn), &account, alephs(1)).await?;

Ok((conn, authority, account))
}