]> source.dussan.org Git - vaadin-framework.git/commitdiff
Only print testbench failure TeamCity messages when running in TC
authorJohn Ahlroos <john@vaadin.com>
Mon, 30 Sep 2013 11:45:43 +0000 (14:45 +0300)
committerVaadin Code Review <review@vaadin.com>
Wed, 2 Oct 2013 08:05:35 +0000 (08:05 +0000)
Change-Id: Ifa04ce512743bc8ccddea0bdca7b82cceaff150e

uitest/src/com/vaadin/tests/tb3/ScreenshotTB3Test.java
uitest/tb3test.xml
uitest/test.xml

index 7f19a76ed6fd352cad3f945bf090cf0d03ab977e..94bcebde84b5c063a7b67642a2f39b98752f53db 100644 (file)
@@ -72,9 +72,11 @@ public abstract class ScreenshotTB3Test extends AbstractTB3Test {
         protected void failed(Throwable e, Description description) {
 
             // Notify Teamcity of failed test
-            System.out.print("##teamcity[publishArtifacts '");
-            System.out.println(getScreenshotErrorBaseName()
-                    + "* => screenshot-errors']");
+            if (!System.getProperty("teamcity.version", "").equals("")) {
+                System.out.print("##teamcity[publishArtifacts '");
+                System.out.println(getScreenshotErrorBaseName()
+                        + "* => screenshot-errors']");
+            }
         }
     };
 
index 92008ff9f3c7534a853fff5f279ae19d6de62b82..de69e0ebe6342e407253e458c480fbe64a66caa4 100644 (file)
     <target name="run-tb3-suite">
         <fail unless="junit.test.suite" message="Define suite to run using junit.test.suite" />
         <fail unless="com.vaadin.testbench.screenshot.directory" message="Define screenshot directory using -Dcom.vaadin.testbench.screenshot.directory" />
+
+        <!-- Ensure teamcity.version is set to something -->
+        <condition property="teamcity.version" value="">
+            <not>
+                 <isset property="teamcity.version" />
+            </not>
+        </condition>
+
         <junit printsummary="withOutAndErr" fork="yes">
             <formatter usefile="false" type="plain" />
             <classpath refid="classpath.tb3" />
 
             <jvmarg value="-Dcom.vaadin.testbench.screenshot.directory=${com.vaadin.testbench.screenshot.directory}" />
             <jvmarg value="-Djava.awt.headless=true" />
+            <jvmarg value="-Dteamcity.version=${teamcity.version}" />
             <test name="${junit.test.suite}" />
         </junit>
 
index 88b5238c092030a410a36d9f2466b81c70b436a6..c534d676b9b46fbb42f989d73db8377d716f5245 100644 (file)
             </batchtest>
         </junit>
 
-        <!-- Have teamcity publish each test error artifact immediatly if there are any -->
-        <basename property="basename" file="${target}" suffix="java" />
-        <echo>##teamcity[publishArtifacts '${com.vaadin.testbench.screenshot.directory}/errors/${basename}* => screenshot-errors']</echo>
+        <antcall target="notify-teamcity-of-build-artifact">
+            <param name="file" value="${target}" />
+        </antcall>
 
     </target>
 
+       <!-- Have teamcity publish each test error artifact immediatly if there are any -->
+       <target name="notify-teamcity-of-build-artifact" if="teamcity.version">
+           <basename property="basename" file="${file}" suffix="java" />
+           <echo>##teamcity[publishArtifacts '${com.vaadin.testbench.screenshot.directory}/errors/${basename}* => screenshot-errors']</echo>
+       </target>
+
     <!-- Remove temporary source and compiled java files -->
     <target name="remove-temp-testclasses">
         <delete failonerror="false">