Ticket #189 (closed defect: worksforme)
phingcall does return build failed correctly
| Reported by: | anonymous | Owned by: | mrook |
|---|---|---|---|
| Priority: | major | Milestone: | 2.4.0RC1 |
| Component: | phing-core | Version: | 2.3.0 |
| Keywords: | Cc: |
Description
When trying to group several (test) tasks into one task using phingcall then failures in called targets are ignored in the main task. When a subtask fails the build still finished successfully.
Attachments
Change History
comment:2 Changed 4 years ago by jason.mcclellan@…
I would expect that if a target I call using phingcall fails then the entire build would fail.
In my current setup, for example, I have to run my unit tests via phingcall because if run within the current instance of phing I get session errors because of output already having been started previously in the build. So, if I fork with phingcall this solves the problem. However, if my tests fail, I still want the build to fail.
Is there some way this could be an option for phingcall?
comment:3 Changed 3 years ago by mrook
- Owner changed from hans to mrook
- Status changed from new to assigned
One solution would be to add a 'haltonfailure' option to the phingcall task.
comment:4 Changed 3 years ago by mrook
- Status changed from assigned to closed
- Resolution set to worksforme
Could you provide me a build file to help reproduce this?
The following build file:
<project name="FooBar" default="main" basedir=".">
<target name="failingtask">
<fail>test</fail>
</target>
<target name="main">
<phingcall target="failingtask"/>
</target>
</project>
produces:
FooBar > main: [phingcall] Calling Buildfile '/home/druid/dev/phing_tests/189/build.xml' with target 'failingtask' FooBar > failingtask: Execution of target "failingtask" failed for the following reason: /home/druid/dev/phing_tests/189/build.xml:5:8: test [phingcall] /home/druid/dev/phing_tests/189/build.xml:5:8: test Execution of target "main" failed for the following reason: /home/druid/dev/phing_tests/189/build.xml:9:20: Execution of the target buildfile failed. Aborting. BUILD FAILED /home/druid/dev/phing_tests/189/build.xml:9:20: Execution of the target buildfile failed. Aborting. Total time: 0.1789 seconds

I'm not sure what the expected behavior would be here. Should the entire build fail immediately if one of the foreach loops fails? Or should it only fail the build after the foreach has been run?