建立多样化的数据库测试环境

发布于 2024-07-17 03:54:31 字数 788 浏览 6 评论 0 原文

我正在编写一些需要针对一系列不同数据库产品工作的代码。

  • MySql
  • Sql Server 2000 至 2008
  • PostgreSQL
  • Oracle 9i & 10g
  • Jet 4.0 (MS Access)
  • MSDE
  • Sybase Adaptive Server Anywhere
  • Sybase Sql Anywhere
  • Progress OpenEdge

我们需要针对每个数据库产品运行一组通用集成测试,作为持续集成构建的一部分。

我确信其他人也必须设置类似的测试环境,我想利用其中的一些智慧 - 您最终使用了哪些策略,哪些有效或无效?

一些想法:

  • 为每个产品提供单独的虚拟机,每个虚拟机分配少量内存(在某些情况下更容易管理,或者我们对各个产品的设置略有不同)。
  • 几个虚拟机,甚至一个用于所有产品的虚拟机(即可能是用于 postgresql 和 mysql 的 ubuntu 盒子,以及用于其余产品的 Windows 2008 服务器机器) - 我喜欢一两个虚拟机,因为这是一个更用于运行测试的便携式环境,即在路上/异地时,因为我的笔记本电脑可能会在运行 8 或 10 个小型虚拟机时慢慢停止。

最后,您如何解决其中一些商业产品(例如 Oracle 或 Progress OpenEdge)高昂的成本问题?以前的版本是否仍然可用,即是否有免费的“单一开发人员”版本可用,或者购买这些产品的更便宜的途径?

I'm writing some code that needs to work against an array of different database products.

  • MySql
  • Sql Server 2000 to 2008
  • PostgreSQL
  • Oracle 9i & 10g
  • Jet 4.0 (MS Access)
  • MSDE
  • Sybase Adaptive Server Anywhere
  • Sybase Sql Anywhere
  • Progress OpenEdge

We have a set of generic integration tests that we need to run against each database product, as part of a continuous integration build.

I'm sure other people have had to set-up similar test environments and I would like to tap into some of that wisdom - what strategies do you end up using, what worked well or did not work well?

