Skip to content

Commit

Permalink
ci: test against go-relayer
Browse files Browse the repository at this point in the history
- adds dispatch jobs to test orchestration-api and fusdc test suites against go-relayer
  • Loading branch information
0xpatrickdev committed Jan 13, 2025
1 parent ee7eda8 commit 3f0038f
Show file tree
Hide file tree
Showing 8 changed files with 279 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/multichain-e2e-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ jobs:
working-directory: ./agoric-sdk/multichain-testing

- name: Run @agoric/multichain-testing E2E Tests
run: yarn ${{ inputs.test_command }}
run: ${{ inputs.test_command }}
working-directory: ./agoric-sdk/multichain-testing
env:
FILE: ${{ inputs.config }}
Expand Down
41 changes: 37 additions & 4 deletions .github/workflows/multichain-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,52 @@ name: Multichain E2E Tests

on:
workflow_dispatch:
inputs:
test_type:
description: 'Select which test to run'
type: choice
required: true
options:
- orchestration-api-hermes
- fast-usdc-hermes
- orchestration-api-go-relayer
- fast-usdc-go-relayer
workflow_call:

jobs:
orchestration-api-test:
name: Multichain E2E (Orchestration API)
name: Multichain E2E (Orchestration API - Hermes)
if: |
github.event_name == 'workflow_call' ||
(github.event_name == 'workflow_dispatch' && inputs.test_type == 'orchestration-api-hermes')
uses: ./.github/workflows/multichain-e2e-template.yml
with:
config: config.yaml
test_command: test:main
test_command: yarn test:main

fast-usdc-test:
name: Multichain E2E (Fast USDC)
name: Multichain E2E (Fast USDC - Hermes)
if: |
github.event_name == 'workflow_call' ||
(github.event_name == 'workflow_dispatch' && inputs.test_type == 'fast-usdc-hermes')
uses: ./.github/workflows/multichain-e2e-template.yml
with:
config: config.fusdc.yaml
test_command: test:fast-usdc
test_command: yarn test:fast-usdc

# Below jobs run on dispatch only
orchestration-api-go-relayer-test:
name: Multichain E2E (Orchestration API - Go Relayer)
if: github.event_name == 'workflow_dispatch' && inputs.test_type == 'orchestration-api-go-relayer'
uses: ./.github/workflows/multichain-e2e-template.yml
with:
config: config.go-relayer.yaml
test_command: RELAYER_TYPE=go-relayer yarn test:main

fast-usdc-go-relayer-test:
name: Multichain E2E (Fast USDC - Go Relayer)
if: github.event_name == 'workflow_dispatch' && inputs.test_type == 'fast-usdc-go-relayer'
uses: ./.github/workflows/multichain-e2e-template.yml
with:
config: config.fusdc.go-relayer.yaml
test_command: RELAYER_TYPE=go-relayer yarn test:fast-usdc
2 changes: 1 addition & 1 deletion multichain-testing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ kubectl logs hermes-osmosis-cosmoshub-0 --container=relayer --follow

```sh
# run tests with go-relayer configuration
make start FILE=config.gorelayer.yaml
make start FILE=config.go-relayer.yaml

RELAYER_TYPE=go-relayer yarn test
```
Expand Down
112 changes: 112 additions & 0 deletions multichain-testing/config.fusdc.go-relayer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
name: agoric-multichain-testing-fusdc-go-relayer
version: 0.2.20

chains:
- id: agoriclocal
name: agoric
image: ghcr.io/agoric/agoric-sdk:dev
numValidators: 1
env:
- name: DEBUG
value: SwingSet:vat,SwingSet:ls
genesis:
app_state:
staking:
params:
unbonding_time: '2m'
swingset:
params:
bootstrap_vat_config: '@agoric/vm-config/decentral-itest-orchestration-config.json'
scripts:
updateConfig:
file: scripts/update-config.sh
faucet:
enabled: true
type: starship
ports:
rest: 1317
rpc: 26657
exposer: 38087
grpc: 9090
faucet: 8082
resources:
cpu: 1
memory: 4Gi
- id: osmosislocal
name: osmosis
numValidators: 1
genesis:
app_state:
staking:
params:
unbonding_time: '2m'
interchain_accounts:
host_genesis_state:
params:
host_enabled: true
allow_messages: ['*']
interchainquery:
host_port: 'icqhost'
params:
host_enabled: true
allow_queries:
- /cosmos.bank.v1beta1.Query/Balance
- /cosmos.bank.v1beta1.Query/AllBalances
faucet:
enabled: true
type: starship
ports:
rest: 1315
rpc: 26655
grpc: 9093
faucet: 8084
resources:
cpu: 1
memory: 1Gi
- id: noblelocal
name: noble
numValidators: 1
genesis:
app_state:
staking:
params:
unbonding_time: '2m'
faucet:
enabled: true
type: starship
ports:
rest: 1314
rpc: 26654
grpc: 9092
faucet: 8083
resources:
cpu: 1
memory: 1Gi

