如何验证所创建的MSBuild部署软件包? (preferably使用MSTest的或NUnit的) [英] How to validate deployment packages created by msbuild? (preferably using mstest or nunit)

查看:203
本文介绍了如何验证所创建的MSBuild部署软件包? (preferably使用MSTest的或NUnit的)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的MSBuild的过程中产生了各种各样ZIP包部署(主要是网站,但其他东西也一样)。我们有多种复发是守溜回问题 - 包括文件不应该,缺少资源。这个尖叫自动化验证。要测试的标准是简单的

Our msbuild process creates a variety of zip packages for deployment (mostly web sites, but other things as well). We have a variety of recurring problems that keep sneaking back - files included that shouldn't be, missing resources. This screams for automated validation. The criteria to test for are simple

foosite包的验证:

Validation of foosite package:


  • 资源文件是present。

  • 任何试验结果的文件,OBJ文件或其他构建工件

  • 等等。

在理想情况下,我可以使用NUnit的或MSTest的,这EVERONE熟悉。 MSBUILD知道哪里的包。我们有很多的包,可能并发建立在不同的分支。因此,这个包和包的名称的位置是不确定的 - 这样的测试不知道那里的包。

Ideally, I could use nunit or mstest, which everone is familiar with. Msbuild knows where the packages are. We have a lot of packages, possible concurrent builds on different branches. Ergo, the location of the packages and names of the packages are not deterministic - so the tests don't know where the packages are.

什么是饲料的MSBuild信息MSTEST或NUnit的最简单的方法是什么?这个问题的答案的这个问题将一个可能的答案,但是,这个问题得到了,而不是一个答案建筑的建议。我知道这是不是一个单元测试,但测试框架是得心应手,无论如何。我可以创建一个exe来验证构建 - 但为什么添加了几​​个小时,这个项目?

What is the simplest way to feed msbuild information to mstest or nunit? The answer to this question would one possible answer, however, that question got architectural advice instead of an answer. I know this isn't a unit test, but the test framework is handy, anyway. I could create an exe to validate the build - but why add a couple hours to the project?

或者,你有自动验证包建一个更好的建议?(MSI的,拉链,等等)?

Or, do you have a better suggestion for automatically validating build packages? (MSIs, zips, whatever)?

推荐答案

我已经结束了做的是有一堆定制的MS建立其旋转了一个虚拟机,虚拟服务器上的任务,微星复制到机器什么,静默方式部署它,然后验证反对。我用 PSEXEC 启动MSI。然后,它可以使用 MSTest的命令行亚军使用MSTest的和运行测试位。

What I've ended up doing is having a bunch of custom MS build tasks which spin up a virtual machine on Virtual Server, copy the MSI onto the machine, silently deploy it and then validate against it. I used PSExec to start the MSI. It could then use the MSTest command line runner to use MSTest and run your test bits.

这可能是矫枉过正你,但使用的是VM可以开始清洁,没有任何previous影响安装在你的开发框。

This is probably overkill for you, but using a VM allows you to start clean and not be affected by any previous installs on your dev box.

这篇关于如何验证所创建的MSBuild部署软件包? (preferably使用MSTest的或NUnit的)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