如何对生产数据库进行单元测试? [英] How do I run a unit test against the production database?

查看:84
本文介绍了如何对生产数据库进行单元测试?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何针对生产数据库而不是测试数据库运行单元测试?

How do I run a unit test against the production database instead of the test database?

我有一个错误,似乎发生在我的生产服务器上,但不是我的开发计算机。

I have a bug that's seems to occur on my production server but not on my development computer.

我不在乎数据库是否被丢弃。

I don't care if the database gets trashed.

推荐答案

是否可以复制数据库或导致问题的数据库的一部分?如果您保留备份服务器,您可能可以从那里复制数据(请确保您有另一个备份,以防您弄乱备份数据库)。

Is it feasible to make a copy the database, or part of the database that causes the problem? If you keep a backup server, you might be able to copy the data from there instead (make sure you have another backup, in case you messed the backup database).

基本上,你不想混淆实时数据,你不想被遗忘,没有备份,以防万一你弄乱了(你会!)。

Basically, you don't want to mess with live data and you don't want to be left with no backup in case you mess something up (and you will!).

这篇关于如何对生产数据库进行单元测试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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