From 7ec95307e3ad1490f1c5e943cadfad8c521d36e5 Mon Sep 17 00:00:00 2001 From: Danno Ferrin Date: Fri, 8 Nov 2019 13:22:17 -0700 Subject: [PATCH] Update reference tests (#139) EF's testing team published the first version of the 7.0.0 reference tests. * Update some blacklist patterns to catch all future fork names * Ignore a new "postStateHash" json property * Ignore test randomStatetest94 as it is too memory heavy to run in parallel * Update file pattern as a stray test sits alone in one directory Signed-off-by: Danno Ferrin --- ethereum/core/build.gradle | 4 +++- .../besu/ethereum/vm/BlockchainReferenceTestCaseSpec.java | 2 +- .../besu/ethereum/vm/BlockchainReferenceTestTools.java | 6 ++++-- .../besu/ethereum/vm/GeneralStateReferenceTestTools.java | 2 +- ethereum/referencetests/src/test/resources | 2 +- 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/ethereum/core/build.gradle b/ethereum/core/build.gradle index a966837afe..766aef04cd 100644 --- a/ethereum/core/build.gradle +++ b/ethereum/core/build.gradle @@ -108,7 +108,9 @@ def generateTestFiles(FileTree jsonPath, File templateFile, String pathstrip, St if (!testJsonFile.getName().toString().startsWith(".")) { String parentDirectory = testJsonFile.getParentFile().getName() String testFile = testJsonFile.getName() - if(testJsonFile.getParentFile().getParentFile().getName() != pathstrip) { + if(testJsonFile.getParentFile().getName() == pathstrip) { + paths << pathstrip + "/" + testFile + } else if(testJsonFile.getParentFile().getParentFile().getName() != pathstrip) { paths << pathstrip + "/" + testJsonFile.getParentFile().getParentFile().getName() + "/" + parentDirectory + "/" + testFile } else { paths << pathstrip + "/" + parentDirectory + "/" + testFile diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/vm/BlockchainReferenceTestCaseSpec.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/vm/BlockchainReferenceTestCaseSpec.java index c8b32c234a..5ccdee965b 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/vm/BlockchainReferenceTestCaseSpec.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/vm/BlockchainReferenceTestCaseSpec.java @@ -43,7 +43,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; -@JsonIgnoreProperties({"_info", "postState"}) +@JsonIgnoreProperties({"_info", "postState", "postStateHash"}) public class BlockchainReferenceTestCaseSpec { private final String network; diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/vm/BlockchainReferenceTestTools.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/vm/BlockchainReferenceTestTools.java index 6bdca6d9e0..e7ca085a29 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/vm/BlockchainReferenceTestTools.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/vm/BlockchainReferenceTestTools.java @@ -67,8 +67,10 @@ public class BlockchainReferenceTestTools { "RevertPrecompiledTouch(_storage)?_d(0|3)g0v0_(EIP158|Byzantium|Constantinople|ConstantinopleFix)"); // Consumes a huge amount of memory - params.blacklist( - "static_Call1MB1024Calldepth_d1g0v0_(Byzantium|Constantinople|ConstantinopleFix)"); + params.blacklist("static_Call1MB1024Calldepth_d1g0v0_\\w+"); + + // Absurd amount of gas, doesn't run in parallel + params.blacklist("randomStatetest94_\\w+"); } public static Collection generateTestParametersForConfig(final String[] filePath) { diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/vm/GeneralStateReferenceTestTools.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/vm/GeneralStateReferenceTestTools.java index 162cc76cc5..684d12078c 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/vm/GeneralStateReferenceTestTools.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/vm/GeneralStateReferenceTestTools.java @@ -88,7 +88,7 @@ public class GeneralStateReferenceTestTools { // Gas integer value is too large to construct a valid transaction. params.blacklist("OverflowGasRequire"); // Consumes a huge amount of memory - params.blacklist("static_Call1MB1024Calldepth-(Byzantium|Constantinople|ConstantinopleFix)"); + params.blacklist("static_Call1MB1024Calldepth-\\w"); } public static Collection generateTestParametersForConfig(final String[] filePath) { diff --git a/ethereum/referencetests/src/test/resources b/ethereum/referencetests/src/test/resources index 0327d9f76c..cfbcd15f91 160000 --- a/ethereum/referencetests/src/test/resources +++ b/ethereum/referencetests/src/test/resources @@ -1 +1 @@ -Subproject commit 0327d9f76ce2a292a99e7a9dfc93627368ce589e +Subproject commit cfbcd15f91d4d6e1785d9cae5c5c37f47e8bad46