Skip to content

Commit 92cfb71

Browse files
committed
refactor(e2e): remove build step from CI and improve dependency polling logic
1 parent 58305a7 commit 92cfb71

2 files changed

Lines changed: 8 additions & 13 deletions

File tree

.github/workflows/end-to-end-tests.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,5 @@ jobs:
4747
- name: Install Yarn dependencies
4848
run: yarn install
4949

50-
- name: Run build
51-
run: yarn build
52-
env:
53-
NODE_ENV: production
54-
5550
- name: Run end-to-end tests
5651
run: yarn test:e2e

packages/delegator-e2e/src/await-dependencies.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,15 @@ const waitFor = async (name: string, url: string) => {
2424
});
2525

2626
do {
27-
if (!isAvailable) {
27+
if (isAvailable === undefined) {
2828
// Only add a delay if it's not the first time
2929
await new Promise((resolve) => setTimeout(resolve, POLL_INTERVAL_MS));
3030
}
3131

3232
await client
3333
.request({ method: 'web3_clientVersion' })
3434
.then(() => (isAvailable = true))
35-
.catch((e: any) => {
36-
isAvailable = (e as Error).name !== 'HttpRequestError';
37-
});
35+
.catch(() => (isAvailable = false));
3836
} while (!isAvailable);
3937

4038
console.log(`${name} is available`);
@@ -61,13 +59,15 @@ const deployEnvironment = async () => {
6159
};
6260

6361
(async () => {
62+
console.log('Waiting for blockchain node');
6463
await waitFor('Blockchain node', nodeUrl);
64+
const bundlerAndPaymasterReady = Promise.all([
65+
waitFor('Bundler', bundlerUrl),
66+
waitFor('Mock paymaster', paymasterUrl),
67+
]);
6568

6669
const environment = await deployEnvironment();
6770
await writeFile('./.gator-env.json', JSON.stringify(environment, null, 2));
6871

69-
await Promise.all([
70-
waitFor('Bundler', bundlerUrl),
71-
waitFor('Mock paymaster', paymasterUrl),
72-
]);
72+
await bundlerAndPaymasterReady;
7373
})();

0 commit comments

Comments
 (0)