@@ -29,46 +29,23 @@ class LoggedExecFuncTest extends AbstractGradleFuncTest {
2929 """
3030 }
3131
32- @Unroll
33- def " can configure spooling #spooling" () {
34- setup :
35- buildFile << """
36- import org.elasticsearch.gradle.LoggedExec
37- tasks.register('loggedExec', LoggedExec) {
38- commandLine 'ls', '-lh'
39- getSpoolOutput().set($spooling )
40- }
41- """
42- when :
43- def result = gradleRunner(" loggedExec" ). build()
44- then :
45- result. task(' :loggedExec' ). outcome == TaskOutcome . SUCCESS
46- file(" build/buffered-output/loggedExec" ). exists() == spooling
47- where :
48- spooling << [false , true ]
49- }
5032
51- @Unroll
52- def " failed tasks output logged to console when spooling #spooling" () {
33+ def " failed tasks output logged to console" () {
5334 setup :
5435 buildFile << """
5536 import org.elasticsearch.gradle.LoggedExec
5637 tasks.register('loggedExec', LoggedExec) {
5738 commandLine 'ls', 'wtf'
58- getSpoolOutput().set($spooling )
5939 }
6040 """
6141 when :
6242 def result = gradleRunner(" loggedExec" ). buildAndFail()
6343 then :
6444 result. task(' :loggedExec' ). outcome == TaskOutcome . FAILED
65- file(" build/buffered-output/loggedExec" ). exists() == spooling
6645 assertOutputContains(result. output, """ \
6746 > Task :loggedExec FAILED
6847 Output for ls:""" . stripIndent())
6948 assertOutputContains(result. output, " No such file or directory" )
70- where :
71- spooling << [false , true ]
7249 }
7350
7451 def " can capture output" () {
@@ -91,27 +68,6 @@ class LoggedExecFuncTest extends AbstractGradleFuncTest {
9168 result. getOutput(). contains(" OUTPUT HELLO" )
9269 }
9370
94- def " capturing output with spooling enabled is not supported" () {
95- setup :
96- buildFile << """
97- import org.elasticsearch.gradle.LoggedExec
98- tasks.register('loggedExec', LoggedExec) {
99- commandLine 'echo', 'HELLO'
100- getCaptureOutput().set(true)
101- getSpoolOutput().set(true)
102- }
103- """
104- when :
105- def result = gradleRunner(" loggedExec" ). buildAndFail()
106- then :
107- result. task(' :loggedExec' ). outcome == TaskOutcome . FAILED
108- assertOutputContains(result. output, ''' \
109- FAILURE: Build failed with an exception.
110-
111- * What went wrong:
112- Execution failed for task ':loggedExec'.
113- > Capturing output is not supported when spoolOutput is true.''' . stripIndent())
114- }
11571
11672
11773 def " can configure output indenting" () {
0 commit comments