Add Withdrawls execution tests to reference test (#5143)

Added Ethereum execution spec test to be generated and executed by reference tests gradle task. Add `https://github.com/ethereum/execution-spec-tests/releases` as custom ivy repository to easily download and cache the test specs. Updated the reference test gradle file to generate the test Java classes.

Signed-off-by: Usman Saleem <usman@usmans.info>
pull/5145/head
Usman Saleem 2 years ago committed by GitHub
parent 6a14d72c30
commit b0daf14813
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 15
      build.gradle
  2. 37
      ethereum/referencetests/build.gradle
  3. 5
      gradle/verification-metadata.xml

@ -120,6 +120,21 @@ allprojects {
content { includeGroupByRegex('com\\.splunk\\..*') }
}
mavenCentral()
// ethereum execution spec tests fixtures. Exclusively for ethereum submodule to run ref tests
def ethExecSpecTestsRepo = ivy {
url 'https://github.com'
patternLayout {
artifact '/[organisation]/[module]/releases/download/v[revision]/[classifier].[ext]'
}
metadataSources {
artifact()
}
}
exclusiveContent {
forRepositories(ethExecSpecTestsRepo)
filter { includeModule('ethereum', 'execution-spec-tests')}
}
}
dependencies { errorprone 'com.google.errorprone:error_prone_core' }

@ -29,6 +29,37 @@ def blockchainReferenceTests = tasks.register("blockchainReferenceTests") {
)
}
configurations {
// we need this because referenceTestImplementation defaults to 'canBeResolved=false'.
tarConfig.extendsFrom referenceTestImplementation
tarConfig {
canBeResolved = true
canBeConsumed = false
}
}
def executionSpecTests = tasks.register("executionSpecTests") {
final referenceTestsPath = "$buildDir/execution-spec-tests/"
final generatedTestsPath = "$buildDir/generated/sources/reference-test/$name/java"
def tarPath = configurations.tarConfig.files.find{ it.name.startsWith('execution-spec-tests')}
copy {
from tarTree(tarPath)
into "$referenceTestsPath"
}
inputs.files fileTree(referenceTestsPath), fileTree(generatedTestsPath)
outputs.files generatedTestsPath
generateTestFiles(
fileTree(referenceTestsPath + "/fixtures"),
file("src/reference-test/templates/BlockchainReferenceTest.java.template"),
"fixtures",
"$generatedTestsPath/org/hyperledger/besu/ethereum/vm/executionspec",
"ExecutionSpecTest",
("fixtures/example/example") // exclude test for test filling tool
)
}
def generalstateReferenceTests = tasks.register("generalstateReferenceTests") {
final referenceTestsPath = "src/reference-test/external-resources/GeneralStateTests"
final generatedTestsPath = "$buildDir/generated/sources/reference-test/$name/java"
@ -66,13 +97,15 @@ sourceSets {
runtimeClasspath += main.output
srcDirs "src/reference-test/java",
blockchainReferenceTests,
executionSpecTests,
generalstateReferenceTests,
generalstateRegressionReferenceTests
}
resources {
srcDirs 'src/reference-test/resources',
'src/reference-test/external-resources',
'src/reference-test/templates'
'src/reference-test/templates',
'build/execution-spec-tests/'
}
}
}
@ -100,6 +133,8 @@ dependencies {
referenceTestImplementation project(path: ':evm')
referenceTestImplementation project(path: ':testutil')
referenceTestImplementation project(path: ':util')
// the following will be resolved via custom ivy repository declared in root build.gradle
referenceTestImplementation 'ethereum:execution-spec-tests:0.2.3:fixtures@tar.gz'
referenceTestImplementation 'com.fasterxml.jackson.core:jackson-databind'
referenceTestImplementation 'com.google.guava:guava'
referenceTestImplementation 'org.apache.tuweni:tuweni-bytes'

@ -1599,6 +1599,11 @@
<sha256 value="771e7b7e796577b0525f3121ee3101905037ee761a6a62b3a2b931f45d1c7d94" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="ethereum" name="execution-spec-tests" version="0.2.3">
<artifact name="execution-spec-tests-0.2.3-fixtures.tar.gz">
<sha256 value="3dcf5c33adddec2655f85ea2912da294fc0ea210cb1dd032b5278d78a5a0d805" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="info.picocli" name="picocli" version="3.0.0">
<artifact name="picocli-3.0.0.jar">
<sha256 value="22dbbe287dd0ab9d4d519ac9f2dd909537b6daf279ac5962a3bad8c9dae61032" origin="Generated by Gradle"/>

Loading…
Cancel
Save