-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dockerize contracts/scripts/test.sh (#994)
* Dockerize contracts/scripts/test.sh * Move to repo root in contracts/scripts/test.sh
- Loading branch information
Showing
1 changed file
with
32 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,38 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
# To run this: | ||
# | ||
# .github/scripts/run_consensus.sh | ||
# source contracts/env/dev | ||
# contracts/scripts/deploy.sh | ||
# contracts/scripts/test.sh | ||
|
||
E2E_PATH=$(pwd)/e2e-tests | ||
CONTRACTS_PATH=$(pwd)/contracts | ||
set -euox pipefail | ||
|
||
# shellcheck source=contracts/scripts/test_env.sh | ||
. "$CONTRACTS_PATH/scripts/test_env.sh" | ||
# Move to the root of the repo | ||
cd "$(dirname -- "$(readlink -f -- "${BASH_SOURCE[@]}")")/../.." | ||
|
||
pushd "$E2E_PATH" | ||
cargo test button -- --test-threads 1 --nocapture | ||
popd | ||
export CONTRACTS_PATH | ||
CONTRACTS_PATH=$(pwd)/contracts | ||
|
||
exit $? | ||
docker run \ | ||
-e EARLY_BIRD_SPECIAL="$(jq --raw-output ".early_bird_special" < "$CONTRACTS_PATH"/addresses.json)" \ | ||
-e THE_PRESSIAH_COMETH="$(jq --raw-output ".the_pressiah_cometh" < "$CONTRACTS_PATH"/addresses.json)" \ | ||
-e BACK_TO_THE_FUTURE="$(jq --raw-output ".back_to_the_future" < "$CONTRACTS_PATH"/addresses.json)" \ | ||
-e SIMPLE_DEX="$(jq --raw-output ".simple_dex" < "$CONTRACTS_PATH"/addresses.json)" \ | ||
-e WRAPPED_AZERO="$(jq --raw-output ".wrapped_azero" < "$CONTRACTS_PATH"/addresses.json)" \ | ||
-e BUTTON_GAME_METADATA="/code/contracts/button/target/ink/button.json" \ | ||
-e TICKET_TOKEN_METADATA="/code/contracts/ticket_token/target/ink/ticket_token.json" \ | ||
-e REWARD_TOKEN_METADATA="/code/contracts/game_token/target/ink/game_token.json" \ | ||
-e MARKETPLACE_METADATA="/code/contracts/marketplace/target/ink/marketplace.json" \ | ||
-e SIMPLE_DEX_METADATA="/code/contracts/simple_dex/target/ink/simple_dex.json" \ | ||
-e WRAPPED_AZERO_METADATA="/code/contracts/wrapped_azero/target/ink/wrapped_azero.json" \ | ||
-e RUST_LOG="aleph_e2e_client=info" \ | ||
-v "$(pwd)":/code \ | ||
-v ~/.cargo/registry:/usr/local/cargo/registry \ | ||
-v ~/.cargo/git:/usr/local/cargo/git \ | ||
-w /code/e2e-tests \ | ||
--rm \ | ||
--network host \ | ||
rust:1.67-buster \ | ||
cargo test button -- --test-threads 1 --nocapture |