-
Notifications
You must be signed in to change notification settings - Fork 791
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
Run Consensus Tests on MuirGlacier #648
Changes from all commits
e4e468b
a528918
55f70f4
e903b14
d8b685b
910df45
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,8 +3,11 @@ | |
const argv = require('minimist')(process.argv.slice(2)) | ||
const tape = require('tape') | ||
const testing = require('ethereumjs-testing') | ||
const FORK_CONFIG = argv.fork || 'Istanbul' | ||
const { getRequiredForkConfigAlias } = require('./util') | ||
const FORK_CONFIG = (argv.fork || 'Istanbul') | ||
const FORK_CONFIG_TEST_SUITE = getRequiredForkConfigAlias(FORK_CONFIG) | ||
// Istanbul -> istanbul, MuirGlacier -> muirGlacier | ||
const FORK_CONFIG_VM = FORK_CONFIG.charAt(0).toLowerCase() + FORK_CONFIG.substring(1) | ||
// tests which should be fixed | ||
const skipBroken = [ | ||
'dynamicAccountOverwriteEmpty', // temporary till fixed (2019-01-30), skipped along constantinopleFix work time constraints | ||
|
@@ -138,7 +141,7 @@ function runTests(name, runnerArgs, cb) { | |
testGetterArgs.skipTests = getSkipTests(argv.skip, argv.runSkipped ? 'NONE' : 'ALL') | ||
testGetterArgs.runSkipped = getSkipTests(argv.runSkipped, 'NONE') | ||
testGetterArgs.skipVM = skipVM | ||
testGetterArgs.forkConfig = getRequiredForkConfigAlias(FORK_CONFIG) | ||
testGetterArgs.forkConfig = FORK_CONFIG_TEST_SUITE | ||
testGetterArgs.file = argv.file | ||
testGetterArgs.test = argv.test | ||
testGetterArgs.dir = argv.dir | ||
|
@@ -147,7 +150,8 @@ function runTests(name, runnerArgs, cb) { | |
|
||
testGetterArgs.customStateTest = argv.customStateTest | ||
|
||
runnerArgs.forkConfig = FORK_CONFIG | ||
runnerArgs.forkConfigVM = FORK_CONFIG_VM | ||
runnerArgs.forkConfigTestSuite = FORK_CONFIG_TEST_SUITE | ||
runnerArgs.jsontrace = argv.jsontrace | ||
runnerArgs.debug = argv.debug // for BlockchainTests | ||
|
||
|
@@ -178,7 +182,7 @@ function runTests(name, runnerArgs, cb) { | |
const runner = require(`./${name}Runner.js`) | ||
// Tests for HFs before Istanbul have been moved under `LegacyTests/Constantinople`: | ||
// https://github.com/ethereum/tests/releases/tag/v7.0.0-beta.1 | ||
if (runnerArgs.forkConfig !== 'Istanbul') { | ||
if (testGetterArgs.forkConfig !== 'Istanbul') { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should safeguard this conditional with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I thought about that as well, just left it out for timing reasons. |
||
name = 'LegacyTests/Constantinople/'.concat(name) | ||
} | ||
testing | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -403,6 +403,11 @@ exports.setupPreConditions = function (state, testData, done) { | |
* @returns {String} Either an alias of the forkConfig param, or the forkConfig param itself | ||
*/ | ||
exports.getRequiredForkConfigAlias = function (forkConfig) { | ||
// Run the Istanbul tests for MuirGlacier since there are no dedicated tests | ||
if (String(forkConfig).match(/^muirGlacier/i)) { | ||
return 'Istanbul' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the core of the PR. LGTM 👍 |
||
} | ||
// Petersburg is named ConstantinopleFix in the client-independent consensus test suite | ||
if (String(forkConfig).match(/^petersburg$/i)) { | ||
return 'ConstantinopleFix' | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DRY-ing. 👍