gpt4 book ai didi

android - Hudson Android 多配置测试项目找不到测试结果 - "No test report files were found. Configuration error?"

转载 作者:行者123 更新时间:2023-11-28 20:12:31 24 4
gpt4 key购买 nike

我有一个已集成到 Hudson 中的 android 测试项目。我创建了一个具有以下设置的自由式软件项目:1. 源代码管理 - 自定义工作区2. 在构建期间运行 Android 模拟器:* 安卓操作系统版本:4.0.3* 屏幕密度:240* 屏幕分辨率:WVGA* 设备区域设置:en_US* SD卡大小:16M3. 调用 Ant :目标:所有干净的艾玛调试安装测试构建文件:workspace/Project/build.xml4. 构建后操作* 归档 Artifact :**/*test-TEST.xml* 发布JUnit测试结果报告:**/*test-TEST.xml* 记录 Emma 覆盖率报告:**/coverage.xml* 记录文件指纹以跟踪使用情况:**/*test-TEST.xml这是涵盖我的 ant 目标的 build.xml 文件部分:

    <!-- version-tag: custom -->
<target name="test" depends="-test-project-check"
description="Runs tests from the package defined in test.package property">

<property name="tested.project.absolute.dir" location="${tested.project.dir}" />

<property name="test.runner" value="android.test.InstrumentationTestRunner" />

<!-- Application package of the tested project extracted from its manifest file -->
<xpath input="${tested.project.absolute.dir}/AndroidManifest.xml"
expression="/manifest/@package" output="tested.manifest.package" />
<xpath input="AndroidManifest.xml"
expression="/manifest/@package" output="manifest.package" />

<property name="emma.dump.file"
value="/data/data/${tested.manifest.package}/coverage.ec" />

<if condition="${emma.enabled}">
<then>
<echo>WARNING: Code Coverage is currently only supported on the emulator and rooted devices.</echo>
<run-tests-helper emma.enabled="true">
<extra-instrument-args>
<arg value="-e" />
<arg value="coverageFile" />
<arg value="${emma.dump.file}" />
</extra-instrument-args>
</run-tests-helper>
<echo>Downloading coverage file into project directory...</echo>
<exec executable="${adb}" failonerror="true">
<arg line="${adb.device.arg}" />
<arg value="pull" />
<arg value="${emma.dump.file}" />
<arg value="coverage.ec" />
</exec>
<echo>Extracting coverage report...</echo>
<emma>
<report sourcepath="${tested.project.absolute.dir}/${source.dir}"
verbosity="${verbosity}">
<!-- TODO: report.dir or something like should be introduced if necessary -->
<infileset dir=".">
<include name="coverage.ec" />
<include name="coverage.em" />
</infileset>
<!-- TODO: reports in other, indicated by user formats -->
<html outfile="${basedir}/coverage/coverage.html" />
<xml outfile="${basedir}/coverage/coverage.xml" />
</report>
</emma>
<echo>Cleaning up temporary files...</echo>
<delete file="coverage.ec" />
<delete file="coverage.em" />
<echo>Saving the report file in ${basedir}/coverage/coverage.html</echo>
</then>
<else>
<run-tests-helper />
</else>
</if>
<mkdir dir="${basedir}/junit-results" />
<echo>Base dir is ${basedir}</echo>
<exec executable="${adb}" failonerror="true" dir="${basedir}/junit-results">
<arg line="${adb.device.arg}" />
<arg value="pull" />
<arg value="/data/data/${tested.manifest.package}/files/" />
</exec>
</target>
<import file="${sdk.dir}/tools/ant/build.xml" />

</project>

现在,这个项目工作正常,我得到了 emma 覆盖率和测试结果,但是当我用相同的选项配置多配置项目时,除了 android 模拟器,我设置了不同的操作系统变量,密度和屏幕分辨率,我得到了遇到一个错误 -

test:
[echo] WARNING: Code Coverage is currently only supported on the emulator and rooted devices.
[echo] Running tests ...
[exec]
[exec] com.mobclix.android.externaltestharness.test.UnitActivityTest:.
[exec] Test results for PolideaInstrumentationTestRunner=.
[exec] Time: 25.122
[exec]
[exec] OK (1 test)
[exec]
[exec]
[exec] Generated code coverage data to /data/data/com.mobclix.android.externaltestharness/coverage.ec
[echo] Downloading coverage file into project directory...
[exec] 355 KB/s (2043 bytes in 0.005s)
[echo] Extracting coverage report...
[echo] Cleaning up temporary files...
[delete] Deleting: /Users/biercoff/Work/Workspace/HarnessExternalTest/coverage.ec
[delete] Deleting: /Users/biercoff/Work/Workspace/HarnessExternalTest/coverage.em
[echo] Saving the report file in /Users/biercoff/Work/Workspace/HarnessExternalTest/coverage/coverage.html
[echo] Base dir is /Users/biercoff/Work/Workspace/HarnessExternalTest
[exec] pull: building file list...
[exec] pull: /data/data/com.mobclix.android.externaltestharness/files/com.mobclix.android.externaltestharness.test-TEST.xml -> ./com.mobclix.android.externaltestharness.test-TEST.xml
[exec] 1 file pulled. 0 files skipped.
[exec] 40 KB/s (499 bytes in 0.012s)

BUILD SUCCESSFUL
Total time: 1 minute 20 seconds
$ /Users/biercoff/.hudson/tools/android-sdk/platform-tools/adb disconnect localhost:53830
[android] Stopping Android emulator
[android] Archiving emulator log
$ /Users/biercoff/.hudson/tools/android-sdk/platform-tools/adb kill-server
Recording fingerprints
Recording test results
No test report files were found. Configuration error?
Archiving artifacts
Description set:
Emma: looking for coverage reports in the provided path: /Users/biercoff/Work/Workspace/HarnessExternalTest/coverage/coverage.xml
Emma: found 1 report files:
/Users/biercoff/Work/Workspace/HarnessExternalTest/coverage/coverage.xml
Emma: stored 1 report files in the build folder: /Users/biercoff/.hudson/jobs/MulitTestHarnessProject/configurations/axis-density/240/axis-os/4.0.3/axis-resolution/WVGA/builds/2012-05-18_17-26-05/emma
Emma: Coverage: Classes 21/39 (54%). Methods 40/128 (31%). Blocks 833/2928 (28%). Lines 154.5/528 (29%).
[DEBUG] Skipping watched dependency update for build: MulitTestHarnessProject/density=240,os=4.0.3,resolution

对于 emma 覆盖,我必须将 Hudson 中的路径更改为/Users/biercoff/Work/Workspace/HarnessExternalTest/coverage/coverage.xml 以使其工作,但是当我试图对 Junit 测试结果做同样的事情时,Hudson 拒绝“看到”它。文件位于 junit-results 文件夹下的项目文件夹中,但每次我运行新构建时,我得到相同的未找到测试报告文件。配置错误? 错误消息。尝试了很多变体,但没有运气。我可能错过了一些非常小的东西。有人可以帮帮我吗?

最佳答案

Hudson 搜索与其工作区相关的 jUnit 测试结果。而且你不能指定绝对路径(我已经使用 Hudson/Jenkins 一年多了,但仍然不确定为什么不这样做)。因此,在您的情况下,它只查看目录级别比工作空间更深的内容。现在,对于多配置项目,工作区不是从顶层开始,而是从更深层次开始——它包括轴名称(例如:workspace_root/AXIS1_NAME/AXIS1_VAL...)。但是您的测试位于该工作区的目录树上。您必须在构建步骤中将它们复制${WORKSPACE},然后 Hudson 才能发布它们。

关于android - Hudson Android 多配置测试项目找不到测试结果 - "No test report files were found. Configuration error?",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10651392/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com