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

Make manual testing easier #3256

Merged
merged 1 commit into from
Apr 28, 2022
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
36 changes: 36 additions & 0 deletions test/manual/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Manual Tests

The `./make-env.sh` script in this directory will make the environment necessary to run the tests listed here.

Call it with the appropriate `WALLET_VERSION` and `NODE_VERSION` environment variables set:

```
WALLET_VERSION=2022-04-27 NODE_VERSION=1.34.1 ./make-env.sh
```

Binaries:

- cardano-node: `./cardano-node/bin/cardano-node`
- cardano-wallet: `./cardano-wallet/bin/cardano-wallet`

Directories:

- Use `db-testnet` as the database directory for `cardano-node`.
- Use `wallet-db-testnet` as the database directory for `cardano-wallet`.

E.g.:

```
cardano-node/bin/cardano-node run \
--config ./testnet-config.json \
--topology ./testnet-topology.json \
--database-path ./db-testnet \
--socket-path ./node.socket

cardano-wallet/bin/cardano-wallet serve --port 8090 \
--node-socket ./node.socket \
--testnet ./testnet-byron-genesis.json \
--database ./wallet-db-testnet
```

Type `exit` to leave the test environment.
46 changes: 46 additions & 0 deletions test/manual/make-env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/usr/bin/env bash
#
# The following script creates the environment needed to run the manual tests.

if [[ -z "${WALLET_VERSION}" ]]; then
echo "WALLET_VERSION is not set!"
exit 1
fi

if [[ -z "${NODE_VERSION}" ]]; then
echo "NODE_VERSION is not set!"
exit 1
fi

set -euxo pipefail

pushd $(mktemp -d)

# Download source repositories
curl -L -o cardano-wallet.tar.gz "https://github.com/input-output-hk/cardano-wallet/archive/refs/tags/v${WALLET_VERSION}.tar.gz"
tar -xzf cardano-wallet.tar.gz

curl -L -o cardano-node.tar.gz "https://github.com/input-output-hk/cardano-node/archive/refs/tags/${NODE_VERSION}.tar.gz"
tar -xzf cardano-node.tar.gz

WALLET_DIR=cardano-wallet-${WALLET_VERSION}
NODE_DIR=cardano-node-${NODE_VERSION}

# Build binaries
nix-build $NODE_DIR -A cardano-node -o cardano-node
nix-build $WALLET_DIR -A cardano-wallet -o cardano-wallet

# Get latest configs
curl -L -o testnet-config.json https://hydra.iohk.io/job/Cardano/iohk-nix/cardano-deployment/latest/download/1/testnet-config.json
curl -L -o testnet-topology.json https://hydra.iohk.io/job/Cardano/iohk-nix/cardano-deployment/latest/download/1/testnet-topology.json
curl -L -o testnet-byron-genesis.json https://hydra.iohk.io/job/Cardano/iohk-nix/cardano-deployment/latest/download/1/testnet-byron-genesis.json
curl -L -o testnet-shelley-genesis.json https://hydra.iohk.io/job/Cardano/iohk-nix/cardano-deployment/latest/download/1/testnet-shelley-genesis.json
curl -L -o testnet-alonzo-genesis.json https://hydra.iohk.io/job/Cardano/iohk-nix/cardano-deployment/latest/download/1/testnet-alonzo-genesis.json

# Restore node database
curl -L -o db-testnet.tar.gz https://updates-cardano-testnet.s3.amazonaws.com/cardano-node-state/db-testnet.tar.gz
tar -xzf db-testnet.tar.gz

mkdir wallet-db-testnet

exec bash