MSBuild 任务的测试驱动开发

发布于 2024-09-10 17:50:58 字数 174 浏览 2 评论 0原文

在以测试驱动的方式开发自定义 MSBuild 任务时,您会采取什么方法?

是否有任何可用的测试工具适合测试驱动 Microsoft.Build.Utilities.ToolTask​​ 扩展的开发?

我正在考虑尝试使用 NUnit 或 MSUnit 并检查生成的文件及其放置位置,尽管我预见这有点笨拙。

What approach would you take while developing a custom MSBuild Task in a test driven way?

Are there any available test harnesses suitable for test drive development of a Microsoft.Build.Utilities.ToolTask extension?

I was considering attempting to use NUnit or MSUnit and check files generated and where they are placed, though this I forsee this as being a little clunky.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

请你别敷衍 2024-09-17 17:50:58

这不是真正的 TDD 方式,但看看工具 MS Build Sidekicks

这个工具确实帮助我们开发我们的每晚/每日构建(包括数据库创建、结构比较、代码分析、测试执行、clickonce 部署...)

您可以在构建机器和本地开发机器上分析和调试构建类型。

it's not really TDD way but look at the Tool MS Build Sidekicks

This tool really helps us to develop our nightly/daily builds (with database creation, structure compare, CodeAnalysis, test execution, clickonce deployment ...)

You can analyse and debug the build types on the build machine and on the local development machine.

也只是曾经 2024-09-17 17:50:58

构建脚本不是为了测试而设计的。但是

您可以为构建创建一些 SmokeTest,以查看一切是否正常。如果您正在部署一个网站,您可以进行一些冒烟测试来查看:

  1. 可以打开登录页面
  2. 登录页面有效(您可以进行正确的登录和失败的登录)
  3. 核心功能有效(一旦您访问您的网站,您可以执行一些基本操作)动作像
    打开产品页面或类似的)

这些冒烟测试应该能够从命令行调用,因此您可以从任务 AfterDropBuild 调用它们,以在创建构建后查看冒烟测试的结果。

Build scripts are not designed to be tested.. but

You can create some SmokeTests of your build to see if everything went ok. If you are deploying a website you can have some smoke tests to see:

  1. Login page could be opened
  2. Login page works (You can make a correct login and a failed one)
  3. Core funcionality works (Once you accessed to your site you can perform some basic action like
    opening product page or similar)

Those smoke test should be able to be called from command line, so you can call them from task AfterDropBuild to see the result of smoke tests just after build was created.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文