fix(e2e): hardcode kathy chains for e2e in send-test-messages.ts (#4067)

resolves https://github.com/hyperlane-xyz/issues/issues/1291
- remove test4 from kathy test
- drive-by tidy-up of `test4` metadata
- resets e2e test timeout back to original figure
- reuse original e2e rust cache

gonna keep the original commits on here as a trail of thought

---------

Signed-off-by: Paul Balaji <10051819+paulbalaji@users.noreply.github.com>
pull/3981/head
Paul Balaji 5 months ago committed by GitHub
parent d51813a1da
commit 653bbcff52
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 10
      .github/workflows/test.yml
  2. 20
      typescript/infra/scripts/send-test-messages.ts
  3. 5
      typescript/sdk/src/consts/testChains.ts

@ -188,7 +188,7 @@ jobs:
e2e-matrix:
runs-on: larger-runner
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.base_ref == 'main') || github.event_name == 'merge_group'
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.base_ref == 'main' || github.base_ref == 'cli-2.0') || github.event_name == 'merge_group'
needs: [yarn-build]
strategy:
matrix:
@ -215,7 +215,7 @@ jobs:
- name: rust cache
uses: Swatinem/rust-cache@v2
with:
prefix-key: "v2-${{ runner.os }}-rust-cache"
prefix-key: "v1-${{ runner.os }}-rust-cache"
shared-key: ${{ matrix.e2e-type }}
workspaces: |
./rust
@ -266,7 +266,7 @@ jobs:
working-directory: ./rust
env:
E2E_CI_MODE: 'true'
E2E_CI_TIMEOUT_SEC: '3600'
E2E_CI_TIMEOUT_SEC: '600'
E2E_KATHY_MESSAGES: '20'
RUST_BACKTRACE: 'full'
@ -282,7 +282,7 @@ jobs:
prebuild-cli-e2e:
runs-on: larger-runner
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.base_ref == 'main') || github.event_name == 'merge_group'
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.base_ref == 'main' || github.base_ref == 'cli-2.0') || github.event_name == 'merge_group'
steps:
- uses: actions/checkout@v4
with:
@ -331,7 +331,7 @@ jobs:
cli-advanced-e2e:
runs-on: larger-runner
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.base_ref == 'main') || github.event_name == 'merge_group'
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.base_ref == 'main' || github.base_ref == 'cli-2.0') || github.event_name == 'merge_group'
needs: [yarn-build, prebuild-cli-e2e]
strategy:
matrix:

@ -1,3 +1,4 @@
import { Provider } from '@ethersproject/providers';
import { Wallet } from 'ethers';
import fs from 'fs';
import yargs from 'yargs';
@ -100,15 +101,28 @@ async function main() {
const { timeout, defaultHook, requiredHook, mineforever } = args;
let messages = args.messages;
// Limit the test chains to a subset of the known chains
// E2E in Rust only knows about test1, test2 and test3
const kathyTestChains = [
TestChainName.test1,
TestChainName.test2,
TestChainName.test3,
];
// Create a multi-provider with a signer
const signer = new Wallet(ANVIL_KEY);
const multiProvider = MultiProvider.createTestMultiProvider({ signer });
// Get the provider for the first chain
const provider = multiProvider.getProvider(TestChainName.test1);
// Create core from addresses
const addresses = JSON.parse(
fs.readFileSync('./config/environments/test/core/addresses.json', 'utf8'),
);
const core = HyperlaneCore.fromAddressesMap(addresses, multiProvider);
// helper function to get a random element from a list
const randomElement = <T>(list: T[]) =>
list[Math.floor(Math.random() * list.length)];
@ -121,9 +135,11 @@ async function main() {
const run_forever = messages === 0;
while (run_forever || messages-- > 0) {
// Round robin origin chain
const local = core.chains()[messages % core.chains().length];
const local = kathyTestChains[messages % kathyTestChains.length];
// Random remote chain
const remote: ChainName = randomElement(await core.remoteChains(local));
const remote: ChainName = randomElement(
kathyTestChains.filter((c) => c !== local),
);
const remoteId = multiProvider.getDomainId(remote);
const contracts = core.getContracts(local);
const mailbox = contracts.mailbox;

@ -68,11 +68,6 @@ export const test3: ChainMetadata = {
export const test4: ChainMetadata = {
...test1,
blocks: {
confirmations: 1,
estimateBlockTime: 3,
reorgPeriod: 2,
},
chainId: 31337,
displayName: 'Test 4',
domainId: 31337,

Loading…
Cancel
Save