Skip to content

Conversation

@graemecode
Copy link
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.

console.log(`Reset blockchain to snapshot with ID: ${originSnapshot}`);
}

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

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.


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

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.

const web3Utils = new Web3Utils(web3);

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

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.


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

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

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.


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

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

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.

const web3Utils = new Web3Utils(web3);

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

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.

3 participants