summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--uitest/src/com/vaadin/tests/tb3/ScreenshotTB3Test.java8
-rw-r--r--uitest/tb3test.xml9
-rw-r--r--uitest/test.xml12
3 files changed, 23 insertions, 6 deletions
diff --git a/uitest/src/com/vaadin/tests/tb3/ScreenshotTB3Test.java b/uitest/src/com/vaadin/tests/tb3/ScreenshotTB3Test.java
index 7f19a76ed6..94bcebde84 100644
--- a/uitest/src/com/vaadin/tests/tb3/ScreenshotTB3Test.java
+++ b/uitest/src/com/vaadin/tests/tb3/ScreenshotTB3Test.java
@@ -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']");
+ }
}
};
diff --git a/uitest/tb3test.xml b/uitest/tb3test.xml
index 92008ff9f3..de69e0ebe6 100644
--- a/uitest/tb3test.xml
+++ b/uitest/tb3test.xml
@@ -19,12 +19,21 @@
<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>
diff --git a/uitest/test.xml b/uitest/test.xml
index 88b5238c09..c534d676b9 100644
--- a/uitest/test.xml
+++ b/uitest/test.xml
@@ -134,12 +134,18 @@
</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">