mirror of
https://github.com/vacp2p/linea-besu.git
synced 2026-01-09 21:17:54 -05:00
Bump execution spec tests, reprise (#7056)
* execution-spec-tests generate state and blockchain tests separately Signed-off-by: garyschulte <garyschulte@gmail.com>
This commit is contained in:
2
.github/workflows/reference-tests.yml
vendored
2
.github/workflows/reference-tests.yml
vendored
@@ -41,7 +41,7 @@ jobs:
|
||||
with:
|
||||
cache-disabled: true
|
||||
- name: execute generate reference tests
|
||||
run: ./gradlew ethereum:referencetests:blockchainReferenceTests ethereum:referencetests:generalstateReferenceTests ethereum:referencetests:generalstateRegressionReferenceTests -Dorg.gradle.parallel=true -Dorg.gradle.caching=true
|
||||
run: ./gradlew ethereum:referencetests:referenceTestClasses -Dorg.gradle.parallel=true -Dorg.gradle.caching=true
|
||||
- name: list test files generated
|
||||
run: find ethereum/referencetests/build/generated/sources/reference-test -name "*.java" | sort >> filenames.txt
|
||||
- name: Split tests
|
||||
|
||||
@@ -80,13 +80,22 @@ def executionSpecTests = tasks.register("executionSpecTests") {
|
||||
|
||||
inputs.files fileTree(referenceTestsPath), fileTree(generatedTestsPath)
|
||||
outputs.files generatedTestsPath
|
||||
// generate blockchain_tests:
|
||||
generateTestFiles(
|
||||
fileTree(referenceTestsPath + "/fixtures"),
|
||||
file("src/reference-test/templates/BlockchainReferenceTest.java.template"),
|
||||
fileTree(referenceTestsPath + "/fixtures/blockchain_tests"),
|
||||
file("src/reference-test/templates/ExecutionSpecTest.java.template"),
|
||||
"fixtures",
|
||||
"$generatedTestsPath/org/hyperledger/besu/ethereum/vm/executionspec",
|
||||
"ExecutionSpecTest",
|
||||
("fixtures/example/example") // exclude test for test filling tool
|
||||
"ExecutionSpecBlockchainTest"
|
||||
)
|
||||
|
||||
// generate state_tests:
|
||||
generateTestFiles(
|
||||
fileTree(referenceTestsPath + "/fixtures/state_tests"),
|
||||
file("src/reference-test/templates/ExecutionSpecStateTest.java.template"),
|
||||
"fixtures",
|
||||
"$generatedTestsPath/org/hyperledger/besu/ethereum/vm/executionspec",
|
||||
"ExecutionSpecStateTest"
|
||||
)
|
||||
}
|
||||
|
||||
@@ -170,7 +179,7 @@ dependencies {
|
||||
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.5:fixtures@tar.gz'
|
||||
referenceTestImplementation 'ethereum:execution-spec-tests:2.1.1:fixtures@tar.gz'
|
||||
referenceTestImplementation 'com.fasterxml.jackson.core:jackson-databind'
|
||||
referenceTestImplementation 'com.google.guava:guava'
|
||||
referenceTestImplementation 'io.tmio:tuweni-bytes'
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
package org.hyperledger.besu.ethereum.vm.executionspec;
|
||||
|
||||
import static org.hyperledger.besu.ethereum.vm.GeneralStateReferenceTestTools.executeTest;
|
||||
import static org.hyperledger.besu.ethereum.vm.GeneralStateReferenceTestTools.generateTestParametersForConfig;
|
||||
import static org.junit.jupiter.api.Assumptions.assumeTrue;
|
||||
|
||||
import org.hyperledger.besu.ethereum.referencetests.GeneralStateTestCaseEipSpec;
|
||||
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.Arguments;
|
||||
import org.junit.jupiter.params.provider.MethodSource;
|
||||
|
||||
import static org.junit.jupiter.api.Assumptions.assumeTrue;
|
||||
|
||||
/** The general state test operation testing framework entry point. */
|
||||
public class %%TESTS_NAME%% {
|
||||
|
||||
private static final String[] TEST_CONFIG_FILE_DIR_PATH = new String[] {%%TESTS_FILE%%};
|
||||
|
||||
public static Stream<Arguments> getTestParametersForConfig() {
|
||||
return generateTestParametersForConfig(TEST_CONFIG_FILE_DIR_PATH).stream().map(params ->
|
||||
Arguments.of(params[0], params[1], params[2])
|
||||
);
|
||||
}
|
||||
|
||||
@ParameterizedTest(name = "Name: {0}")
|
||||
@MethodSource("getTestParametersForConfig")
|
||||
public void execution(
|
||||
final String name,
|
||||
final GeneralStateTestCaseEipSpec spec,
|
||||
final boolean runTest) {
|
||||
assumeTrue(runTest, "Test " + name + " was ignored");
|
||||
executeTest(spec);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package org.hyperledger.besu.ethereum.vm.executionspec;
|
||||
|
||||
import static org.hyperledger.besu.ethereum.vm.BlockchainReferenceTestTools.executeTest;
|
||||
import static org.hyperledger.besu.ethereum.vm.BlockchainReferenceTestTools.generateTestParametersForConfig;
|
||||
|
||||
import org.hyperledger.besu.ethereum.referencetests.BlockchainReferenceTestCaseSpec;
|
||||
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.Arguments;
|
||||
import org.junit.jupiter.params.provider.MethodSource;
|
||||
|
||||
import static org.junit.jupiter.api.Assumptions.assumeTrue;
|
||||
|
||||
/** The blockchain test operation testing framework entry point. */
|
||||
public class %%TESTS_NAME%% {
|
||||
|
||||
private static final String[] TEST_CONFIG_FILE_DIR_PATH = new String[] {%%TESTS_FILE%%};
|
||||
|
||||
public static Stream<Arguments> getTestParametersForConfig() {
|
||||
return generateTestParametersForConfig(TEST_CONFIG_FILE_DIR_PATH).stream().map(params ->
|
||||
Arguments.of(params[0], params[1], params[2])
|
||||
);
|
||||
}
|
||||
|
||||
@ParameterizedTest(name = "Name: {0}")
|
||||
@MethodSource("getTestParametersForConfig")
|
||||
public void execution(
|
||||
final String name,
|
||||
final BlockchainReferenceTestCaseSpec spec,
|
||||
final boolean runTest) {
|
||||
assumeTrue(runTest, "Test " + name + " was ignored");
|
||||
executeTest(spec);
|
||||
}
|
||||
}
|
||||
@@ -1417,6 +1417,11 @@
|
||||
<sha256 value="1c67818ff9ad052f2da636c1f2e99fbb801191e56af9f1ee1ebe3997039d8186" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="ethereum" name="execution-spec-tests" version="2.1.1">
|
||||
<artifact name="execution-spec-tests-2.1.1-fixtures.tar.gz">
|
||||
<sha256 value="817ca59a93dae2cd6458f015dfbc604d234bcbeca63ffe763bd5b5e27ff3c1a1" 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"/>
|
||||
|
||||
Reference in New Issue
Block a user