blob: dd2332ebbe3a63ac44b161955bc52a936c161475 [file] [log] [blame]
apply plugin: 'scala'
apply plugin: 'eclipse'
compileTestScala.options.encoding = 'UTF-8'
repositories {
mavenCentral()
maven {
url 'https://oss.sonatype.org/content/repositories/snapshots/'
}
}
sourceSets {
test {
scala {
srcDirs = ['src/']
}
}
}
tasks.withType(Test) {
systemProperty 'testthreads', System.getProperty('testthreads', '1')
testLogging {
events "passed", "skipped", "failed"
showStandardStreams = true
exceptionFormat = 'full'
}
outputs.upToDateWhen { false } // force tests to run every time
}
task testLean(type: Test) {
exclude '**/*Swift*'
exclude '**/*Python*'
exclude '**/*ThrottleTests*'
exclude '**/MaxActionDurationTests*'
}
// Add all images needed for local testing here
test.dependsOn([
':core:nodejsAction:distDocker',
':core:nodejs6Action:distDocker',
':core:actionProxy:distDocker',
':core:pythonAction:distDocker',
':core:javaAction:distDocker',
':core:swiftAction:distDocker',
':core:swift3Action:distDocker',
':sdk:docker:distDocker',
':tests:dat:blackbox:badaction:distDocker',
':tests:dat:blackbox:badproxy:distDocker'
])
dependencies {
testCompile "org.scala-lang:scala-library:${gradle.scala.version}"
testCompile 'org.apache.commons:commons-exec:1.1'
testCompile 'org.apache.commons:commons-lang3:3.3.2'
testCompile 'org.apache.httpcomponents:httpclient:4.5.2:tests'
testCompile 'commons-logging:commons-logging:1.1.3'
testCompile 'org.codehaus.groovy:groovy:2.4.3'
testCompile 'org.codehaus.groovy:groovy-json:2.4.3'
testCompile 'org.codehaus.groovy:groovy-xml:2.4.3'
testCompile 'com.google.guava:guava:18.0'
testCompile 'org.hamcrest:hamcrest-core:1.3'
testCompile 'org.apache.httpcomponents:httpmime:4.3.6'
testCompile 'junit:junit:4.11'
testCompile 'com.jayway.restassured:rest-assured:2.4.1'
testCompile 'org.scalatest:scalatest_2.11:2.2.4'
testCompile 'org.seleniumhq.selenium:selenium-java:2.45.0'
testCompile 'io.spray:spray-testkit_2.11:1.3.3'
testCompile 'com.google.code.tempus-fugit:tempus-fugit:1.2-SNAPSHOT'
testCompile 'com.google.code.gson:gson:2.3.1'
testCompile project(':common:scala')
testCompile project(':core:controller')
testCompile project(':core:invoker')
}
tasks.withType(ScalaCompile) {
scalaCompileOptions.additionalParameters = gradle.scala.compileFlags
}
def keystorePath = new File(buildDir, 'classes/test/keystore')
task deleteKeystore(type: Delete) {
delete keystorePath
}
task createKeystore(dependsOn: deleteKeystore) {
doLast {
Properties props = new Properties()
props.load(new FileInputStream(file('../whisk.properties')))
def cmd = ['keytool', '-import', '-alias', 'Whisk', '-noprompt', '-trustcacerts', '-file', file(props['whisk.ssl.cert']), '-keystore', keystorePath, '-storepass', 'openwhisk']
cmd.execute().waitForProcessOutput(System.out, System.err)
}
}
compileTestScala.finalizedBy createKeystore