Skip to content

Commit

Permalink
fix: running e2e tests as part of build, requires forcing ip4 (not ip…
Browse files Browse the repository at this point in the history
…6) when connecting to anvil (#5744)

as title

Co-authored-by: ludamad <adam.domurad@gmail.com>
  • Loading branch information
charlielye and ludamad authored Apr 13, 2024
1 parent 1ddb1c7 commit 66fc89f
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 9 deletions.
6 changes: 2 additions & 4 deletions yarn-project/end-to-end/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,8 @@ E2E_TEST:

# Define e2e tests
e2e-tests:
LOCALLY
WITH DOCKER --load end-to-end=../+end-to-end
RUN docker run --rm -e LOG_LEVEL=silent -e DEBUG=aztec:e2e* end-to-end ./src/e2e
END
FROM ../+end-to-end
RUN yarn test ./src/e2e

e2e-sandbox-example:
ARG e2e_mode=local
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/end-to-end/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"clean": "rm -rf ./dest .tsbuildinfo",
"formatting": "run -T prettier --check ./src \"!src/web/main.js\" && run -T eslint ./src",
"formatting:fix": "run -T eslint --fix ./src && run -T prettier -w ./src",
"test": "LOG_LEVEL=${LOG_LEVEL:-silent} DEBUG=${DEBUG:-'aztec:e2e*'} DEBUG_COLORS=1 NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --testTimeout=120000 --forceExit",
"test": "LOG_LEVEL=${LOG_LEVEL:-silent} DEBUG_COLORS=1 NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --testTimeout=120000 --forceExit",
"test:integration": "concurrently -k -s first -c reset,dim -n test,anvil \"yarn test:integration:run\" \"anvil\"",
"test:integration:run": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --no-cache --runInBand --config jest.integration.config.json"
},
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/end-to-end/package.local.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"scripts": {
"build": "yarn clean && tsc -b && webpack",
"formatting": "run -T prettier --check ./src \"!src/web/main.js\" && run -T eslint ./src",
"test": "LOG_LEVEL=${LOG_LEVEL:-silent} DEBUG=${DEBUG:-'aztec:e2e*'} DEBUG_COLORS=1 NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --testTimeout=120000 --forceExit"
"test": "LOG_LEVEL=${LOG_LEVEL:-silent} DEBUG_COLORS=1 NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --testTimeout=120000 --forceExit"
}
}
2 changes: 1 addition & 1 deletion yarn-project/end-to-end/src/e2e_dapp_subscription.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ describe('e2e_dapp_subscription', () => {
[aliceAddress, sequencerAddress, subscriptionContract.address, bananaFPC.address],
[0n, 0n, INITIAL_GAS_BALANCE, INITIAL_GAS_BALANCE],
);
});
}, 180_000);

it('should allow Alice to subscribe by paying privately with bananas', async () => {
/**
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/end-to-end/src/fixtures/snapshot_manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ export class SnapshotManager {
const anvil = await retry(
async () => {
const ethereumHostPort = await getPort();
aztecNodeConfig.rpcUrl = `http://localhost:${ethereumHostPort}`;
aztecNodeConfig.rpcUrl = `http://127.0.0.1:${ethereumHostPort}`;
const anvil = createAnvil({ anvilBinary: './scripts/anvil_kill_wrapper.sh', port: ethereumHostPort });
await anvil.start();
return anvil;
Expand Down
3 changes: 2 additions & 1 deletion yarn-project/end-to-end/src/fixtures/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ export async function setup(
anvil = await retry(
async () => {
const ethereumHostPort = await getPort();
config.rpcUrl = `http://localhost:${ethereumHostPort}`;
config.rpcUrl = `http://127.0.0.1:${ethereumHostPort}`;
const anvil = createAnvil({ anvilBinary: './scripts/anvil_kill_wrapper.sh', port: ethereumHostPort });
await anvil.start();
return anvil;
Expand Down Expand Up @@ -398,6 +398,7 @@ export async function setup(
const { pxe, wallets } = await setupPXEService(numberOfAccounts, aztecNode!, pxeOpts, logger);

if (enableGas) {
logger.verbose('Deploying gas token...');
await deployCanonicalGasToken(
new SignerlessWallet(pxe, new DefaultMultiCallEntrypoint(config.chainId, config.version)),
);
Expand Down

0 comments on commit 66fc89f

Please sign in to comment.