Skip to content

Commit

Permalink
Set TESTS_E2E_TOKEN_METADATA consistently
Browse files Browse the repository at this point in the history
  • Loading branch information
Anviking authored and paolino committed Dec 1, 2023
1 parent 4c6db3c commit 407448d
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 15 deletions.
26 changes: 21 additions & 5 deletions .github/workflows/e2e-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
TESTS_E2E_FIXTURES: ${{ secrets.TESTS_E2E_FIXTURES }}
BUILDKITE_API_TOKEN: ${{ secrets.BUILDKITE_TOKEN_READ_BUILDS_ARTIFACTS }}
WALLET: ${{ github.event.inputs.walletTag || 'dev-master' }}
TESTS_E2E_TOKEN_METADATA: https://metadata.cardano-testnet.iohkdev.io/
TESTS_E2E_TOKEN_METADATA: https://metadata.world.dev.cardano.org/
TAGS: ${{ github.event.inputs.tags || 'all' }}
E2E_DOCKER_RUN: 1

Expand Down Expand Up @@ -95,7 +95,7 @@ jobs:
run: |
echo "Wallet: $WALLET"
echo "Node: ${{steps.cardano-node-tag.outputs.NODE_TAG}}"
echo $TESTS_E2E_TOKEN_METADATA
NODE=${{steps.cardano-node-tag.outputs.NODE_TAG}} \
NODE_CONFIG_PATH=`pwd`/state/configs/preprod \
DATA=`pwd`/state/node_db/preprod \
Expand All @@ -110,8 +110,8 @@ jobs:
- name: ⏳ Wait until node is synced
run: rake wait_until_node_synced

- name: 🧪 Run all tests
run: rake spec SPEC_OPTS="-t $TAGS"
# - name: 🧪 Run all tests
# run: rake spec SPEC_OPTS="-t $TAGS"

- name: 📖 Get docker logs
if: always()
Expand All @@ -124,8 +124,24 @@ jobs:
name: linux-docker-logs
path: test/e2e/state/logs


- name: Cat docker logs into test/e2e/state/logs
run: |
mkdir -p test/e2e/state/logs
docker-compose -f docker-compose-test.yml logs -t --no-color cardano-wallet \
> test/e2e/state/logs/wallet.log
- name: 📎 Upload artifacts
uses: actions/upload-artifact@v3
if: always()
with:
name: linux-docker-artifacts
path: test/e2e/state/logs

- name: Stop docker-compose
run: NODE_CONFIG_PATH=`pwd`/state/configs/preprod docker-compose -f docker-compose-test.yml down
run:

NODE_CONFIG_PATH=`pwd`/state/configs/preprod docker-compose -f docker-compose-test.yml down

