有计划支持一些go的内存数据库来让单测更轻量么? #1636

Closed
opened 2020-03-27 08:18:02 +00:00 by joint-song · 2 comments

像题目中所描述,项目中使用了xorm,代码中的storage layer需要跑unit testing则必须依赖一个真实存在的服务,为了让单测更轻量,所以考虑引入ramsql等类似的go实现的内存数据库,在ci流程、integration testing中再去使用真实的db服务。使本地unit testing更轻量。所以请问有这方面的计划么?

像题目中所描述,项目中使用了xorm,代码中的storage layer需要跑unit testing则必须依赖一个真实存在的服务,为了让单测更轻量,所以考虑引入ramsql等类似的go实现的内存数据库,在ci流程、integration testing中再去使用真实的db服务。使本地unit testing更轻量。所以请问有这方面的计划么?
Owner

@joint-song different databases have different SQL syntax, I don't think it will make work easier to use another database server. Xorm use drone ci which support database docker images and all xorm tests run on sqlite/mysql/mssql/postgres/tidb/cockroach images.

@joint-song different databases have different SQL syntax, I don't think it will make work easier to use another database server. Xorm use drone ci which support database docker images and all xorm tests run on sqlite/mysql/mssql/postgres/tidb/cockroach images.
lunny added the
kind
question
label 2020-03-27 08:25:36 +00:00
Author

@joint-song different databases have different SQL syntax, I don't think it will make work easier to use another database server. Xorm use drone ci which support database docker images and all xorm tests run on sqlite/mysql/mssql/postgres/tidb/cockroach images.

Thanks for your reply.
Recently I'm trying to lightweight unit testing of many layers including storage layer. It would make TDD easier if I can run all unit testing without any infra layers.
Each database dialect differences much in clause, function, and types. I can totally understand what you said and the big difficulty to implement such a functionality.
I'll still startup a db server in my local machine during development. And I'll close this issue as well.

> @joint-song different databases have different SQL syntax, I don't think it will make work easier to use another database server. Xorm use drone ci which support database docker images and all xorm tests run on sqlite/mysql/mssql/postgres/tidb/cockroach images. Thanks for your reply. Recently I'm trying to lightweight unit testing of many layers including storage layer. It would make TDD easier if I can run all unit testing without any infra layers. Each database dialect differences much in clause, function, and types. I can totally understand what you said and the big difficulty to implement such a functionality. I'll still startup a db server in my local machine during development. And I'll close this issue as well.
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: xorm/xorm#1636
No description provided.