Mocking XORM #1276

Open
opened 2019-04-22 20:11:45 +00:00 by happilymarrieddad · 1 comment
happilymarrieddad commented 2019-04-22 20:11:45 +00:00 (Migrated from github.com)

Is there a mocking library that works well with XORM. I've been trying to get gopkg.in/DATA-DOG/go-sqlmock.v1 to work but it's such a hassle to even get it running. When I try to mock complicated queries it just blows up and it's saying the sql string doesn't match despite it matching... Basically, I'm wondering what other people are doing to test without actually having to spin up a test database. That just seems wrong. Thanks!

Is there a mocking library that works well with XORM. I've been trying to get `gopkg.in/DATA-DOG/go-sqlmock.v1` to work but it's such a hassle to even get it running. When I try to mock complicated queries it just blows up and it's saying the sql string doesn't match despite it matching... Basically, I'm wondering what other people are doing to test without actually having to spin up a test database. That just seems wrong. Thanks!

Gitea are using xorm and use gopkg.in/testfixtures.v2 to do the unit tests. Maybe that will help you.

[Gitea](https://github.com/go-gitea/gitea) are using xorm and use `gopkg.in/testfixtures.v2` to do the unit tests. Maybe that will help you.
Sign in to join this conversation.
No Milestone
No Assignees
1 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#1276
No description provided.