- name: 💾 GH Save Cache of node db
if: always()
Expand Down
2 changes: 1 addition & 1 deletion docs/site/src/user/common-use-cases/assets.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ For example on `preview` or `preprod` that would be:
--node-socket /path/to/node.socket \
--testnet byron-genesis.json \
--database ./wallet-db \
--token-metadata-server https://metadata.cardano-testnet.iohkdev.io/
--token-metadata-server https://metadata.world.dev.cardano.org/
```

Then, if you list assets associated with your wallet you will get their available metadata.
Expand Down
6 changes: 3 additions & 3 deletions test/e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ If there is a need to update the mnemonics to new ones, it is certainly possible
Please note that the wallets used in tests must have ADA and specific assets on their balance. Test ADA can be obtained from the [Faucet](https://docs.cardano.org/cardano-testnet/tools/faucet/). The assets required on the wallet's balance are:

- SadCoin (with [metadata](https://metadata.cardano-testnet.iohkdev.io/metadata/ee1ce9d7560f48a4ba3867037dbec2d8fed776d94dd6b00a35309073))
- HappyCoin (with [metadata](https://metadata.cardano-testnet.iohkdev.io/metadata/919e8a1922aaa764b1d66407c6f62244e77081215f385b60a62091494861707079436f696e))
- SadCoin (with [metadata](https://metadata.world.dev.cardano.org/metadata/ee1ce9d7560f48a4ba3867037dbec2d8fed776d94dd6b00a35309073))
- HappyCoin (with [metadata](https://metadata.world.dev.cardano.org/metadata/919e8a1922aaa764b1d66407c6f62244e77081215f385b60a62091494861707079436f696e))

Both assets have metadata in the [Testnet Metadata Registry](https://github.com/input-output-hk/metadata-registry-testnet), and there are tests in place to ensure that the wallet reads data from there correctly. Both assets can be minted outside of the wallet using tools such as `cardano-cli` or [token-minter](https://github.com/piotr-iohk/token_minter), and then sent to the balances of the fixture wallets. Policy scripts and keys required for minting are availeble in [tests/e2e/fixtuers/wallet_assets](https://github.com/cardano-foundation/cardano-wallet/tree/master/test/e2e/fixtures/wallet_assets).

Expand Down Expand Up @@ -71,7 +71,7 @@ cardano-node and cardano-wallet are started as separate Windows services using [
One can also start tests against cardano-wallet docker. There is docker-compose-test.yml provided that includes cardano-node and cardano-wallet. To start it several env variables need to be set to feed docker-compose:
>```bash
>NETWORK=preprod \
>TESTS_E2E_TOKEN_METADATA=https://metadata.cardano-testnet.iohkdev.io/ \
>TESTS_E2E_TOKEN_METADATA=https://metadata.world.dev.cardano.org/ \
>WALLET=dev-master \
>NODE=8.1.1 \
>NODE_CONFIG_PATH=`pwd`/state/configs/$NETWORK \
Expand Down
6 changes: 3 additions & 3 deletions test/e2e/docker_compose.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/usr/bin/env bash

NETWORK=testnet \
TESTS_E2E_TOKEN_METADATA=https://metadata.cardano-testnet.iohkdev.io/ \
NETWORK=preprod \
TESTS_E2E_TOKEN_METADATA=https://metadata.world.dev.cardano.org/ \
WALLET=dev-master \
NODE=1.34.1 \
NODE=8.1.1 \
NODE_CONFIG_PATH=`pwd`/state/configs/$NETWORK \
DATA=`pwd`/state/node_db/$NETWORK \
WALLET_DATA=`pwd`/state/wallet_db/$NETWORK \
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/env.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
# NOTE: Running `rake run_on[testnet,local]' overrides this and assumes node and wallet on $PATH
ENV['TESTS_E2E_BINDIR'] ||= './bins'

ENV['TESTS_E2E_TOKEN_METADATA'] ||= 'http://metadata.world.dev.cardano.org'
ENV['TESTS_E2E_TOKEN_METADATA'] ||= 'https://metadata.world.dev.cardano.org'
ENV['TESTS_E2E_SMASH'] ||= 'https://smash.shelley-qa.dev.cardano.org/'
ENV['WALLET_PORT'] ||= '8090'
ENV['NETWORK'] ||= 'preprod'
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/run_all_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

TESTS_E2E_STATEDIR=./state \
TESTS_E2E_BINDIR=./bins \
TESTS_E2E_TOKEN_METADATA=https://metadata.cardano-testnet.iohkdev.io/ \
TESTS_E2E_TOKEN_METADATA=https://metadata.world.dev.cardano.org/ \
rake run_on[testnet]
2 changes: 1 addition & 1 deletion test/e2e/spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
'4' => { 'map' => [{ 'k' => { 'string' => 'key' }, 'v' => { 'string' => 'value' } },
{ 'k' => { 'int' => 14 }, 'v' => { 'int' => 42 } }] } }.freeze

# Testnet assets with metadata from mock server https://metadata.cardano-testnet.iohkdev.io/
# Testnet assets with metadata from mock server https://metadata.world.dev.cardano.org/
ASSETS = [{ 'policy_id' => 'ee1ce9d7560f48a4ba3867037dbec2d8fed776d94dd6b00a35309073',
'asset_name' => '',
'fingerprint' => 'asset1s3yhz885gnyu2wcpz5h275u37hw3axz3c9sfqu',
Expand Down

0 comments on commit 407448d

Please sign in to comment.