[MINOR] delayed submodule check until submodule used

Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
pull/2/head
Chris Mckay 6 years ago committed by GitHub
parent 924bbefb0d
commit 005bf5037b
  1. 12
      build.gradle
  2. 23
      ethereum/core/build.gradle
  3. 15
      ethereum/rlp/build.gradle
  4. 11
      ethereum/trie/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' apply plugin: 'net.researchgate.release'
task releaseIntegrationTest(type: Test){ 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') {} task releaseAcceptanceTest(type: Test, dependsOn : ':acceptance-tests:acceptanceTest') {}

@ -62,6 +62,7 @@ test {
exclude 'tech/pegasys/pantheon/ethereum/vm/**ReferenceTest.class' exclude 'tech/pegasys/pantheon/ethereum/vm/**ReferenceTest.class'
exclude 'tech/pegasys/pantheon/ethereum/vm/blockchain/**.class' exclude 'tech/pegasys/pantheon/ethereum/vm/blockchain/**.class'
exclude 'tech/pegasys/pantheon/ethereum/vm/generalstate/**.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) { 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 { task generalstateReferenceTestsSetup {
generateTestFiles( generateTestFiles(
fileTree("../referencetests/src/test/resources/GeneralStateTests"), fileTree("../referencetests/src/test/resources/GeneralStateTests"),
@ -128,8 +127,6 @@ task generalstateReferenceTestsSetup {
) )
} }
compileTestJava.dependsOn(generalstateReferenceTestsSetup)
task generalstateRegressionReferenceTestsSetup { task generalstateRegressionReferenceTestsSetup {
generateTestFiles( generateTestFiles(
fileTree("./src/test/resources/regressions/generalstate"), fileTree("./src/test/resources/regressions/generalstate"),
@ -141,8 +138,6 @@ task generalstateRegressionReferenceTestsSetup {
) )
} }
compileTestJava.dependsOn(generalstateRegressionReferenceTestsSetup)
task cleanupReferenceTests(type: Delete) { task cleanupReferenceTests(type: Delete) {
delete fileTree("./src/test/java/tech/pegasys/pantheon/ethereum/vm/generalstate/") { delete fileTree("./src/test/java/tech/pegasys/pantheon/ethereum/vm/generalstate/") {
include("**/GeneralStateReferenceTest*.java") include("**/GeneralStateReferenceTest*.java")
@ -153,12 +148,26 @@ task cleanupReferenceTests(type: Delete) {
clean.dependsOn(cleanupReferenceTests) 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 scanForTestClasses = false
enableAssertions = true enableAssertions = true
include 'tech/pegasys/pantheon/ethereum/vm/**ReferenceTest.class' include 'tech/pegasys/pantheon/ethereum/vm/**ReferenceTest.class'
include 'tech/pegasys/pantheon/ethereum/vm/blockchain/**.class' include 'tech/pegasys/pantheon/ethereum/vm/blockchain/**.class'
include 'tech/pegasys/pantheon/ethereum/vm/generalstate/**.class' include 'tech/pegasys/pantheon/ethereum/vm/generalstate/**.class'
include 'tech/pegasys/pantheon/ethereum/core/TransactionTest.class'
} }
artifacts { artifacts {

@ -37,3 +37,18 @@ dependencies {
testImplementation 'com.fasterxml.jackson.core:jackson-databind' testImplementation 'com.fasterxml.jackson.core:jackson-databind'
testImplementation 'junit:junit' 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'
}

@ -37,3 +37,14 @@ dependencies {
testImplementation 'org.mockito:mockito-core' testImplementation 'org.mockito:mockito-core'
testImplementation 'org.assertj:assertj-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'
}

Loading…
Cancel
Save