Skip to content

Commit e0ace1d

Browse files
authored
Merge pull request #8693 from sdedic/nbbuild/failing-test-in-suite
Support for ENABLING test failures when testing a module suite
2 parents e4ceafd + ab67ac2 commit e0ace1d

File tree

1 file changed

+24
-17
lines changed

1 file changed

+24
-17
lines changed

nbbuild/templates/common.xml

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -749,7 +749,14 @@
749749
<test test.type="qa-functional"/>
750750
</target>
751751

752-
<target name="-do-junit" depends="test-init">
752+
<target name="-setup-continue-after-failing">
753+
<!-- The -do.continue... property is used in unless= context, so it must be defined only if the user property is set to true -->
754+
<condition property="-do.continue.after.failing.tests">
755+
<istrue value="${continue.after.failing.tests}"/>
756+
</condition>
757+
</target>
758+
759+
<target name="-do-junit" depends="test-init,-setup-continue-after-failing">
753760
<property name="test.jms.flags" value=""/>
754761
<macrodef name="junit-impl">
755762
<attribute name="test.type"/>
@@ -770,13 +777,13 @@
770777
<formatter type="brief" usefile="false"/>
771778
<formatter type="xml"/>
772779
</junit>
773-
<fail if="tests.failed" unless="continue.after.failing.tests">Some tests failed; see details above.</fail>
774-
</sequential>
780+
<fail if="tests.failed" unless="-do.continue.after.failing.tests">Some tests failed; see details above.</fail>
781+
</sequential>
775782
</macrodef>
776783
<junit-impl test.type="${run.test.type}" disable.apple.ui="${disable.apple.ui}"/>
777784
</target>
778785

779-
<target name="-do-testng" depends="test-init">
786+
<target name="-do-testng" depends="test-init,-setup-continue-after-failing">
780787
<macrodef name="testng-impl">
781788
<attribute name="test.type"/>
782789
<attribute name="disable.apple.ui" default="false"/>
@@ -799,7 +806,7 @@
799806
<!-- needed to have tests NOT to steal focus when running, works in latest apple jdk update only.-->
800807
<sysproperty key="apple.awt.UIElement" value="@{disable.apple.ui}"/>
801808
</testng>
802-
<fail if="tests.failed" unless="continue.after.failing.tests">Some tests failed; see details above.</fail>
809+
<fail if="tests.failed" unless="-do.continue.after.failing.tests">Some tests failed; see details above.</fail>
803810
</sequential>
804811
</macrodef>
805812
<testng-impl test.type="${run.test.type}" disable.apple.ui="${disable.apple.ui}"/>
@@ -854,7 +861,7 @@
854861
<test-single test.type="${test.type}"/>
855862
</target>
856863

857-
<target name="-do-junit-single" depends="test-init">
864+
<target name="-do-junit-single" depends="test-init,-setup-continue-after-failing">
858865
<macrodef name="junit-impl">
859866
<attribute name="test.type"/>
860867
<sequential>
@@ -872,13 +879,13 @@
872879
<formatter type="brief" usefile="false"/>
873880
<formatter type="xml"/>
874881
</junit>
875-
<fail if="tests.failed" unless="continue.after.failing.tests">Some tests failed; see details above.</fail>
882+
<fail if="tests.failed" unless="-do.continue.after.failing.tests">Some tests failed; see details above.</fail>
876883
</sequential>
877884
</macrodef>
878885
<junit-impl test.type="${test.type}" />
879886
</target>
880887

881-
<target name="-do-testng-single" depends="test-init">
888+
<target name="-do-testng-single" depends="test-init,-setup-continue-after-failing">
882889
<macrodef name="testng-impl">
883890
<attribute name="test.type"/>
884891
<sequential>
@@ -901,13 +908,13 @@
901908
<!-- needed to have tests NOT to steal focus when running, works in latest apple jdk update only.-->
902909
<sysproperty key="apple.awt.UIElement" value="@{disable.apple.ui}"/>
903910
</testng>
904-
<fail if="tests.failed" unless="continue.after.failing.tests">Some tests failed; see details above.</fail>
911+
<fail if="tests.failed" unless="-do.continue.after.failing.tests">Some tests failed; see details above.</fail>
905912
</sequential>
906913
</macrodef>
907914
<testng-impl test.type="${test.type}"/>
908915
</target>
909916