relayers:
- name: osmosis-noble
type: go-relayer
replicas: 1
chains:
- osmosislocal
- noblelocal
- name: agoric-osmosis
type: go-relayer
replicas: 1
chains:
- agoriclocal
- osmosislocal
- name: agoric-noble
type: go-relayer
replicas: 1
chains:
- agoriclocal
- noblelocal

explorer:
enabled: false

registry:
enabled: true
ports:
rest: 8081
4 changes: 3 additions & 1 deletion multichain-testing/config.fusdc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@ chains:
updateConfig:
file: scripts/update-config.sh
faucet:
enabled: false
enabled: true
type: starship
ports:
rest: 1317
rpc: 26657
exposer: 38087
grpc: 9090
faucet: 8082
resources:
cpu: 1
memory: 4Gi
Expand Down
117 changes: 117 additions & 0 deletions multichain-testing/config.go-relayer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
name: agoric-multichain-testing-go-relayer
version: 0.2.20

chains:
- id: agoriclocal
name: agoric
image: ghcr.io/agoric/agoric-sdk:dev
numValidators: 1
env:
- name: DEBUG
value: SwingSet:vat,SwingSet:ls
genesis:
app_state:
staking:
params:
unbonding_time: '2m'
swingset:
params:
bootstrap_vat_config: '@agoric/vm-config/decentral-itest-orchestration-config.json'
scripts:
updateConfig:
file: scripts/update-config.sh
faucet:
enabled: true
type: starship
ports:
rest: 1317
rpc: 26657
exposer: 38087
grpc: 9090
faucet: 8082
resources:
cpu: 1
memory: 4Gi
- id: osmosislocal
name: osmosis
numValidators: 1
genesis:
app_state:
staking:
params:
unbonding_time: '2m'
interchain_accounts:
host_genesis_state:
params:
host_enabled: true
allow_messages: ['*']
interchainquery:
host_port: 'icqhost'
params:
host_enabled: true
allow_queries:
- /cosmos.bank.v1beta1.Query/Balance
- /cosmos.bank.v1beta1.Query/AllBalances
faucet:
enabled: true
type: starship
ports:
rest: 1315
rpc: 26655
grpc: 9093
faucet: 8084
resources:
cpu: 1
memory: 1Gi
- id: cosmoshublocal
name: cosmoshub
numValidators: 1
genesis:
app_state:
staking:
params:
unbonding_time: '2m'
interchain_accounts:
host_genesis_state:
params:
host_enabled: true
allow_messages: ['*']
faucet:
enabled: true
type: starship
ports:
rest: 1314
rpc: 26654
grpc: 9092
faucet: 8083
resources:
cpu: 1
memory: 1Gi

relayers:
- name: osmosis-cosmoshub
type: go-relayer
replicas: 1
chains:
- osmosislocal
- cosmoshublocal
- name: agoric-osmosis
type: go-relayer
replicas: 1
chains:
- agoriclocal
- osmosislocal
- name: agoric-cosmoshub
type: go-relayer
replicas: 1
chains:
- agoriclocal
- cosmoshublocal

explorer:
enabled: false

registry:
enabled: true
ports:
rest: 8081
4 changes: 3 additions & 1 deletion multichain-testing/test/fast-usdc/fast-usdc.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import type { CurrentWalletRecord } from '@agoric/smart-wallet/src/smartWallet.j
import type { QueryBalanceResponseSDKType } from '@agoric/cosmic-proto/cosmos/bank/v1beta1/query.js';
import type { USDCProposalShapes } from '@agoric/fast-usdc/src/pool-share-math.js';

const RELAYER_TYPE = process.env.RELAYER_TYPE;

const log = makeTracer('MCFU');

const { keys, values, fromEntries } = Object;
Expand All @@ -49,7 +51,7 @@ const LP_DEPOSIT_AMOUNT = 8_000n * 10n ** 6n;

test.before(async t => {
const { setupTestKeys, ...common } = await commonSetup(t, {
config: '../config.fusdc.yaml',
config: `../config.fusdc${RELAYER_TYPE ? '.' + RELAYER_TYPE : ''}.yaml`,
});
const {
chainInfo,
Expand Down
6 changes: 5 additions & 1 deletion multichain-testing/test/support.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,11 @@ const makeKeyring = async (

export const commonSetup = async (
t: ExecutionContext,
{ config = '../config.yaml' } = {},
{
env = process.env,
relayerType = env.RELAYER_TYPE,
config = `../config${relayerType ? '.' + relayerType : ''}.yaml`,
} = {},
) => {
let useChain: MultichainRegistry['useChain'];
try {
Expand Down

0 comments on commit 3f0038f

Please sign in to comment.