Skip to content

Commit

Permalink
Dockerize contracts/scripts/test.sh (#994)
Browse files Browse the repository at this point in the history
* Dockerize contracts/scripts/test.sh

* Move to repo root in contracts/scripts/test.sh
  • Loading branch information
obrok authored Mar 9, 2023
1 parent b10a7ea commit 4e62a45
Showing 1 changed file with 32 additions and 9 deletions.
41 changes: 32 additions & 9 deletions contracts/scripts/test.sh
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

0 comments on commit 4e62a45

Please sign in to comment.