测试不同客户端和服务器版本的最佳Git策略 [英] Best Git strategy for testing different client and server versions

查看:279
本文介绍了测试不同客户端和服务器版本的最佳Git策略的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望能够运行Java客户端/服务器的集成测试(使用嵌入式码头)。另外,我希望能够在集成测试期间混合搭配不同的服务器和客户端源代码版本。



我想知道什么是最好的git或maven版本策略来完成这项工作:


  1. 对于客户端和服务器使用相同的git存储库,检出各种服务器版本的代码并根据各种客户端版本的代码进行测试是很困难的。

  2. 使用单独的git存储库(第一个存储库与客户端src和集成测试,第二个存储库与服务器src) - 它还需要检出两个存储库以运行集成测试,并假设它们之间有相对路径。测试客户端src代码仅针对Maven版本服务器WAR,可能会导致开发人员对服务器运行测试的诚实错误,该服务器WAR与检出不匹配服务器源代码。


解决方案

我建议保持过程简单,已经有足够的变量,而不会引入潜在的git管理问题。为此,我会避免子模块。我会给开发人员明确的分支/标签配对,以便在您的测试矩阵中测试客户端和服务器回购。

使用标签可以更轻松地重复使用在未来再次重复您矩阵中的相同测试,特别是在第一轮修复bug后。

总之,我推荐您的解决方案#2。相对路径假设优于子模块引入的潜在混淆。

I would like to be able to run integration tests for a Java client/server (using embedded jetty). In addition I would like to be able to mix-and-match different server and client source code versions during the integration testing.

I am wondering what the best git or maven version strategy to accomplish this:

  1. Using the same git repository for the client and the server, it would be difficult to checkout code of various server versions and test it against code of various client versions.

  2. Using separate git repositories (1st repository with client src and integration tests, 2nd repository with server src) - It would also require to checkout both repositories to run the integration tests, and assume relative paths between them.

  3. Testing the client src code only against maven-version server WAR, may result in honest mistakes of developers running tests against a server WAR that does not match the checked-out server source code.

解决方案

I suggest keeping the process simple, as you have enough variables going on already without introducing potential git management issues. To that end, I would avoid submodules. I would instead give the developers clear pairings of branches/tags to test for both the client and server repos in your testing matrix.

Use tags so you can more easily reuse and repeat the same tests in your matrix again in the future, especially after bugs have been fixed from the first round.

In short, I recommend your solution #2. The relative paths assumption is preferable to the potential confusion introduced by submodules.

这篇关于测试不同客户端和服务器版本的最佳Git策略的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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