]> source.dussan.org Git - vaadin-framework.git/commitdiff
Publish error artifacts immediatly in TeamCity
authorJohn Ahlroos <john@vaadin.com>
Wed, 25 Sep 2013 10:51:23 +0000 (13:51 +0300)
committerVaadin Code Review <review@vaadin.com>
Fri, 27 Sep 2013 06:30:06 +0000 (06:30 +0000)
Change-Id: I69cb2208b7f6b3263ddb25fa26eebebcc6f9a7c3

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

index 645d9cd0cb276a0b21a4c680621e62be6cc678de..565d04fdb9a56577fcc2eeff28c537f016b9055c 100644 (file)
@@ -31,6 +31,7 @@ import org.junit.Before;
 import org.junit.Rule;
 import org.junit.rules.TestRule;
 import org.junit.rules.TestWatcher;
+import org.junit.runner.Description;
 import org.openqa.selenium.OutputType;
 import org.openqa.selenium.TakesScreenshot;
 import org.openqa.selenium.remote.DesiredCapabilities;
@@ -65,7 +66,16 @@ public abstract class ScreenshotTB3Test extends AbstractTB3Test {
             }
 
             screenshotBaseName = className + "-" + testMethod;
-        };
+        }
+
+        @Override
+        protected void failed(Throwable e, Description description) {
+
+            // Notify Teamcity of failed test
+            System.out.print("##teamcity[publishArtifacts '");
+            System.out.println(getScreenshotErrorDirectory() + "/"
+                    + getScreenshotBaseName() + "* => screenshot-errors']");
+        }
     };
 
     /**
index dd6964e59c2f4bbbf337c30f19b7565d1520f058..88b5238c092030a410a36d9f2466b81c70b436a6 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>
+
     </target>
 
     <!-- Remove temporary source and compiled java files -->