Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: don't run e2e tests against wrong anvil #5686

Merged
merged 1 commit into from
Apr 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion yarn-project/end-to-end/src/fixtures/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -330,12 +330,20 @@ export async function setup(

let anvil: Anvil | undefined;

// spawn an anvil instance if one isn't already running
// and we're not connecting to a remote PXE
if (!config.rpcUrl) {
if (PXE_URL) {
throw new Error(
`PXE_URL provided but no ETHEREUM_HOST set. Refusing to run, please set both variables so tests can deploy L1 contracts to the same Anvil instance`,
);
}

// Start anvil.
// We go via a wrapper script to ensure if the parent dies, anvil dies.
const ethereumHostPort = await getPort();
config.rpcUrl = `http://localhost:${ethereumHostPort}`;
const anvil = createAnvil({ anvilBinary: './scripts/anvil_kill_wrapper.sh', port: ethereumHostPort });
anvil = createAnvil({ anvilBinary: './scripts/anvil_kill_wrapper.sh', port: ethereumHostPort });
await anvil.start();
}

Expand Down
Loading