Skip to content

Commit

Permalink
refactor(e2e): use separate key params for 2 wallet tests
Browse files Browse the repository at this point in the history
Allow selecting specific wallets for tests using two wallets.
  • Loading branch information
mirceahasegan committed Mar 12, 2023
1 parent ca1b8e7 commit d1426c4
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/continuous-integration-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ jobs:
FAUCET_PROVIDER_PARAMS: '{"baseUrl":"http://localhost:8090/v2","mnemonic":"fire method repair aware foot tray accuse brother popular olive find account sick rocket next"}'
KEY_MANAGEMENT_PROVIDER: 'inMemory'
KEY_MANAGEMENT_PARAMS: '{"bip32Ed25519": "CML", "accountIndex": 0, "chainId":{"networkId": 0, "networkMagic": 888}, "passphrase":"some_passphrase","mnemonic":"vacant violin soft weird deliver render brief always monitor general maid smart jelly core drastic erode echo there clump dizzy card filter option defense"}'
KEY_MANAGEMENT_PARAMS_PEER: '{"bip32Ed25519": "CML", "accountIndex": 1, "chainId":{"networkId": 0, "networkMagic": 888}, "passphrase":"some_passphrase","mnemonic":"vacant violin soft weird deliver render brief always monitor general maid smart jelly core drastic erode echo there clump dizzy card filter option defense"}'
ASSET_PROVIDER: 'http'
ASSET_PROVIDER_PARAMS: '{"baseUrl":"http://localhost:4000/asset"}'
CHAIN_HISTORY_PROVIDER: 'http'
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/nightly-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ jobs:
FAUCET_PROVIDER_PARAMS: '{"baseUrl":"http://localhost:8090/v2","mnemonic":"fire method repair aware foot tray accuse brother popular olive find account sick rocket next"}'
KEY_MANAGEMENT_PROVIDER: 'inMemory'
KEY_MANAGEMENT_PARAMS: '{"bip32Ed25519": "CML", "accountIndex": 0, "chainId":{"networkId": 0, "networkMagic": 888}, "passphrase":"some_passphrase","mnemonic":"vacant violin soft weird deliver render brief always monitor general maid smart jelly core drastic erode echo there clump dizzy card filter option defense"}'
KEY_MANAGEMENT_PARAMS_PEER: '{"bip32Ed25519": "CML", "accountIndex": 1, "chainId":{"networkId": 0, "networkMagic": 888}, "passphrase":"some_passphrase","mnemonic":"vacant violin soft weird deliver render brief always monitor general maid smart jelly core drastic erode echo there clump dizzy card filter option defense"}'
ASSET_PROVIDER: 'http'
ASSET_PROVIDER_PARAMS: '{"baseUrl":"http://localhost:4000/asset"}'
CHAIN_HISTORY_PROVIDER: 'http'
Expand Down
3 changes: 3 additions & 0 deletions packages/e2e/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ KEY_MANAGEMENT_PARAMS='{"bip32Ed25519": "CML", "accountIndex": 0, "chainId":{"ne
#KEY_MANAGEMENT_PARAMS='{"bip32Ed25519": "CML", "accountIndex": 0, "chainId":{"networkId": 0, "networkMagic": 888}, "passphrase":"some_passphrase","mnemonic":"phrase raw learn suspect inmate powder combine apology regular hero gain chronic fruit ritual short screen goddess odor keen creek brand today kit machine"}'
#KEY_MANAGEMENT_PARAMS='{"bip32Ed25519": "CML", "accountIndex": 0, "chainId":{"networkId": 0, "networkMagic": 888}, "passphrase":"some_passphrase","mnemonic":"salon zoo engage submit smile frost later decide wing sight chaos renew lizard rely canal coral scene hobby scare step bus leaf tobacco slice"}'

# Key managment setup for tests with two wallets
KEY_MANAGEMENT_PARAMS_PEER='{"bip32Ed25519": "CML", "accountIndex": 1, "chainId":{"networkId": 0, "networkMagic": 888}, "passphrase":"some_passphrase","mnemonic":"vacant violin soft weird deliver render brief always monitor general maid smart jelly core drastic erode echo there clump dizzy card filter option defense"}'

# Providers setup - required by getWallet
ASSET_PROVIDER=http
ASSET_PROVIDER_PARAMS='{"baseUrl":"http://localhost:4000/asset"}'
Expand Down
2 changes: 2 additions & 0 deletions packages/e2e/src/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ const validators = {
CHAIN_HISTORY_PROVIDER_PARAMS: providerParams(),
DB_SYNC_CONNECTION_STRING: str(),
KEY_MANAGEMENT_PARAMS: keyManagementParams(),
KEY_MANAGEMENT_PARAMS_PEER: keyManagementParams(),
KEY_MANAGEMENT_PROVIDER: str(),
LOGGER_MIN_SEVERITY: str({ default: 'info' }),
NETWORK_INFO_PROVIDER: str(),
Expand Down Expand Up @@ -139,6 +140,7 @@ export const walletVariables = [
'CHAIN_HISTORY_PROVIDER',
'CHAIN_HISTORY_PROVIDER_PARAMS',
'KEY_MANAGEMENT_PARAMS',
'KEY_MANAGEMENT_PARAMS_PEER',
'KEY_MANAGEMENT_PROVIDER',
'LOGGER_MIN_SEVERITY',
'NETWORK_INFO_PROVIDER',
Expand Down
10 changes: 8 additions & 2 deletions packages/e2e/test/wallet/SingleAddressWallet/delegation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,14 @@ describe('SingleAddressWallet/delegation', () => {

beforeAll(async () => {
jest.setTimeout(180_000);
wallet1 = await getWallet({ env, idx: 0, logger, name: 'Test Wallet 1', polling: { interval: 500 } });
wallet2 = await getWallet({ env, idx: 1, logger, name: 'Test Wallet 2', polling: { interval: 500 } });
wallet1 = await getWallet({ env, logger, name: 'Test Wallet 1', polling: { interval: 500 } });
wallet2 = await getWallet({
customKeyParams: env.KEY_MANAGEMENT_PARAMS_PEER,
env,
logger,
name: 'Test Wallet 2',
polling: { interval: 500 }
});

await Promise.all([waitForWalletStateSettle(wallet1.wallet), waitForWalletStateSettle(wallet2.wallet)]);
});
Expand Down

0 comments on commit d1426c4

Please sign in to comment.