Skip to content

Commit

Permalink
chore: optimize warp config tests (#5341)
Browse files Browse the repository at this point in the history
### Description
This PR optimizes the warp config tests by moving the registry fetching
into `before()` and reading it in memory.

### Backward compatibility
Yes

### Testing
Unit Tests
  • Loading branch information
ltyu authored Jan 30, 2025
1 parent d2ba3de commit 30eeecf
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions typescript/infra/test/warp-configs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,25 @@ describe('Warp Configs', async function () {
const ENV = 'mainnet3';
const warpIdsToCheck = Object.keys(warpConfigGetterMap);
let multiProvider: MultiProvider;
let configsFromGithub;

before(async () => {
before(async function () {
multiProvider = (await getHyperlaneCore(ENV)).multiProvider;
configsFromGithub = await getGithubRegistry().getWarpDeployConfigs();
});

const envConfig = getEnvironmentConfig(ENV);

for (const warpRouteId of warpIdsToCheck) {
it(`should match Github Registry configs for ${warpRouteId}`, async () => {
it(`should match Github Registry configs for ${warpRouteId}`, async function () {
const warpConfig = await getWarpConfig(
multiProvider,
envConfig,
warpRouteId,
);
const githubRegistry = getGithubRegistry();
const configsFromGithub = await githubRegistry.getWarpDeployConfig(
warpRouteId,
);
const { mergedObject, isInvalid } = diffObjMerge(
warpConfig,
configsFromGithub!,
configsFromGithub![warpRouteId],
);

if (isInvalid) {
Expand Down

0 comments on commit 30eeecf

Please sign in to comment.