Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dockerize contracts/scripts/test.sh #994

Merged
merged 2 commits into from
Mar 9, 2023
Merged
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
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
obrok marked this conversation as resolved.
Show resolved Hide resolved

# shellcheck source=contracts/scripts/test_env.sh
. "$CONTRACTS_PATH/scripts/test_env.sh"
obrok marked this conversation as resolved.
Show resolved Hide resolved
# 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 \
deuszx marked this conversation as resolved.
Show resolved Hide resolved
cargo test button -- --test-threads 1 --nocapture