รายงานของ TeamCity Ant Junit 2 ข้ามไปเนื่องจากล้าสมัย

ฉันกำลังตั้งค่า TeamCity ให้สร้างบิลด์อัตโนมัติเมื่อฉันมุ่งมั่นที่จะพัฒนาบางอย่าง ปัญหาคือเมื่อพยายามสร้างบิลด์ ฉันได้รับข้อความ reports skipped as out-of-date

นี่คือ build.xml ของฉัน

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- WARNING: Eclipse auto-generated file.
              Any modifications will be overwritten.
              To include a user specific buildfile here, simply create one in the same
              directory with the processing instruction <?eclipse.ant.import?>
              as the first entry and export the buildfile again. -->
<project basedir="." default="build" name="RNS-Reader-v0.1">
    <property environment="env"/>
    <property name="ECLIPSE_HOME" value="../../../../../../../Applications/eclipse"/>
    <property name="junit.output.dir" value="junit"/>
    <property name="debuglevel" value="source,lines,vars"/>
    <property name="target" value="1.6"/>
    <property name="source" value="1.6"/>
    <path id="RNS-Reader-v0.1.classpath">
        <pathelement location="bin"/>
        <pathelement location="src/libraries/cron4j-2.2.5.jar"/>
        <pathelement location="src/libraries/dom4j-1.6.1.jar"/>
        <pathelement location="src/libraries/jaxen-1.1.3.jar"/>
        <pathelement location="src/libraries/joda-time-2.3.jar"/>
        <pathelement location="src/libraries/mysql-connector-java-5.1.25-bin.jar"/>
        <pathelement location="src/libraries/javax.mail.jar"/>
        <pathelement location="src/libraries/jsoup-1.7.3.jar"/>
        <pathelement location="src/libraries/commons-io-2.4.jar"/>
        <pathelement location="src/libraries/twitter4j-async-3.0.5.jar"/>
        <pathelement location="src/libraries/twitter4j-core-3.0.5.jar"/>
        <pathelement location="src/libraries/twitter4j-examples-3.0.5.jar"/>
        <pathelement location="src/libraries/twitter4j-media-support-3.0.5.jar"/>
        <pathelement location="src/libraries/twitter4j-stream-3.0.5.jar"/>
        <pathelement location="src/libraries/hamcrest-core-1.3.jar"/>
        <pathelement location="src/libraries/junit-4.11.jar"/>
    </path>
    <target name="init">
        <mkdir dir="bin"/>
        <copy includeemptydirs="false" todir="bin">
            <fileset dir="src">
                <exclude name="**/*.java"/>
            </fileset>
        </copy>
    </target>
    <target name="clean">
        <delete dir="bin"/>
    </target>
    <target depends="clean" name="cleanall"/>
    <target depends="build-subprojects,build-project" name="build"/>
    <target name="build-subprojects"/>
    <target depends="init" name="build-project">
        <echo message="${ant.project.name}: ${ant.file}"/>
        <javac debug="true" debuglevel="${debuglevel}" destdir="bin" includeantruntime="false" source="${source}" target="${target}">
            <src path="src"/>
            <classpath refid="RNS-Reader-v0.1.classpath"/>
        </javac>
    </target>
    <target description="Build all projects which reference this project. Useful to propagate changes." name="build-refprojects"/>
    <target description="copy Eclipse compiler jars to ant lib directory" name="init-eclipse-compiler">
        <copy todir="${ant.library.dir}">
            <fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/>
        </copy>
        <unzip dest="${ant.library.dir}">
            <patternset includes="jdtCompilerAdapter.jar"/>
            <fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/>
        </unzip>
    </target>
    <target description="compile project with Eclipse compiler" name="build-eclipse-compiler">
        <property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter"/>
        <antcall target="build"/>
    </target>
    <target name="RNSReader">
        <java classname="RNSReader" failonerror="true" fork="yes">
            <classpath refid="RNS-Reader-v0.1.classpath"/>
        </java>
    </target>
    <target name="SubscriberTest">
        <mkdir dir="${junit.output.dir}"/>
        <junit fork="yes" printsummary="withOutAndErr">
            <formatter type="xml"/>
            <test name="tests.domainObjectsTest.SubscriberTest" todir="${junit.output.dir}"/>
            <classpath refid="RNS-Reader-v0.1.classpath"/>
        </junit>
    </target>
    <target name="DayTradeTest">
        <mkdir dir="${junit.output.dir}"/>
        <junit fork="yes" printsummary="withOutAndErr">
            <formatter type="xml"/>
            <test name="tests.domainObjectsTest.DayTradeTest" todir="${junit.output.dir}"/>
            <classpath refid="RNS-Reader-v0.1.classpath"/>
        </junit>
    </target>
    <target name="junitreport">
        <junitreport todir="${junit.output.dir}">
            <fileset dir="${junit.output.dir}">
                <include name="TEST-*.xml"/>
            </fileset>
            <report format="frames" todir="${junit.output.dir}"/>
        </junitreport>
    </target>
