Skip to content

feat: add origin snapshotting#274

Open
graemecode wants to merge 3 commits into
masterfrom
origin-snapshotting
Open

feat: add origin snapshotting#274
graemecode wants to merge 3 commits into
masterfrom
origin-snapshotting

Conversation

@graemecode

Copy link
Copy Markdown
Contributor

This outlines a way to do origin snapshotting, so that we can reset to an origin snapshot during test setup without needing to save snapshots, etc.

One thing I'm uncertain about is whether the script .ts files get transpiled on difference machines - because this needs to happen in order to work. Will look to circle to find out.

Comment thread scripts/testTeardown.ts
console.log(`Reset blockchain to snapshot with ID: ${originSnapshot}`);
}

console.log("\n\n* Test Teardown Complete *\n");

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Calls to 'console.log' are not allowed.

Comment thread scripts/testTeardown.ts

if (originSnapshotString && originSnapshot >= 0) {
await web3Utils.revertToSnapshot(originSnapshot);
console.log(`Reset blockchain to snapshot with ID: ${originSnapshot}`);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Calls to 'console.log' are not allowed.

Comment thread scripts/testTeardown.ts
const web3Utils = new Web3Utils(web3);

module.exports = async () => {
console.log("\n\n* Test Teardown *\n");

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Calls to 'console.log' are not allowed.

Comment thread scripts/testSetup.ts

console.log(`Saved origin snapshot with ID: ${originSnapshot}`);

console.log("\n\n* Test Setup Complete *\n");

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Calls to 'console.log' are not allowed.

Comment thread scripts/testSetup.ts

process.env.originSnapshot = originSnapshot.toString();

console.log(`Saved origin snapshot with ID: ${originSnapshot}`);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Calls to 'console.log' are not allowed.

Comment thread scripts/testSetup.ts
const web3Utils = new Web3Utils(web3);

module.exports = async () => {
console.log("\n\n* Test Setup *\n");

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Calls to 'console.log' are not allowed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants