Skip to content

Commit

Permalink
Add reproducer for "Unable to make progress running work" with --cont…
Browse files Browse the repository at this point in the history
…inue
  • Loading branch information
wolfs authored and ghale committed Jan 10, 2023
1 parent 21b74bc commit e529a26
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
Expand Up @@ -137,6 +137,7 @@ abstract class AbstractCommandLineOrderTaskIntegrationTest extends AbstractInteg
final Set<String> localState = []
final Set<String> inputFiles = []
boolean shouldBlock
String failMessage

TaskFixture(ProjectFixture project, String path) {
this.project = project
Expand Down Expand Up @@ -206,6 +207,11 @@ abstract class AbstractCommandLineOrderTaskIntegrationTest extends AbstractInteg
return this
}

TaskFixture fail(String message = 'BOOM') {
failMessage = message
return this
}

String getConfig() {
return """
tasks.register('${name}') {
Expand All @@ -219,6 +225,7 @@ abstract class AbstractCommandLineOrderTaskIntegrationTest extends AbstractInteg
${inputFiles.collect { 'inputs.files ' + it }.join('\n\t\t\t\t')}
doLast {
${shouldBlock ? server.callFromTaskAction(path) : ''}
${failMessage ? "throw new RuntimeException('$failMessage')" : ''}
}
}
""".stripIndent()
Expand Down
Expand Up @@ -16,7 +16,6 @@

package org.gradle.api


import org.gradle.integtests.fixtures.executer.TaskOrderSpecs
import spock.lang.Issue

Expand Down Expand Up @@ -448,4 +447,20 @@ class DestroyerTaskCommandLineOrderIntegrationTest extends AbstractCommandLineOr
where:
type << ProductionType.values()
}
def "build finishes with --continue even when producer task fails"() {
def clean = rootBuild.task('clean').destroys('build')
def compileJava = rootBuild.task('compileJava').outputs('build/classes/java').fail()
def compileGroovy = rootBuild.task('compileGroovy').outputs('build/classes/groovy').dependsOn(compileJava)
def classes = rootBuild.task('classes').dependsOn(compileJava).dependsOn(compileGroovy)
writeAllFiles()
when:
fails(clean.path, classes.path, '--continue')
then:
failure.assertHasDescription("Execution failed for task ':compileJava'.")
failure.assertHasFailures(1)
outputDoesNotContain('Unable to make progress running work.')
}
}

0 comments on commit e529a26

Please sign in to comment.