Bump execution spec tests, reprise (#7056)

* execution-spec-tests generate state and blockchain tests separately

Signed-off-by: garyschulte <garyschulte@gmail.com>
pull/7058/head
garyschulte 7 months ago committed by GitHub
parent 45b6c0895f
commit 5656c5555a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      .github/workflows/reference-tests.yml
  2. 19
      ethereum/referencetests/build.gradle
  3. 37
      ethereum/referencetests/src/reference-test/templates/ExecutionSpecStateTest.java.template
  4. 36
      ethereum/referencetests/src/reference-test/templates/ExecutionSpecTest.java.template
  5. 5
      gradle/verification-metadata.xml

@ -41,7 +41,7 @@ jobs:
with: with:
cache-disabled: true cache-disabled: true
- name: execute generate reference tests - 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 - name: list test files generated
run: find ethereum/referencetests/build/generated/sources/reference-test -name "*.java" | sort >> filenames.txt run: find ethereum/referencetests/build/generated/sources/reference-test -name "*.java" | sort >> filenames.txt
- name: Split tests - name: Split tests

@ -80,13 +80,22 @@ def executionSpecTests = tasks.register("executionSpecTests") {
inputs.files fileTree(referenceTestsPath), fileTree(generatedTestsPath) inputs.files fileTree(referenceTestsPath), fileTree(generatedTestsPath)
outputs.files generatedTestsPath outputs.files generatedTestsPath
// generate blockchain_tests:
generateTestFiles( generateTestFiles(
fileTree(referenceTestsPath + "/fixtures"), fileTree(referenceTestsPath + "/fixtures/blockchain_tests"),
file("src/reference-test/templates/BlockchainReferenceTest.java.template"), file("src/reference-test/templates/ExecutionSpecTest.java.template"),
"fixtures",
"$generatedTestsPath/org/hyperledger/besu/ethereum/vm/executionspec",
"ExecutionSpecBlockchainTest"
)
// generate state_tests:
generateTestFiles(
fileTree(referenceTestsPath + "/fixtures/state_tests"),
file("src/reference-test/templates/ExecutionSpecStateTest.java.template"),
"fixtures", "fixtures",
"$generatedTestsPath/org/hyperledger/besu/ethereum/vm/executionspec", "$generatedTestsPath/org/hyperledger/besu/ethereum/vm/executionspec",
"ExecutionSpecTest", "ExecutionSpecStateTest"
("fixtures/example/example") // exclude test for test filling tool
) )
} }
@ -170,7 +179,7 @@ dependencies {
referenceTestImplementation project(path: ':testutil') referenceTestImplementation project(path: ':testutil')
referenceTestImplementation project(path: ':util') referenceTestImplementation project(path: ':util')
// the following will be resolved via custom ivy repository declared in root build.gradle // 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.fasterxml.jackson.core:jackson-databind'
referenceTestImplementation 'com.google.guava:guava' referenceTestImplementation 'com.google.guava:guava'
referenceTestImplementation 'io.tmio:tuweni-bytes' 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"/> <sha256 value="1c67818ff9ad052f2da636c1f2e99fbb801191e56af9f1ee1ebe3997039d8186" origin="Generated by Gradle"/>
</artifact> </artifact>
</component> </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"> <component group="info.picocli" name="picocli" version="3.0.0">
<artifact name="picocli-3.0.0.jar"> <artifact name="picocli-3.0.0.jar">
<sha256 value="22dbbe287dd0ab9d4d519ac9f2dd909537b6daf279ac5962a3bad8c9dae61032" origin="Generated by Gradle"/> <sha256 value="22dbbe287dd0ab9d4d519ac9f2dd909537b6daf279ac5962a3bad8c9dae61032" origin="Generated by Gradle"/>

Loading…
Cancel
Save