</project>

และนี่คือผลลัพธ์ของฉัน

[10:09:12]Checking for changes
[10:09:13]Ant JUnit report watcher
[10:09:13][Ant JUnit report watcher] Watching paths:
[10:09:13][Ant JUnit report watcher] src/**/*Test*.java
[10:09:13]Publishing internal artifacts
[10:09:13]Clearing temporary directory: /Users/christianmacedo/Documents/TeamCity/buildAgent/temp/buildTmp
[10:09:13]Checkout directory: /Users/christianmacedo/Documents/TeamCity/buildAgent/work/ec7b4331d9c6af60
[10:09:13]Updating sources: server side checkout
[10:09:13]Step 1/1: Ant (2s)
[10:09:16]Ant JUnit report watcher
[10:09:16][Ant JUnit report watcher] 2 reports found for paths:
[10:09:16][Ant JUnit report watcher] src/**/*Test*.java
[10:09:16][Ant JUnit report watcher] 2 reports skipped as out-of-date
[10:09:16]Publishing internal artifacts
[10:09:16][Publishing internal artifacts] Sending using WebPublisher
[10:09:16][Publishing internal artifacts] Sending using ArtifactsCachePublisher
[10:09:16]Build finished

อย่างที่คุณเห็น พบการทดสอบหน่วยแต่ถูกข้ามไป ฉันจะไม่ข้ามได้อย่างไร


person TheMightyLlama    schedule 23.02.2014    source แหล่งที่มา
comment
คุณจัดการเพื่อแก้ไขปัญหานี้หรือไม่ ขอบคุณ   -  person Gavriel    schedule 01.06.2014
comment
ไม่. ฉันยังคงมีปัญหาเดียวกันทุกประการฉันกลัว   -  person TheMightyLlama    schedule 02.06.2014


คำตอบ (2)


นี่คือสิ่งที่เอกสารบอกว่า:

ปลั๊กอินจะพิจารณาเฉพาะไฟล์ที่อัปเดตตั้งแต่เริ่มสร้าง (พิจารณาจากการประทับเวลาไฟล์การแก้ไขครั้งล่าสุด)

มีสองวิธีในการตั้งค่าการประมวลผลรายงาน ผ่านสร้างฟีเจอร์ หรือผ่าน ข้อความบริการ หากคุณดำเนินการผ่านข้อความบริการ คุณสามารถตั้งค่า parseOutOfDate='true' ให้ละเว้นการประทับเวลาในไฟล์ได้

##teamcity[importData type='typeID' path='<path>' parseOutOfDate='true']
person Aron Curzon    schedule 28.10.2014

ตรวจสอบให้แน่ใจว่าคุณได้ซิงโครไนซ์เวลาบนเซิร์ฟเวอร์ของคุณ ในกรณีของฉัน (Debian 8.5) ปัญหาเดียวกันได้รับการแก้ไขโดยการตั้งค่า cron รายวันของ ntpdate:

sudo apt-get install ntpdate
sudo ln -s /usr/sbin/ntpdate-debian /etc/cron.daily/ntpdate-debian
person Alexander Yancharuk    schedule 01.07.2016