-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathintegrationTest.gradle
76 lines (63 loc) · 2.76 KB
/
integrationTest.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
sourceSets{
integrationTest {
java{
srcDirs = ['src/integration-test/java']
}
resources{
srcDirs = ['src/integration-test/resources']
}
groovy{
srcDirs = ['src/integration-test/groovy']
}
compileClasspath += project.sourceSets.main.output
runtimeClasspath += project.sourceSets.main.output
}
}
configurations {
integrationTestImplementation.extendsFrom testImplementation
integrationTestRuntimeOnly.extendsFrom runtimeOnly
}
task integrationTest(type: Test, group: "verification", description: "Runs integration tests using live LND node."){
doFirst{
def host = project.hasProperty("lightningj.integration.test.lnd.host") ? project.property("lightningj.integration.test.lnd.host") : null
def port = project.hasProperty("lightningj.integration.test.lnd.port") ? project.property("lightningj.integration.test.lnd.port") : null
def tlsCert = project.hasProperty("lightningj.integration.test.lnd.tlscertpath") ? project.property("lightningj.integration.test.lnd.tlscertpath") : null
def macaroon = project.hasProperty("lightningj.integration.test.lnd.macaroonpath") ? project.property("lightningj.integration.test.lnd.macaroonpath") : null
if(!host || !port || !tlsCert || !macaroon){
println """LND Settings missing in gradle properies. Please update with following properties:
lightningj.integration.test.lnd.host=<host to connect to>
lightningj.integration.test.lnd.port=<port>
lightningj.integration.test.lnd.tlscertpath=<Path to TLS Cert>
lightningj.integration.test.lnd.macaroonpath=<Path to Macaroon>
"""
System.exit(-1)
}else{
println """Using LND Settings:
host : ${host}
port : ${port}
Path to TLS Cert : ${tlsCert}
Path to Macaroon : ${macaroon}
"""
systemProperty "lightningj.integration.test.lnd.host",host
systemProperty "lightningj.integration.test.lnd.port",port
systemProperty "lightningj.integration.test.lnd.tlscertpath",tlsCert
systemProperty "lightningj.integration.test.lnd.macaroonpath",macaroon
}
}
testClassesDirs = project.sourceSets.integrationTest.output.classesDirs
classpath = project.sourceSets.integrationTest.runtimeClasspath
useJUnitPlatform()
dependsOn(compileWrapperMessages)
}
integrationTest.shouldRunAfter test
/*
Task for specifying for Intellij which source directories to use.
*/
idea {
module {
testSourceDirs += file('src/integration-test/java')
testSourceDirs += file('src/integration-test/groovy')
//testResourceDirs += file('src/integration-test/resources')
contentRoot = project.projectDir
}
}