910-
<target name="-do-testng-single-suite" depends="test-init">
917+
<target name="-do-testng-single-suite" depends="test-init,-setup-continue-after-failing">
911918
<macrodef name="testng-impl">
912919
<attribute name="test.type"/>
913920
<sequential>
@@ -930,7 +937,7 @@
930937
<!-- needed to have tests NOT to steal focus when running, works in latest apple jdk update only.-->
931938
<sysproperty key="apple.awt.UIElement" value="@{disable.apple.ui}"/>
932939
</testng>
933-
<fail if="tests.failed" unless="continue.after.failing.tests">Some tests failed; see details above.</fail>
940+
<fail if="tests.failed" unless="-do.continue.after.failing.tests">Some tests failed; see details above.</fail>
934941
</sequential>
935942
</macrodef>
936943
<testng-impl test.type="${test.type}"/>
@@ -1022,7 +1029,7 @@
10221029
<testng-impl test.type="${test.type}"/>
10231030
</target>
10241031

1025-
<target name="-do-testng-debug-single-suite" depends="test-init">
1032+
<target name="-do-testng-debug-single-suite" depends="test-init,-setup-continue-after-failing">
10261033
<macrodef name="testng-impl">
10271034
<attribute name="test.type"/>
10281035
<sequential>
@@ -1046,7 +1053,7 @@
10461053
<!-- needed to have tests NOT to steal focus when running, works in latest apple jdk update only.-->
10471054
<sysproperty key="apple.awt.UIElement" value="@{disable.apple.ui}"/>
10481055
</testng>
1049-
<fail if="tests.failed" unless="continue.after.failing.tests">Some tests failed; see details above.</fail>
1056+
<fail if="tests.failed" unless="-do.continue.after.failing.tests">Some tests failed; see details above.</fail>
10501057
</sequential>
10511058
</macrodef>
10521059
<testng-impl test.type="${test.type}"/>
@@ -1094,7 +1101,7 @@
10941101
<test-method test.type="${test.type}"/>
10951102
</target>
10961103

1097-
<target name="-do-junit-testmethod" depends="test-init">
1104+
<target name="-do-junit-testmethod" depends="test-init,-setup-continue-after-failing">
10981105
<macrodef name="junit-impl">
10991106
<attribute name="test.type"/>
11001107
<sequential>
@@ -1109,13 +1116,13 @@
11091116
<formatter type="brief" usefile="false"/>
11101117
<formatter type="xml"/>
11111118
</junit>
1112-
<fail if="tests.failed" unless="continue.after.failing.tests">Some tests failed; see details above.</fail>
1119+
<fail if="tests.failed" unless="-do.continue.after.failing.tests">Some tests failed; see details above.</fail>
11131120
</sequential>
11141121
</macrodef>
11151122
<junit-impl test.type="${test.type}" />
11161123
</target>
11171124

1118-
<target name="-do-testng-testmethod" depends="test-init">
1125+
<target name="-do-testng-testmethod" depends="test-init,-setup-continue-after-failing">
11191126
<macrodef name="testng-impl">
11201127
<attribute name="test.type"/>
11211128
<sequential>
@@ -1137,7 +1144,7 @@
11371144
<!-- needed to have tests NOT to steal focus when running, works in latest apple jdk update only.-->
11381145
<sysproperty key="apple.awt.UIElement" value="@{disable.apple.ui}"/>
11391146
</testng>
1140-
<fail if="tests.failed" unless="continue.after.failing.tests">Some tests failed; see details above.</fail>
1147+
<fail if="tests.failed" unless="-do.continue.after.failing.tests">Some tests failed; see details above.</fail>
11411148
</sequential>
11421149
</macrodef>
11431150
<testng-impl test.type="${test.type}"/>

0 commit comments

Comments
 (0)