From 6584168b704352879648b2e27f71e29a53dfda78 Mon Sep 17 00:00:00 2001 From: Chris Mckay Date: Thu, 25 Oct 2018 08:01:02 +1000 Subject: [PATCH] [MINOR] delayed submodule check until submodule used --- build.gradle | 12 +++++------- ethereum/core/build.gradle | 23 ++++++++++++++++------- ethereum/rlp/build.gradle | 15 +++++++++++++++ ethereum/trie/build.gradle | 11 +++++++++++ 4 files changed, 47 insertions(+), 14 deletions(-) diff --git a/build.gradle b/build.gradle index f827e437c8..3c86f92713 100644 --- a/build.gradle +++ b/build.gradle @@ -383,12 +383,6 @@ configure(subprojects.findAll {it.name != 'errorprone-checks'}) { } } - -if (!file("ethereum/referencetests/src/test/resources/README.md").exists()) { - throw new GradleException("ethereum/referencetests/src/test/resources/README.md missing: please clone submodules (git submodule update --init --recursive)") -} - - apply plugin: 'net.researchgate.release' task releaseIntegrationTest(type: Test){ @@ -401,7 +395,11 @@ task releaseIntegrationTest(type: Test){ } } -task releaseReferenceTest(type: Test, dependsOn : ':ethereum:core:referenceTests'){ +task releaseReferenceTest(type: Test, dependsOn : [ + ':ethereum:core:referenceTests', + ':ethereum:rlp:referenceTests', + ':ethereum:trie:referenceTests' +]){ } task releaseAcceptanceTest(type: Test, dependsOn : ':acceptance-tests:acceptanceTest') {} diff --git a/ethereum/core/build.gradle b/ethereum/core/build.gradle index 165547b6b6..1996d47491 100644 --- a/ethereum/core/build.gradle +++ b/ethereum/core/build.gradle @@ -62,6 +62,7 @@ test { exclude 'tech/pegasys/pantheon/ethereum/vm/**ReferenceTest.class' exclude 'tech/pegasys/pantheon/ethereum/vm/blockchain/**.class' exclude 'tech/pegasys/pantheon/ethereum/vm/generalstate/**.class' + exclude 'tech/pegasys/pantheon/ethereum/core/TransactionTest.class' } def generateTestFiles(FileTree jsonPath, File resourcesPath, File templateFile, String pathstrip, String destination, String namePrefix) { @@ -115,8 +116,6 @@ task blockchainReferenceTestsSetup { ) } -compileTestJava.dependsOn(blockchainReferenceTestsSetup) - task generalstateReferenceTestsSetup { generateTestFiles( fileTree("../referencetests/src/test/resources/GeneralStateTests"), @@ -128,8 +127,6 @@ task generalstateReferenceTestsSetup { ) } -compileTestJava.dependsOn(generalstateReferenceTestsSetup) - task generalstateRegressionReferenceTestsSetup { generateTestFiles( fileTree("./src/test/resources/regressions/generalstate"), @@ -141,8 +138,6 @@ task generalstateRegressionReferenceTestsSetup { ) } -compileTestJava.dependsOn(generalstateRegressionReferenceTestsSetup) - task cleanupReferenceTests(type: Delete) { delete fileTree("./src/test/java/tech/pegasys/pantheon/ethereum/vm/generalstate/") { include("**/GeneralStateReferenceTest*.java") @@ -153,12 +148,26 @@ task cleanupReferenceTests(type: Delete) { clean.dependsOn(cleanupReferenceTests) -task referenceTests(type: Test, dependsOn: ["compileTestJava"]) { +task referenceTests(type: Test, dependsOn: [ + "blockchainReferenceTestsSetup", + "generalstateReferenceTestsSetup", + "generalstateRegressionReferenceTestsSetup", + "compileTestJava" +]) { + compileTestJava.mustRunAfter blockchainReferenceTestsSetup + compileTestJava.mustRunAfter generalstateReferenceTestsSetup + compileTestJava.mustRunAfter generalstateRegressionReferenceTestsSetup + doFirst { + if (!file("../referencetests/src/test/resources/README.md").exists()) { + throw new GradleException("ethereum/referencetests/src/test/resources/README.md missing: please clone submodules (git submodule update --init --recursive)") + } + } scanForTestClasses = false enableAssertions = true include 'tech/pegasys/pantheon/ethereum/vm/**ReferenceTest.class' include 'tech/pegasys/pantheon/ethereum/vm/blockchain/**.class' include 'tech/pegasys/pantheon/ethereum/vm/generalstate/**.class' + include 'tech/pegasys/pantheon/ethereum/core/TransactionTest.class' } artifacts { diff --git a/ethereum/rlp/build.gradle b/ethereum/rlp/build.gradle index 7562a0acd6..82ebe9c7c9 100644 --- a/ethereum/rlp/build.gradle +++ b/ethereum/rlp/build.gradle @@ -37,3 +37,18 @@ dependencies { testImplementation 'com.fasterxml.jackson.core:jackson-databind' testImplementation 'junit:junit' } + +test { + exclude 'tech/pegasys/pantheon/ethereum/rlp/InvalidRLPRefTest.class' + exclude 'tech/pegasys/pantheon/ethereum/rlp/RLPRefTest.class' +} + +task referenceTests(type: Test, dependsOn: ['compileTestJava']) { + doFirst { + if (!file("../referencetests/src/test/resources/README.md").exists()) { + throw new GradleException("ethereum/referencetests/src/test/resources/README.md missing: please clone submodules (git submodule update --init --recursive)") + } + } + include 'tech/pegasys/pantheon/ethereum/rlp/InvalidRLPRefTest.class' + include 'tech/pegasys/pantheon/ethereum/rlp/RLPRefTest.class' +} diff --git a/ethereum/trie/build.gradle b/ethereum/trie/build.gradle index 497a10e91c..9459b1d851 100644 --- a/ethereum/trie/build.gradle +++ b/ethereum/trie/build.gradle @@ -37,3 +37,14 @@ dependencies { testImplementation 'org.mockito:mockito-core' testImplementation 'org.assertj:assertj-core' } + +test { exclude 'tech/pegasys/pantheon/ethereum/trie/TrieRefTest.class' } + +task referenceTests(type: Test, dependsOn: ['compileTestJava']) { + doFirst { + if (!file("../referencetests/src/test/resources/README.md").exists()) { + throw new GradleException("ethereum/referencetests/src/test/resources/README.md missing: please clone submodules (git submodule update --init --recursive)") + } + } + include 'tech/pegasys/pantheon/ethereum/trie/TrieRefTest.class' +}