如何验证由msbuild创建的部署包? (优选使用mstest或nunit) [英] How to validate deployment packages created by msbuild? (preferably using mstest or nunit)

查看:262
本文介绍了如何验证由msbuild创建的部署包? (优选使用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:


  • 资源

  • 没有测试结果文件,obj文件或其他构建工件

  • 等等。

理想情况下,我可以使用nunit或mstest,这是任何熟悉的。 Msbuild知道包的位置。我们有很多包,可能在不同的分支上并发构建。 Ergo,包的位置和包的名称不是确定性的 - 所以测试不知道包的位置。

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,zip, $ b

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

推荐答案

我最后做的是做一堆自定义MS构建任务,在虚拟服务器上启动虚拟机,将MSI复制到机器,静默部署它,然后验证对它。我使用 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允许你开始干净,不会受到任何以前的安装dev盒。

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创建的部署包? (优选使用mstest或nunit)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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