- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在让 dotCover 在 Albacore 中工作时遇到一些问题 exec
使用相对路径的任务。
@xUnitRunnerPath = Pathname.new('../../Tools/xUnit/xunitcontrib-dotcover.2.0/xunit.runner.utility.dll').realpath
@myTestDll = 'C:\PathToProj\My.Project.Tests\bin\Release\My.project.Tests.dll'
@outputDir = 'C:\PathToTestResults\'
exec :testCoverage do |cmd|
cmd.command = "C:/BuildAgent/tools/dotCover/dotCover.exe"
cmd.parameters = [
"cover",
"/targetexecutable=$$#{@xUnitRunnerPath}$$",
"/targetarguments=$$#{@myTestDll}$$",
"/output=#{@outputDir}/My.Project.Tests.dll.dcvr"
]
end
dotCover
错误只是告诉我路径错误没有帮助
Failed to convert relative paths to absolute in parameters for the 'cover'
command. The given path's format is not supported.
/AnalyseTargetArguments=false
最佳答案
我将从您自己的答案中重新混合 rakefile/tasks。为了吸引更广泛的受众,您应该遵循一些 Ruby/Rake 约定。我对如何编写很棒的 rakefile 有一些看法。特别是...
1. 不要直接调用/执行 Rake 任务
Rake::Task[:unitTestWithCoverage].execute( testAssembly )
invoke
或
execute
.其中一个不调用依赖任务,一个只运行一次依赖任务......它变得愚蠢。应该总是有一种方法来构建正确定义和依赖的任务。
exec :unitTestWithCoverage, [:testAssembly] do |cmd, testAssembly|
testAssemblyRealPath = Pathname.new(testAssembly).realpath
testAssemblyName = File.basename(testAssemblyRealPath)
FileList
弄清楚如何创建自定义的,懒惰的,
mapped文件名/路径/任意字符串列表!
dotcover_path = 'path/to/dotcover.exe'
xunit_runner_path = 'path/to/xunitrunner.exe'
test_assemblies = FileList['path/to/output/**/*.test.dll']
coverage_results = "#{test_results_path}/coverage_results.dcvr"
task :cover_all => [ :tests_with_coverage, :publish_coverage_results ]
exec :tests_with_coverage do |cmd|
cmd.comand = dotcover_path
cmd.parameters = [
"cover",
"/AnalyseTargetArguments=False",
"/TargetExecutable=\"#{xunit_runner_path}\"",
"/TargetArguments=\"#{test_assemblies.join ','}\"",
"/Output=\"#{coverage_results}\""
]
end
task :publish_coverage_results => [ :tests_with_coverage ] do
import_data 'dotNetCoverage', 'dotCover', coverage_results
end
def import_data(type, tool, file)
puts "##teamcity[importData type='#{type}' tool='#{tool}' path='#{file}']"
end
File.expand_path
和
__FILE__
常量)。有些工具/任务需要相对路径,但您始终可以使用
File.basename
之类的方法。 .
dotcover_path = 'path/to/dotcover.exe'
xunit_runner_path = 'path/to/xunitrunner.exe'
FileList
构建的程序集来定义目标程序集。在测试任务的主体执行之前,我们不会对其进行评估。
test_assemblies = FileList['path/to/output/**/*.test.dll']
pathmap
.
coverage_results = "#{test_results_path}/coverage_results.dcvr"
task :cover_all => [ :tests_with_coverage, :publish_coverage_results ]
join
将目标列表转换为正确格式的字符串。
\"
)。
exec :tests_with_coverage do |cmd|
cmd.command = dotcover_path
cmd.parameters = [
"cover",
"/AnalyseTargetArguments=False",
"/TargetExecutable=\"#{xunit_runner_path}\"",
"/TargetArguments=\"#{test_assemblies.join ','}\"",
"/Output=\"#{coverage_results}\""
]
end
task publish_coverage_results => [ :tests_with_coverage ] do
import_data 'dotNetCoverage', 'dotCover', coverage_results
end
def import_data(type, tool, file)
puts "##teamcity[importData type='#{type}' tool='#{tool}' path='#{file}']"
end
FileList
很懒。在您枚举它之前它不会计算(例如,使用
each
、
map
或
zip
)。
each
在它上面生成测试任务......所以这行不通。它不会在列表中包含任何内容并且不会生成任何任务。或者,更糟糕的是,它会获取先前构建的输出并可能做坏事(如果您没有完全清理输出目录)。
test_assemblies = FileList['path/to/output/**/*.test.dll']
coverage_results = test_assemblies.pathmap "#{test_results_path}/%n.dcvr"
cover_task_names = test_assemblies.pathmap "cover_%n"
test_assemblies.zip(coverage_results, cover_task_names) do |assembly, results, task_name|
exec task_name do |cmd|
cmd.command = dotcover_path
cmd.parameters = [
"cover",
"/AnalyseTargetArguments=False",
"/TargetExecutable=#{xunit_path}",
"/TargetArguments=#{assembly}",
"/Output=#{results}"
]
end
end
关于rake - 为什么这个 dotCover rake 任务使用这些相对文件路径失败?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15480845/
我们有一个应用程序,我们可以在其中设计标签,然后根据设计创建图像并将其发送到打印机。图像在通过 TCP/IP 发送之前被制成字节流。 简而言之,我们有一个旋转设置,可以自动计算标签上不同元素的位置。而
我们在 IIS7 中有一个 MVC3 应用程序:http://mydomain.com/myapplication/ javascript 中的相对 URL 是什么: http://mydomain.
我的例子:http://jsfiddle.net/kwnk8qup/ 我的代码: container(父 div
如何将元素放置在右侧,并保持后面元素的持久位置? 我想在没有 Efficiently ... 的情况下将 text-align: right 对齐到右侧,并保留 t2 和 t3 元素之间的空间。 当我
假设我有一个包含以下文件的模块包。一个空文件 C:\codes\package\__init__.py 和一些重要文件: 一个位于C:\codes\package\first.py def f():
我正在尝试使用以下代码在屏幕上相对移动光标: input.type = INPUT_MOUSE; ZeroMemory(&input, sizeof(input)); input.mi.mouseDa
我排列了 3 个 div;中心 div 有许多 position:absolute 图像(它们重叠——一次显示一个图像;其余的是 display:none;对于 jQuery 交叉淡入淡出,这不是密切
我在 SQL 2000 数据库中有以下简化的表结构: ID AppName Key Value EffectiveDate -- ------- ----- ------- ---
给定以下配置: server { listen 80; server_name site.com; location /proxy { proxy_pa
我正在使用这些方法动态加载图像和资源目录,但它们并不适用于所有情况 new Uri(@"pack://application:,,/Images/lession_tab.png"); 此方法不适用于图
在插入/更新许多行时,我知道SQLite的“问题”,但事实并非如此。 我正在更新包含约250条记录的表中的ONE一行(由PK索引)中的ONE字段。查询通常需要200毫秒左右的时间。听起来很少,但很大。
如何向左或向右滑动线性布局。在该线性布局中,默认情况下我有一个不可见的删除按钮,还有一些其他小部件,它们都是可见状态,当向左滑动线性布局时,我需要使其可见的删除按钮,当向右滑动时,我需要隐藏该删除按钮
Imagen 我有一个 2D 点 (x,y) 列表,它们在我的简单游戏中描述了 2D 地形。 然后我让 glVertex() 在 GL_POINTS 模式下绘制所有这些点。 然后我有一个球,它也有它的
我正在使用 Google CloudSQL 并具有以下简单代码: ;dbname=', 'root', '' ); $db->setAttribute ( PDO::ATTR_ERRMODE, PDO
我知道有几个类似的问题,但是,其中的示例并没有说明问题,或者我无法从中获利 - 我真可耻。 所以我的问题是在带有 GUI 的简单应用程序中加载图像。例如: 我在 "D:\javaeclipseprog
我对放置在表格单元格内的 div 有疑问。单元格具有固定的高度和 div 相对于 height:100% 定位。 jsfiddle example td { height:80px;
我正在抓取一些数据。 我需要的数据点之一是日期,但包含此数据的表格单元格仅包括月份和日期。幸运的是,年份被用作对表格进行分类的标题元素。 出于某种原因,year = table.find_elemen
我想要一个 DIV,最大 90% 高度或 90% 宽度。我只想将图片作为背景放入 DIV 中,并且完整的 svg-image 应该是可见的。在移动设备和桌面设备上。 CSS: .camera {
我是网页设计新手,想了解 CSS 中定位的概念。我对相对和绝对定位元素有一些了解。在下面的 fiddle 中,我有一个 作为 的父级.当我做 p position:absolute ,边框崩溃不像我
我在调整图像高度相对于浏览器窗口的大小时遇到了一些严重的困难——宽度可以很好地调整大小,但高度保持不变。我尝试过 height: 100% 和 height: auto,以及 height: 10
我是一名优秀的程序员,十分优秀!