Some thoughts:

  • Separate virtual machines for each of the products, each allocated a small amount of memory (easier to manage for certain scenarios, or where we have slightly different setup's for individual products).
  • A couple of virtual machines or even a single virtual machine for all the products (i.e. perhaps an ubuntu box for postgresql & mysql, and a windows 2008 server machine for the remaining products) - I like one or two vm's because this is a more portable environment for running the tests i.e. when on the road / off-site, as my laptop would probably crawl to a halt running 8 or 10 small VM's.

And finally how have you tackled the prohibitive cost of some of these commercial products i.e. Oracle or Progress OpenEdge, and are the previous versions still available i.e. are there free "single-developer" editions available, or cheaper routes to purchasing these products?

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

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

发布评论

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

评论(6

ぃ弥猫深巷。 2024-07-24 03:54:31
  • 我们还使用 vmware 作为服务器,每个数据库一台 vmware 主机。 您应该可以将多个数据库放在一个 vmware 上。
  • 昂贵的软件许可证应该不会有太大问题。 例如,Oracle 允许您拥有其所有产品的开发许可证。 只要您不在笔记本电脑 vmware 上运行生产数据库,就应该没问题。 当然,IANAL。
  • 对于 Oracle,如果您的客户将使用企业版(最有可能),请获取企业版。
  • 确保并利用 vmware 快照。 您可以完美配置数据库以运行测试,运行测试,然后将数据库恢复到测试前状态,准备再次运行测试。
  • We also use vmware for our servers, one vmware host per database. You should be OK with putting several databases on one vmware.
  • You shouldn't have much a problem with expensive software licenses. Oracle, for example, allows you to have a development license for all of their products. So long as you are not running a production DB on your laptop vmware, you should be OK. Of course, IANAL.
  • For Oracle, get the Enterprise Edition if that's what your customers will be using (most likely).
  • Be sure and take advantage of vmware snapshots. You can get the databases configured perfectly for running your tests, run your tests, and then revert the databases back to the pre-test state ready for running your tests again.
空心空情空意 2024-07-24 03:54:31

我们在这里所做的(主要是)为每个所需的配置准备一个虚拟机,我们还针对不同的操作系统,因此我们正在测试大约 22 个配置。 这些虚拟机托管在 ESX 服务器中,并编写脚本以在需要时启动和停止,以便它们不会同时运行。 设置工作量很多

就数据库服务器的成本而言,我们正在构建的软件类型需要高端版本,因此测试成本已计入总体开发成本(我们只能“忍耐”)

What we do here is (mostly) a VM for each configuration required, we also target different operating systems so have something like 22 configurations we are testing. These VM's are hosted in an ESX server, and scripted to start and stop when required so that they are not all running at once. It was a lot of work to set up.

In terms of cost of the Database servers, the kind of software we are building required top-end versions so the testing costs have been factored into the overall dev costs (we just had to "suck it up")

豆芽 2024-07-24 03:54:31

Oracle 确实有一个免费的“Express Edition”。 它不具备 Oracle 的所有功能,但如果您还针对 Jet 运行,那么这应该不是问题。

Oracle does have a free 'Express Edition'. It doesn't have all of Oracle's functionality but then if you are also running against Jet then that shouldn't be an issue.

花开柳相依 2024-07-24 03:54:31

从架构上来说,最好创建一个足够强大的服务器集成测试场来运行各种配置的虚拟机。 它前面可以有一个队列进程来监听集成测试请求(可以使用 svn 提交或其他源代码控制检查触发器来触发)。

为了获得最准确的测试范围,您可能希望每个配置都有一个单独的虚拟机。 这将降低配置冲突的风险,并提高运行自定义虚拟机集的灵活性(例如,Oracle + MySQL + PostgreSQL,而不是其他虚拟机等)。 根据您的构建过程,它还可能允许您运行 10 分钟的构建。

运行集成测试场的一个好处是,如果您在路上使用笔记本电脑,则可以在代码签入后触发集成构建,运行所有测试并让它通知您结果。 您还可以存档每个请求和结果,以帮助诊断失败的构建。

Architecturally, it may be better off creating an integration testing farm of server(s) that are powerful enough to run the variously configured VMs. It could be fronted with a queue process listening for integration testing requests (which could be triggered using svn commits or other source control check in triggers).

For the most accurate range of testing, you probably want to have a separate VM for each configuration. This will reduce the risk of conflicting configs and also increase the flexibility of running a custom set of VMs (e.g. Oracle + MySQL + PostgreSQL and not the others, etc.). Depending on your build process, it may also allow you to run 10-minute builds.

A benefit of running an integration test farm is that if you're on the road using your laptop, you can trigger off the integration build after code check-in, run all the tests and have it notify you of the results. You can also archive each request and the results to help diagnose failing builds.

云雾 2024-07-24 03:54:31

Oracle 许可证摘录:

我们授予您非独占的、不可转让的有限许可,仅将这些程序用于开发、测试、原型设计和演示您的应用程序,不得用于任何其他目的。

因此,您可以下载完整的 Oracle 版本 9、10 和 11,并按照许可证中的说明免费使用它们。
检查下载部分 www.oracle.com

Oracle license excerpt:

We grant you a nonexclusive, nontransferable limited license to use the programs only for the purpose of developing, testing, prototyping and demonstrating your application, and not for any other purpose.

So, you can download full Oracle versions 9, 10 and 11 and use them free of charge as stated in license.
Check downloads section at www.oracle.com

听风念你 2024-07-24 03:54:31

听起来你已经很清楚该做什么了。 我建议采用以下 VM 布局:

托管以下虚拟机的 Windows Server 2008 机器:

  • MSDE
  • Jet 4.0 (MS Access)
  • Sybase Adaptive Server Anywhere
  • Sybase Sql Anywhere
  • Progress OpenEdge

在 Ubuntu 或 Red Hat 机器上:

我认为没有必要针对完整的 SQL 和 Oracle 进行测试版本。 免费版本已被精简,因此当您在这些服务器的完整版本上运行它时,代码破坏的风险非常小。 如果您已经针对完整服务器进行了测试并使用了免费的东西,那么是的,有些东西可能会损坏,但是通过使用最小公分母进行测试,您应该确保良好的质量。

It sounds like you have a good idea of what to do already. I'd suggest the following VM layouts:

A Windows Server 2008 box hosting the following:

  • MSDE
  • Jet 4.0 (MS Access)
  • Sybase Adaptive Server Anywhere
  • Sybase Sql Anywhere
  • Progress OpenEdge

On an Ubuntu or Red Hat box:

I don't see any need to test against the full blown SQL and Oracle editions. The free editions are stripped down, so there is very little risk of that code breaking when you run it against the full version of those servers. If you had tested against the full server and went down to the free stuff, then yes some things might break, but by testing with the least common denominator, you should ensure good quality.

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