Skip to content
Snippets Groups Projects
Commit e7d7d16e authored by Nikolaus Krismer's avatar Nikolaus Krismer
Browse files

fixed problem with large test result files (using testNG reports now...

not keeping binary results anymore)
parent 49dc9f05
No related branches found
No related tags found
No related merge requests found
......@@ -93,8 +93,8 @@ dependencies {
testCompile 'org.testng:testng:6+'
}
// Adding support for compiler warnings generation
tasks.withType(Compile) {
// adds support for compiler warnings generation
options.compilerArgs << '-Xlint'
}
......@@ -160,6 +160,16 @@ eclipse {
}
}
eclipse.classpath.file {
// See: http://stackoverflow.com/questions/12836089/why-is-eclipse-not-attaching-3rd-party-libs-source-files-to-a-wtp-faceted-gradle
// Classpath entry for Eclipse which changes the order of classpathentries; otherwise no sources for 3rd party jars are shown
withXml { xml ->
def node = xml.asNode()
node.remove( node.find { it.@path == 'org.eclipse.jst.j2ee.internal.web.container' } )
node.appendNode( 'classpathentry', [ kind: 'con', path: 'org.eclipse.jst.j2ee.internal.web.container', exported: 'true'])
}
}
findbugs {
effort = "max"
ignoreFailures = true
......@@ -191,10 +201,25 @@ publishing {
test {
useTestNG()
options {
listeners << 'org.testng.reporters.XMLReporter'
}
//turn off Gradle's HTML report to avoid replacing the
//reports generated by TestNG library:
reports.junitXml.enabled = false
reports.html.enabled = false
ignoreFailures = true
}
test.doFirst {
// TestNG XMLReporter does not create reportDir (but would fail without it)
if (!project.testReportDir.isDirectory()) {
project.testReportDir.mkdirs()
}
}
vagrant {
boxDir = vagrantDir
provider = 'virtualbox'
......@@ -206,6 +231,13 @@ vagrantDestroy.doFirst {
}
}
// Custom task definitions
task cleanTestResults(type: Delete) {
// We only need the test reports... not the binary results
delete project.testResultsDir
}
task javadocJar(type: Jar, dependsOn: javadoc) {
description = 'Builds a jar file including javadoc'
from javadoc.destinationDir
......@@ -218,8 +250,6 @@ task jsDoc(type:com.eriwen.gradle.js.tasks.JsDocTask) {
destinationDir = file("${buildDir}/docs/jsdoc")
}
tasks.jsDoc.dependsOn tasks.processResources
task jsHint(type:com.eriwen.gradle.js.tasks.JsHintTask) {
jshint.options = [browser: true, expr: true, jquery: true, latedef: 'nofunc', quotmark: 'single', unused: true, undef: true, wsh: true]
jshint.predef = ['$': false, 'define': false, 'google': false, 'require': false]
......@@ -229,8 +259,6 @@ task jsHint(type:com.eriwen.gradle.js.tasks.JsHintTask) {
reporter = 'checkstyle'
}
tasks.jsHint.dependsOn tasks.processResources
task sourcesJar(type: Jar, dependsOn: classes) {
description = 'Builds a jar file including sources'
from sourceSets.main.allSource
......@@ -286,17 +314,14 @@ task vagrantPrepare << {
}
}
vagrantUp.dependsOn(vagrantPrepare)
// task dependencies
// See: http://stackoverflow.com/questions/12836089/why-is-eclipse-not-attaching-3rd-party-libs-source-files-to-a-wtp-faceted-gradle
eclipse.classpath.file {
// Classpath entry for Eclipse which changes the order of classpathentries; otherwise no sources for 3rd party jars are shown
withXml { xml ->
def node = xml.asNode()
node.remove( node.find { it.@path == 'org.eclipse.jst.j2ee.internal.web.container' } )
node.appendNode( 'classpathentry', [ kind: 'con', path: 'org.eclipse.jst.j2ee.internal.web.container', exported: 'true'])
}
}
tasks.jsDoc.dependsOn tasks.processResources
tasks.jsHint.dependsOn tasks.processResources
tasks.test.finalizedBy tasks.cleanTestResults
tasks.vagrantUp.dependsOn tasks.vagrantPrepare
// CI tasks
task jarAll(dependsOn: [jar, javadocJar, sourcesJar, staticJar])
task buildAll(dependsOn: [jarAll, build])
......
......@@ -5,9 +5,20 @@
<logger name="httpclient" level="WARN" />
<logger name="org.apache.commons.httpclient" level="WARN" />
<appender name="FILE" class="ch.qos.logback.core.FileAppender">
<file>build/test-results/logfile.txt</file>
<append>false</append>
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>build/reports/tests/logFile.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- daily rollover -->
<fileNamePattern>logFile.%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<!-- or whenever the file size reaches 100MB -->
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!-- keep 30 days' worth of history -->
<maxHistory>30</maxHistory>
</rollingPolicy>
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level [%thread] %logger: %message%n</pattern>
</encoder>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment