Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -220,13 +220,41 @@ artifacts {
archives javadocJar
}

List<TestDescriptor> failedTests = []

test {
testLogging {
events "FAILED", "SKIPPED"
exceptionFormat = "FULL"
}

afterTest { TestDescriptor descriptor, TestResult result ->
if (result.getFailedTestCount() > 0) {
failedTests.add(descriptor)
}
}
}

/*
* The gradle.buildFinished callback is deprecated BUT there does not seem to be a decent alternative in gradle 7
* So progress over perfection here
*
* See https://github.com/gradle/gradle/issues/20151
*/
gradle. buildFinished {
if (!failedTests.isEmpty()) {
println "\n\n"
println "============================"
println "These are the test failures"
println "============================"
for (td in failedTests) {
println "${td.getClassName()}.${td.getDisplayName()}"
}
println "============================"
}
}


allprojects {
tasks.withType(Javadoc) {
exclude('**/antlr/**')
Expand Down
27 changes: 27 additions & 0 deletions src/test/groovy/graphql/AlwaysFailsTest.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package graphql

import spock.lang.Ignore
import spock.lang.Specification

/**
* This is only really useful for testing the gradle builds etc...
* and in general would not be needed to test graphql-java
*/
@Ignore
class AlwaysFailsTest extends Specification{

def "this test fails"() {
when:
true
then:
assert false
}

def "and this test always fails"() {
when:
true
then:
assert false
}

}