如何对构建脚本进行单元测试?
我正在尝试对我的构建脚本进行单元测试。
我认为以下测试场景是正常场景
- 验证构建版本号正确性
- 验证msi的版本号并验证它们是否是最新的?
- 验证所有程序集是否都经过强名称签名
- 验证编译失败是否已传达给负责人?
构建脚本通常适用的所有其他测试用例有哪些?
I am trying to unit test my build script.
I think following testing scenarios are normal scenarios
- Verify the build version number correctness
- Verify version numbers of msi and verify whether they are latest?
- Verify whether all the assemblies were strong name signed
- verify whether compilation failures were communicated to responsible person?
What are all the other test cases may be commonly applicable for build script?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于“其他测试用例是什么” - 您可能想测试它是否正确处理故障 - 如果磁盘出现故障,如果编译失败,还有其他一些 I/O 错误。无论您的错误过程是什么,您都应该进行测试。
您的构建脚本也运行自动化测试吗?您可能想检查它是否确实运行了这些(此处递归),并正确报告了这些失败。
测试版本号似乎很简单。我假设您正在将版本号传递给脚本(或者有其他一些易于识别的方法来确定它们应该是什么)。检查您的构建工件在文件名/自述文件/任何位置是否包含这些数字。
For the "what are other test cases" - You probably want to test that it handles failures correctly - if a disk fails, if the compile fails, there's some other I/O error. Whatever your error procedures are, you should test for those.
Does your build script run your automated tests also? You might want to check that it actually runs those (getting recursive here), and reports failures from those correctly.
Testing the version numbers seems straightforward. I assume you are passing the version numbers to the script (or have some other easily identifiable way of figuring out what they should be). Check that your build artifacts have those numbers in the filename/readme/whereever.