处理跨多个解决方案共享的界面中的更改?
我们的“主要”解决方案是开发代码:共享库、服务、UI 项目等。另一个解决方案是集成和自动化测试解决方案。它引用了几个开发项目。之所以分开,是为了避免干扰开发解决方案的单元测试 VSMDI 文件。并允许我们使用不同的执行方法(其他测试运行程序,如 Gallio 或 StoryTeller),而不会干扰开发解决方案。
最近,开发解决方案中的一个接口发生了变化,我们的一个测试模拟实现了该接口。但是,它没有更新,因为编译时没有警告,因为它在另一个解决方案中。这破坏了我们的 CI 构建。
有人有类似的设置吗?您如何处理这些问题,是否遵循严格的程序或者是否有某种技术答案?
Our "main" solution is the development code: shared libraries, services, UI projects, etc. The other solution is an integration and automated tests solution. It references several of the development projects. The reason it is separate is to avoid interference with the development solution's unit test VSMDI file. And to allow us to play with different execution methods (other test runners, like Gallio or StoryTeller) without interfering with the development solution.
Recently, an interface changed in the development solution, one of our test mocks implemented that interface. But, it was not updated because there was no warning at compile time because it was in another solution. This broke our CI build.
Does anyone have a similar setup? How do you handle these issues, do you follow a strict procedure or is there some kind of technical answer?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
一种方法是将所有共享接口提取到特定目录中,然后使用版本控制系统确保两个项目之间的目录相同 - 例如,如果您使用 Subversion,它有一个名为“< a href="http://svnbook.red-bean.com/en/1.1/ch07s04.html" rel="nofollow noreferrer">externals" 允许一个项目包含一个实际上是链接的目录到另一个项目中的指定目录(或指定目录的指定版本)。
One approach would be to extract any shared interfaces into a particular directory, and then use your version control system to ensure that the directory is the same between both projects -- for example, if you were using Subversion, it has a feature called "externals" that allows one project to contain a directory that is actually a link to a specified directory (or a specified version of a specified directory) in another project.
如果您的模拟实现了引用项目中的接口,则该项目必须与其余测试项目一起构建。如果事实并非如此,请检查 Visual Studio 中的构建顺序/构建配置。
接口更改仍然有可能不会触发任何编译错误,但测试会失败。但这与解决方案设置无关。
If your mock implements an interface from referenced project, than that project must have been built along with the rest of test projects. If it really isn't the case, check your build order/build configurations in visual studio.
It's still possible that an interface change does not trigger any compilation errors but tests do fail. But that's unrelated to solution setup.
我将所有非执行测试基础架构代码移至一个项目中。它现在处于开发和测试解决方案中。这样,如果开发代码被自动重构,它就会在我的项目中发生变化。如果对接口进行重大更改,它们将在编译期间成为错误。
I moved all my non-executing test infrastructure code into a single project. It's now in the development and test solution. This way, if development code is automatically refactored, it's changed in my project. If breaking changes are made to an interface, they'll become errors during compile.