Skip to content
This repository has been archived by the owner on Sep 26, 2019. It is now read-only.

Commit

Permalink
[MINOR] delayed submodule check until submodule used
Browse files Browse the repository at this point in the history
  • Loading branch information
Errorific authored Oct 24, 2018
1 parent c9fbc9d commit 6584168
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 14 deletions.
12 changes: 5 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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){
Expand All @@ -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') {}
Expand Down
23 changes: 16 additions & 7 deletions ethereum/core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -115,8 +116,6 @@ task blockchainReferenceTestsSetup {
)
}

compileTestJava.dependsOn(blockchainReferenceTestsSetup)

task generalstateReferenceTestsSetup {
generateTestFiles(
fileTree("../referencetests/src/test/resources/GeneralStateTests"),
Expand All @@ -128,8 +127,6 @@ task generalstateReferenceTestsSetup {
)
}

compileTestJava.dependsOn(generalstateReferenceTestsSetup)

task generalstateRegressionReferenceTestsSetup {
generateTestFiles(
fileTree("./src/test/resources/regressions/generalstate"),
Expand All @@ -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")
Expand All @@ -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 {
Expand Down
15 changes: 15 additions & 0 deletions ethereum/rlp/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
11 changes: 11 additions & 0 deletions ethereum/trie/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}

0 comments on commit 6584168

Please sign in to comment.