Skip to content

Commit

Permalink
test: setup fast-usdc tests
Browse files Browse the repository at this point in the history
- uses a separate ava configurations so we can run in parallel in CI
  • Loading branch information
0xpatrickdev committed Nov 1, 2024
1 parent 186baa6 commit a868412
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 20 deletions.
11 changes: 11 additions & 0 deletions multichain-testing/ava.fusdc.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export default {
extensions: {
ts: 'module',
},
require: ['@endo/init/debug.js'],
nodeArguments: ['--import=tsimp/import'],
files: ['test/fast-usdc/**/*.test.ts'],
concurrency: 1,
serial: true,
timeout: '125s',
};
11 changes: 11 additions & 0 deletions multichain-testing/ava.main.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export default {
extensions: {
ts: 'module',
},
require: ['@endo/init/debug.js'],
nodeArguments: ['--import=tsimp/import'],
files: ['test/**/*.test.ts', '!test/fast-usdc/**/*.test.ts'],
concurrency: 1,
serial: true,
timeout: '125s',
};
20 changes: 2 additions & 18 deletions multichain-testing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"lint:eslint": "eslint .",
"lint:types": "tsc --noEmit",
"lint-fix": "yarn lint:eslint --fix",
"test": "ava",
"test": "ava --config ava.main.config.js",
"test:fast-usdc": "FILE=config.fusdc.yaml ava --config ava.fusdc.config.js",
"starship:setup": "make setup-deps setup-kind",
"starship:install": "make install",
"starship:port-forward": "make port-forward",
Expand Down Expand Up @@ -44,23 +45,6 @@
"resolutions": {
"axios": "1.6.7"
},
"ava": {
"extensions": {
"ts": "module"
},
"require": [
"@endo/init/debug.js"
],
"nodeArguments": [
"--import=tsimp/import"
],
"files": [
"**/*.test.ts"
],
"concurrency": 1,
"serial": true,
"timeout": "125s"
},
"eslintConfig": {
"root": true,
"env": {
Expand Down
14 changes: 14 additions & 0 deletions multichain-testing/test/fast-usdc/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
## Start Chains

Runs agoric, noble, and osmosis with hermes relayers.

```sh
# start starship with fusdc configuration
make start FILE=config.fusdc.yaml
```

## Run Tests

```sh
yarn test:fast-usdc
```
13 changes: 11 additions & 2 deletions multichain-testing/test/support.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import fse from 'fs-extra';
import childProcess from 'node:child_process';
import { makeAgdTools } from '../tools/agd-tools.js';
import { type E2ETools } from '../tools/e2e-tools.js';
import { makeGetFile, makeSetupRegistry } from '../tools/registry.js';
import { makeGetFile, makeSetupRegistry, type UseChainFn } from '../tools/registry.js';
import { generateMnemonic } from '../tools/wallet.js';
import { makeRetryUntilCondition } from '../tools/sleep.js';
import { makeDeployBuilder } from '../tools/deploy.js';
Expand Down Expand Up @@ -54,7 +54,16 @@ const makeKeyring = async (
};

export const commonSetup = async (t: ExecutionContext) => {
const { useChain } = await setupRegistry();
let useChain: UseChainFn;
try {
const registry = await setupRegistry({
config: `../${process.env.FILE || 'config.yaml'}`,
});
useChain = registry.useChain;
} catch (e) {
console.error('setupRegistry failed', e);
throw e;
}
const tools = await makeAgdTools(t.log, childProcess);
const keyring = await makeKeyring(tools);
const deployBuilder = makeDeployBuilder(tools, fse.readJSON, execa);
Expand Down

0 comments on commit a868412

Please sign in to comment.